Skip to content

Commit

Permalink
Fix php hightlight (#3317)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Davis <[email protected]>
  • Loading branch information
erasin and the-mikedavis authored Aug 5, 2022
1 parent 3121353 commit bf6f704
Showing 1 changed file with 61 additions and 50 deletions.
111 changes: 61 additions & 50 deletions runtime/queries/php/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
(named_type (name) @type) @type
(named_type (qualified_name) @type) @type

(namespace_definition
name: (namespace_name (name) @namespace))

; Superglobals
(subscript_expression
(variable_name(name) @constant.builtin
(#match? @constant.builtin "^_?[A-Z][A-Z\\d_]+$")))

; Functions

(array_creation_expression "array" @function.builtin)
Expand All @@ -17,7 +25,7 @@
name: (name) @function.method)

(function_call_expression
function: (qualified_name (name)) @function)
function: (_) @function)

(scoped_call_expression
name: (name) @function)
Expand All @@ -28,6 +36,7 @@
(function_definition
name: (name) @function)


; Member

(property_element
Expand Down Expand Up @@ -67,52 +76,54 @@

; 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
[
"abstract"
"as"
"break"
"case"
"catch"
"class"
"const"
"continue"
"declare"
"default"
"do"
"echo"
"else"
"elseif"
"enddeclare"
"endforeach"
"endif"
"endswitch"
"endwhile"
"enum"
"extends"
"final"
"finally"
"foreach"
"fn"
"function"
"global"
"if"
"implements"
"include_once"
"include"
"insteadof"
"interface"
"match"
"namespace"
"new"
"private"
"protected"
"public"
"require_once"
"require"
"return"
"static"
"switch"
"throw"
"trait"
"try"
"use"
"while"
] @keyword

0 comments on commit bf6f704

Please sign in to comment.