Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions extension.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ language = "PHP"

[grammars.php]
repository = "https://github.com/tree-sitter/tree-sitter-php"
commit = "8ab93274065cbaf529ea15c24360cfa3348ec9e4"
commit = "5b5627faaa290d89eb3d01b9bf47c3bb9e797dea"
path = "php"

[grammars.phpdoc]
repository = "https://github.com/claytonrcarter/tree-sitter-phpdoc"
commit = "03bb10330704b0b371b044e937d5cc7cd40b4999"
commit = "488198e61f49fc74ee54069a4126b556665a57cc"
7 changes: 3 additions & 4 deletions languages/php/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(php_tag) @tag
"?>" @tag
(php_end_tag) @tag

; Types

Expand Down Expand Up @@ -80,7 +80,7 @@
; Basic tokens
[
(string)
(string_value)
(string_content)
(encapsed_string)
(heredoc)
(heredoc_body)
Expand Down Expand Up @@ -170,7 +170,6 @@
"and" @keyword
"as" @keyword
"break" @keyword
"callable" @keyword
"case" @keyword
"catch" @keyword
"class" @keyword
Expand All @@ -197,7 +196,6 @@
"for" @keyword
"foreach" @keyword
"fn" @keyword
"from" @keyword
"function" @keyword
"global" @keyword
"goto" @keyword
Expand Down Expand Up @@ -229,3 +227,4 @@
"while" @keyword
"xor" @keyword
"yield" @keyword
"yield from" @keyword
4 changes: 2 additions & 2 deletions languages/php/outline.scm
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
.
(argument
[
(encapsed_string (string_value) @name)
(string (string_value) @name)
(encapsed_string (string_content) @name)
(string (string_content) @name)
]
)
)
Expand Down
24 changes: 14 additions & 10 deletions languages/php/runnables.scm
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
; and the method is public
(
(class_declaration
modifier: (_)? @_modifier
(#not-eq? @_modifier "abstract")
(_)* @_modifier
(#not-any-eq? @_modifier "abstract")
.
name: (_) @_name
(#match? @_name ".*Test$")
body: (declaration_list
Expand All @@ -26,8 +27,9 @@
; and the method is public
(
(class_declaration
modifier: (_)? @_modifier
(#not-eq? @_modifier "abstract")
(_)* @_modifier
(#not-any-eq? @_modifier "abstract")
.
name: (_) @_name
(#match? @_name ".*Test$")
body: (declaration_list
Expand All @@ -51,8 +53,9 @@
; and the method is public
(
(class_declaration
modifier: (_)? @_modifier
(#not-eq? @_modifier "abstract")
(_)* @_modifier
(#not-any-eq? @_modifier "abstract")
.
name: (_) @_name
(#match? @_name ".*Test$")
body: (declaration_list
Expand All @@ -77,8 +80,9 @@
; and that doesn't have the abstract modifier
(
(class_declaration
modifier: (_)? @_modifier
(#not-eq? @_modifier "abstract")
(_)* @_modifier
(#not-any-eq? @_modifier "abstract")
.
name: (_) @run
(#match? @run ".*Test$")
) @_phpunit-test
Expand All @@ -95,8 +99,8 @@
.
(argument
[
(encapsed_string (string_value) @run)
(string (string_value) @run)
(encapsed_string (string_content) @run)
(string (string_content) @run)
]
)
)
Expand Down