diff options
| author | Michael Härtl <haertl.mike@gmail.com> | 2022-01-14 21:37:23 +0100 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-01-15 12:32:03 +0100 |
| commit | 749f72d3515bf9b53ee55f8aa7bc06151b2ee753 (patch) | |
| tree | ed14eccc49c3a3c9462e42e59dfe9e56a85fb643 | |
| parent | highlights(haskell): function with type signature (diff) | |
| download | nvim-treesitter-749f72d3515bf9b53ee55f8aa7bc06151b2ee753.tar nvim-treesitter-749f72d3515bf9b53ee55f8aa7bc06151b2ee753.tar.gz nvim-treesitter-749f72d3515bf9b53ee55f8aa7bc06151b2ee753.tar.bz2 nvim-treesitter-749f72d3515bf9b53ee55f8aa7bc06151b2ee753.tar.lz nvim-treesitter-749f72d3515bf9b53ee55f8aa7bc06151b2ee753.tar.xz nvim-treesitter-749f72d3515bf9b53ee55f8aa7bc06151b2ee753.tar.zst nvim-treesitter-749f72d3515bf9b53ee55f8aa7bc06151b2ee753.zip | |
highlights(php): fix and add missing highlights
| -rw-r--r-- | queries/php/highlights.scm | 68 |
1 files changed, 61 insertions, 7 deletions
diff --git a/queries/php/highlights.scm b/queries/php/highlights.scm index db2223dbd..17c3f28f5 100644 --- a/queries/php/highlights.scm +++ b/queries/php/highlights.scm @@ -10,6 +10,23 @@ ] @type.builtin (named_type (name)) @type (named_type (qualified_name)) @type +(class_declaration + name: (name) @type) +(base_clause + [(name) (qualified_name)] @type) +(enum_declaration + name: (name) @type) +(interface_declaration + name: (name) @type) +(namespace_use_clause + [(name) (qualified_name)] @type) +(class_interface_clause + [(name) (qualified_name)] @type) +(scoped_call_expression + scope: [(name) (qualified_name)] @type) +(class_constant_access_expression + . [(name) (qualified_name)] @type + (name) @constant) ; Functions @@ -37,6 +54,12 @@ (nullsafe_member_call_expression name: (name) @method) +; Parameters +[ + (simple_parameter) + (variadic_parameter) +] @parameter + ; Member (property_element @@ -58,17 +81,25 @@ ((name) @constructor (#lua-match? @constructor "^[A-Z]")) +(const_declaration (const_element (name) @constant)) + ((name) @variable.builtin (#eq? @variable.builtin "this")) -(variable_name) @variable +; Namespace +(namespace_definition + name: (namespace_name) @namespace) +; Conditions ( ? : ) +(conditional_expression) @conditional ; Basic tokens [ (string) (heredoc) + (shell_command_expression) ; backtick operator: `ls -la` ] @string +(encapsed_string (escape_sequence) @string.escape) (boolean) @boolean (null) @constant.builtin @@ -76,10 +107,15 @@ (float) @float (comment) @comment +(named_label_statement) @label ; Keywords [ + "and" "as" + "instanceof" + "or" + "xor" ] @keyword.operator [ @@ -92,19 +128,19 @@ "abstract" "break" "class" + "clone" "const" - "continue" "declare" "default" "echo" - "unset" "enddeclare" + "enum" "extends" "final" "global" + "goto" "implements" "insteadof" - "instanceof" "interface" "namespace" "new" @@ -113,9 +149,13 @@ "public" "static" "trait" + "unset" ] @keyword -"return" @keyword.return +[ + "return" + "yield" +] @keyword.return [ "case" @@ -126,9 +166,11 @@ "if" "switch" "match" + "??" ] @conditional [ + "continue" "do" "endfor" "endforeach" @@ -156,7 +198,6 @@ [ "," ";" - "." ] @punctuation.delimiter [ @@ -173,14 +214,17 @@ [ "=" + "." "-" "*" "/" "+" "%" + "**" "~" "|" + "^" "&" "<<" ">>" @@ -194,6 +238,7 @@ "<=" ">=" ">" + "<>" "==" "!=" "===" @@ -203,15 +248,24 @@ "&&" "||" + ".=" "-=" "+=" "*=" "/=" "%=" - "|=" + "**=" "&=" + "|=" + "^=" + "<<=" + ">>=" + "??=" "--" "++" + + "@" + "::" ] @operator (ERROR) @error |
