mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-13 08:50:11 -04:00
highlights(hack): fix captures
This commit is contained in:
parent
bedc763361
commit
6725bef5ce
3 changed files with 29 additions and 20 deletions
|
|
@ -6,15 +6,15 @@
|
||||||
(braced_expression) @none
|
(braced_expression) @none
|
||||||
|
|
||||||
(scoped_identifier
|
(scoped_identifier
|
||||||
(qualified_identifier
|
(qualified_identifier
|
||||||
(identifier) @type))
|
(identifier) @type))
|
||||||
|
|
||||||
(comment) @comment
|
|
||||||
(heredoc) @comment
|
|
||||||
|
|
||||||
[
|
[
|
||||||
"function"
|
(comment)
|
||||||
] @keyword.function
|
(heredoc)
|
||||||
|
] @comment
|
||||||
|
|
||||||
|
"function" @keyword.function
|
||||||
|
|
||||||
[
|
[
|
||||||
"async"
|
"async"
|
||||||
|
|
@ -23,20 +23,21 @@
|
||||||
"interface"
|
"interface"
|
||||||
"implements"
|
"implements"
|
||||||
"class"
|
"class"
|
||||||
"protected"
|
|
||||||
"private"
|
|
||||||
"public"
|
|
||||||
"using"
|
"using"
|
||||||
"namespace"
|
"namespace"
|
||||||
"attribute"
|
"attribute"
|
||||||
"const"
|
"const"
|
||||||
(xhp_modifier)
|
|
||||||
(final_modifier)
|
|
||||||
"extends"
|
"extends"
|
||||||
"insteadof"
|
"insteadof"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
"use" @include
|
[
|
||||||
|
"use"
|
||||||
|
"include"
|
||||||
|
"include_once"
|
||||||
|
"require"
|
||||||
|
"require_once"
|
||||||
|
] @include
|
||||||
|
|
||||||
[
|
[
|
||||||
"new"
|
"new"
|
||||||
|
|
@ -47,9 +48,15 @@
|
||||||
"as"
|
"as"
|
||||||
] @keyword.operator
|
] @keyword.operator
|
||||||
|
|
||||||
|
"return" @keyword.return
|
||||||
|
|
||||||
[
|
[
|
||||||
"return"
|
(abstract_modifier)
|
||||||
] @keyword.return
|
(final_modifier)
|
||||||
|
(static_modifier)
|
||||||
|
(visibility_modifier)
|
||||||
|
(xhp_modifier)
|
||||||
|
] @type.qualifier
|
||||||
|
|
||||||
[
|
[
|
||||||
"shape"
|
"shape"
|
||||||
|
|
@ -92,10 +99,10 @@
|
||||||
(qualified_identifier
|
(qualified_identifier
|
||||||
(identifier) @type .))
|
(identifier) @type .))
|
||||||
|
|
||||||
(attribute_modifier) @attribute
|
|
||||||
[
|
[
|
||||||
"@required"
|
"@required"
|
||||||
"@lateinit"
|
"@lateinit"
|
||||||
|
(attribute_modifier)
|
||||||
] @attribute
|
] @attribute
|
||||||
|
|
||||||
[
|
[
|
||||||
|
|
@ -262,6 +269,8 @@
|
||||||
[ "</" ">" ] @tag.delimiter)
|
[ "</" ">" ] @tag.delimiter)
|
||||||
|
|
||||||
[ "." ";" "::" ":" "," ] @punctuation.delimiter
|
[ "." ";" "::" ":" "," ] @punctuation.delimiter
|
||||||
|
(qualified_identifier
|
||||||
|
"\\" @punctuation.delimiter)
|
||||||
|
|
||||||
(ternary_expression
|
(ternary_expression
|
||||||
["?" ":"] @conditional)
|
["?" ":"] @conditional)
|
||||||
|
|
|
||||||
|
|
@ -2,21 +2,21 @@ class Box<T> {
|
||||||
// ^ type
|
// ^ type
|
||||||
// ^ type
|
// ^ type
|
||||||
protected T $data;
|
protected T $data;
|
||||||
// ^ keyword
|
// ^ type.qualifier
|
||||||
// ^ type
|
// ^ type
|
||||||
|
|
||||||
public function __construct(T $data) {
|
public function __construct(T $data) {
|
||||||
// ^ type
|
// ^ type
|
||||||
// ^ parameter
|
// ^ parameter
|
||||||
// ^ keyword.function
|
// ^ keyword.function
|
||||||
// ^ keyword
|
// ^ type.qualifier
|
||||||
// ^ method
|
// ^ method
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getData(): T {
|
public function getData(): T {
|
||||||
// ^ method
|
// ^ method
|
||||||
// ^ keyword
|
// ^ type.qualifier
|
||||||
return $this->data;
|
return $this->data;
|
||||||
// ^ operator
|
// ^ operator
|
||||||
// ^ variable.builtin
|
// ^ variable.builtin
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ use type Facebook\XHP\HTML\{XHPHTMLHelpers, a, form};
|
||||||
|
|
||||||
|
|
||||||
final xhp class a_post extends x\element {
|
final xhp class a_post extends x\element {
|
||||||
// ^ keyword
|
// ^ type.qualifier
|
||||||
// ^ keyword
|
// ^ type.qualifier
|
||||||
// ^ keyword
|
// ^ keyword
|
||||||
use XHPHTMLHelpers;
|
use XHPHTMLHelpers;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue