diff options
author | Indrajith K L | 2022-12-03 17:00:20 +0530 |
---|---|---|
committer | Indrajith K L | 2022-12-03 17:00:20 +0530 |
commit | f5c4671bfbad96bf346bd7e9a21fc4317b4959df (patch) | |
tree | 2764fc62da58f2ba8da7ed341643fc359873142f /helix-22.03-x86_64-windows/runtime/queries/php | |
download | cli-tools-windows-master.tar.gz cli-tools-windows-master.tar.bz2 cli-tools-windows-master.zip |
Diffstat (limited to 'helix-22.03-x86_64-windows/runtime/queries/php')
5 files changed, 201 insertions, 0 deletions
diff --git a/helix-22.03-x86_64-windows/runtime/queries/php/highlights.scm b/helix-22.03-x86_64-windows/runtime/queries/php/highlights.scm new file mode 100644 index 0000000..5379fa1 --- /dev/null +++ b/helix-22.03-x86_64-windows/runtime/queries/php/highlights.scm @@ -0,0 +1,118 @@ +(php_tag) @tag +"?>" @tag + +; Types + +(primitive_type) @type.builtin +(cast_type) @type.builtin +(named_type (name) @type) @type +(named_type (qualified_name) @type) @type + +; Functions + +(array_creation_expression "array" @function.builtin) +(list_literal "list" @function.builtin) + +(method_declaration + name: (name) @function.method) + +(function_call_expression + function: (qualified_name (name)) @function) + +(scoped_call_expression + name: (name) @function) + +(member_call_expression + name: (name) @function.method) + +(function_definition + name: (name) @function) + +; Member + +(property_element + (variable_name) @variable.other.member) + +(member_access_expression + name: (variable_name (name)) @variable.other.member) +(member_access_expression + name: (name) @variable.other.member) + +; Variables + +(relative_scope) @variable.builtin + +((name) @constant + (#match? @constant "^_?[A-Z][A-Z\\d_]+$")) + +((name) @constructor + (#match? @constructor "^[A-Z]")) + +((name) @variable.builtin + (#eq? @variable.builtin "this")) + +(variable_name) @variable + +; Basic tokens + +(string) @string +(heredoc) @string +(boolean) @constant.builtin.boolean +(null) @constant.builtin +(integer) @constant.numeric.integer +(float) @constant.numeric.float +(comment) @comment + +"$" @operator + +; Keywords + +"abstract" @keyword +"as" @keyword +"break" @keyword +"case" @keyword +"catch" @keyword +"class" @keyword +"const" @keyword +"continue" @keyword +"declare" @keyword +"default" @keyword +"do" @keyword +"echo" @keyword +"else" @keyword +"elseif" @keyword +"enddeclare" @keyword +"endforeach" @keyword +"endif" @keyword +"endswitch" @keyword +"endwhile" @keyword +"enum" @keyword +"extends" @keyword +"final" @keyword +"finally" @keyword +"foreach" @keyword +"fn" @keyword +"function" @keyword +"global" @keyword +"if" @keyword +"implements" @keyword +"include_once" @keyword +"include" @keyword +"insteadof" @keyword +"interface" @keyword +"match" @keyword +"namespace" @keyword +"new" @keyword +"private" @keyword +"protected" @keyword +"public" @keyword +"require_once" @keyword +"require" @keyword +"return" @keyword +"static" @keyword +"switch" @keyword +"throw" @keyword +"trait" @keyword +"try" @keyword +"use" @keyword +"while" @keyword diff --git a/helix-22.03-x86_64-windows/runtime/queries/php/indents.toml b/helix-22.03-x86_64-windows/runtime/queries/php/indents.toml new file mode 100644 index 0000000..85c104d --- /dev/null +++ b/helix-22.03-x86_64-windows/runtime/queries/php/indents.toml @@ -0,0 +1,17 @@ +indent = [ + "array_creation_expression", + "arguments", + "formal_parameters", + "compound_statement", + "declaration_list", + "binary_expression", + "return_statement", + "expression_statement", + "switch_block", + "anonymous_function_use_clause", +] + +oudent = [ + "}", + ")", +] diff --git a/helix-22.03-x86_64-windows/runtime/queries/php/injections.scm b/helix-22.03-x86_64-windows/runtime/queries/php/injections.scm new file mode 100644 index 0000000..614a385 --- /dev/null +++ b/helix-22.03-x86_64-windows/runtime/queries/php/injections.scm @@ -0,0 +1,6 @@ +((text) @injection.content + (#set! injection.language "html") + (#set! injection.combined)) + +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/helix-22.03-x86_64-windows/runtime/queries/php/tags.scm b/helix-22.03-x86_64-windows/runtime/queries/php/tags.scm new file mode 100644 index 0000000..ef889ce --- /dev/null +++ b/helix-22.03-x86_64-windows/runtime/queries/php/tags.scm @@ -0,0 +1,26 @@ +(class_declaration + name: (name) @name) @definition.class + +(function_definition + name: (name) @name) @definition.function + +(method_declaration + name: (name) @name) @definition.function + +(object_creation_expression + [ + (qualified_name (name) @name) + (variable_name (name) @name) + ]) @reference.class + +(function_call_expression + function: [ + (qualified_name (name) @name) + (variable_name (name)) @name + ]) @reference.call + +(scoped_call_expression + name: (name) @name) @reference.call + +(member_call_expression + name: (name) @name) @reference.call diff --git a/helix-22.03-x86_64-windows/runtime/queries/php/textobjects.scm b/helix-22.03-x86_64-windows/runtime/queries/php/textobjects.scm new file mode 100644 index 0000000..51abe5c --- /dev/null +++ b/helix-22.03-x86_64-windows/runtime/queries/php/textobjects.scm @@ -0,0 +1,34 @@ +(class_declaration + body: (_) @class.inside) @class.around + +(interface_declaration + body: (_) @class.inside) @class.around + +(trait_declaration + body: (_) @class.inside) @class.around + +(enum_declaration + body: (_) @class.inside) @class.around + +(function_definition + body: (_) @function.inside) @function.around + +(method_declaration + body: (_) @function.inside) @function.around + +(arrow_function + body: (_) @function.inside) @function.around + +(anonymous_function_creation_expression + body: (_) @function.inside) @function.around + +(formal_parameters + [ + (simple_parameter) + (variadic_parameter) + (property_promotion_parameter) + ] @parameter.inside) + +(comment) @comment.inside + +(comment)+ @comment.around |