2021-11-23 18:23:57 +01:00
|
|
|
(variable) @variable
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2021-11-23 18:23:57 +01:00
|
|
|
(identifier) @variable
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2021-11-23 18:23:57 +01:00
|
|
|
((variable) @variable.builtin
|
2024-01-06 15:05:50 +09:00
|
|
|
(#eq? @variable.builtin "$this"))
|
2021-11-23 18:23:57 +01:00
|
|
|
|
|
|
|
|
(braced_expression) @none
|
|
|
|
|
|
|
|
|
|
(scoped_identifier
|
2024-01-06 15:05:50 +09:00
|
|
|
(qualified_identifier
|
|
|
|
|
(identifier) @type))
|
2021-11-23 18:23:57 +01:00
|
|
|
|
2021-11-23 01:20:25 +01:00
|
|
|
[
|
2022-11-20 15:14:25 +02:00
|
|
|
(comment)
|
|
|
|
|
(heredoc)
|
2023-03-02 08:06:35 -05:00
|
|
|
] @comment @spell
|
|
|
|
|
|
|
|
|
|
((comment) @comment.documentation
|
|
|
|
|
(#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$"))
|
2022-11-20 15:14:25 +02:00
|
|
|
|
|
|
|
|
"function" @keyword.function
|
2021-11-23 01:20:25 +01:00
|
|
|
|
|
|
|
|
[
|
2024-01-06 15:05:50 +09:00
|
|
|
"implements"
|
|
|
|
|
"using"
|
|
|
|
|
"attribute"
|
|
|
|
|
"const"
|
|
|
|
|
"extends"
|
|
|
|
|
"insteadof"
|
2021-11-23 01:20:25 +01:00
|
|
|
] @keyword
|
|
|
|
|
|
2024-04-23 12:23:15 -07:00
|
|
|
[
|
|
|
|
|
"class"
|
|
|
|
|
"type"
|
|
|
|
|
"interface"
|
|
|
|
|
"namespace"
|
|
|
|
|
] @keyword.type
|
|
|
|
|
|
2023-02-24 06:37:45 -05:00
|
|
|
[
|
|
|
|
|
"async"
|
|
|
|
|
"await"
|
|
|
|
|
] @keyword.coroutine
|
|
|
|
|
|
2022-11-20 15:14:25 +02:00
|
|
|
[
|
2024-01-06 15:05:50 +09:00
|
|
|
"use"
|
|
|
|
|
"include"
|
|
|
|
|
"include_once"
|
|
|
|
|
"require"
|
|
|
|
|
"require_once"
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
] @keyword.import
|
2021-11-23 18:23:57 +01:00
|
|
|
|
2021-11-23 01:20:25 +01:00
|
|
|
[
|
|
|
|
|
"new"
|
|
|
|
|
"print"
|
|
|
|
|
"echo"
|
|
|
|
|
"newtype"
|
|
|
|
|
"clone"
|
2021-11-23 18:23:57 +01:00
|
|
|
"as"
|
2021-11-23 01:20:25 +01:00
|
|
|
] @keyword.operator
|
|
|
|
|
|
2022-11-20 15:14:25 +02:00
|
|
|
"return" @keyword.return
|
|
|
|
|
|
2021-11-23 01:20:25 +01:00
|
|
|
[
|
2022-11-20 15:14:25 +02:00
|
|
|
(abstract_modifier)
|
|
|
|
|
(final_modifier)
|
|
|
|
|
(static_modifier)
|
|
|
|
|
(visibility_modifier)
|
|
|
|
|
(xhp_modifier)
|
2024-03-08 19:09:51 +09:00
|
|
|
] @keyword.modifier
|
2021-11-23 01:20:25 +01:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"shape"
|
2022-04-06 22:15:12 +02:00
|
|
|
"tuple"
|
2021-11-23 01:20:25 +01:00
|
|
|
(array_type)
|
|
|
|
|
"bool"
|
|
|
|
|
"float"
|
|
|
|
|
"int"
|
|
|
|
|
"string"
|
|
|
|
|
"arraykey"
|
|
|
|
|
"void"
|
|
|
|
|
"nonnull"
|
|
|
|
|
"mixed"
|
|
|
|
|
"dynamic"
|
|
|
|
|
"noreturn"
|
2021-11-23 18:23:57 +01:00
|
|
|
] @type.builtin
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(null) @constant.builtin
|
2021-11-28 15:12:08 +01:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
(true)
|
|
|
|
|
(false)
|
|
|
|
|
] @boolean
|
|
|
|
|
|
2021-11-23 18:23:57 +01:00
|
|
|
(type_specifier) @type
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2021-11-23 18:23:57 +01:00
|
|
|
(new_expression
|
|
|
|
|
(_) @type)
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(alias_declaration
|
|
|
|
|
"newtype"
|
|
|
|
|
.
|
|
|
|
|
(_) @type)
|
|
|
|
|
|
|
|
|
|
(alias_declaration
|
|
|
|
|
"type"
|
|
|
|
|
.
|
|
|
|
|
(_) @type)
|
2021-11-23 18:23:57 +01:00
|
|
|
|
|
|
|
|
(class_declaration
|
|
|
|
|
name: (identifier) @type)
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2021-11-23 18:23:57 +01:00
|
|
|
(type_parameter
|
|
|
|
|
name: (identifier) @type)
|
2021-11-23 01:20:25 +01:00
|
|
|
|
2021-11-23 18:23:57 +01:00
|
|
|
(collection
|
|
|
|
|
(qualified_identifier
|
|
|
|
|
(identifier) @type .))
|
|
|
|
|
|
|
|
|
|
[
|
2024-01-06 15:05:50 +09:00
|
|
|
"@required"
|
|
|
|
|
"@lateinit"
|
2022-11-20 15:14:25 +02:00
|
|
|
(attribute_modifier)
|
2021-11-23 18:23:57 +01:00
|
|
|
] @attribute
|
2021-11-23 01:20:25 +01:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"="
|
|
|
|
|
"??="
|
|
|
|
|
".="
|
|
|
|
|
"|="
|
|
|
|
|
"^="
|
|
|
|
|
"&="
|
|
|
|
|
"<<="
|
|
|
|
|
">>="
|
|
|
|
|
"+="
|
|
|
|
|
"-="
|
|
|
|
|
"*="
|
|
|
|
|
"/="
|
|
|
|
|
"%="
|
|
|
|
|
"**="
|
|
|
|
|
"==>"
|
|
|
|
|
"|>"
|
|
|
|
|
"??"
|
|
|
|
|
"||"
|
|
|
|
|
"&&"
|
|
|
|
|
"|"
|
|
|
|
|
"^"
|
|
|
|
|
"&"
|
|
|
|
|
"=="
|
|
|
|
|
"!="
|
|
|
|
|
"==="
|
|
|
|
|
"!=="
|
|
|
|
|
"<"
|
|
|
|
|
">"
|
|
|
|
|
"<="
|
|
|
|
|
">="
|
|
|
|
|
"<=>"
|
|
|
|
|
"<<"
|
|
|
|
|
">>"
|
2021-11-23 18:23:57 +01:00
|
|
|
"->"
|
2021-11-23 01:20:25 +01:00
|
|
|
"+"
|
|
|
|
|
"-"
|
|
|
|
|
"."
|
|
|
|
|
"*"
|
|
|
|
|
"/"
|
|
|
|
|
"%"
|
|
|
|
|
"**"
|
|
|
|
|
"++"
|
|
|
|
|
"--"
|
|
|
|
|
"!"
|
|
|
|
|
"?:"
|
|
|
|
|
"="
|
|
|
|
|
"??="
|
|
|
|
|
".="
|
|
|
|
|
"|="
|
|
|
|
|
"^="
|
|
|
|
|
"&="
|
|
|
|
|
"<<="
|
|
|
|
|
">>="
|
|
|
|
|
"+="
|
|
|
|
|
"-="
|
|
|
|
|
"*="
|
|
|
|
|
"/="
|
|
|
|
|
"%="
|
|
|
|
|
"**="
|
2021-11-23 18:23:57 +01:00
|
|
|
"=>"
|
2024-01-06 15:05:50 +09:00
|
|
|
; type modifiers
|
2021-11-23 01:20:25 +01:00
|
|
|
"@"
|
|
|
|
|
"?"
|
|
|
|
|
"~"
|
|
|
|
|
] @operator
|
|
|
|
|
|
|
|
|
|
(integer) @number
|
2024-01-06 15:05:50 +09:00
|
|
|
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
(float) @number.float
|
2021-11-23 01:20:25 +01:00
|
|
|
|
|
|
|
|
(parameter
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
(variable) @variable.parameter)
|
2021-11-23 01:20:25 +01:00
|
|
|
|
|
|
|
|
(call_expression
|
2024-03-21 20:44:35 +09:00
|
|
|
function: (qualified_identifier
|
|
|
|
|
(identifier) @function.call .))
|
2021-11-23 18:23:57 +01:00
|
|
|
|
|
|
|
|
(call_expression
|
2024-03-21 20:44:35 +09:00
|
|
|
function: (scoped_identifier
|
|
|
|
|
(identifier) @function.call .))
|
2021-11-23 18:23:57 +01:00
|
|
|
|
|
|
|
|
(call_expression
|
2024-03-21 20:44:35 +09:00
|
|
|
function: (selection_expression
|
|
|
|
|
(qualified_identifier
|
|
|
|
|
(identifier) @function.method.call .)))
|
2021-11-23 18:23:57 +01:00
|
|
|
|
|
|
|
|
(qualified_identifier
|
2024-01-06 15:05:50 +09:00
|
|
|
(_) @module
|
|
|
|
|
.
|
2021-11-23 18:23:57 +01:00
|
|
|
(_))
|
|
|
|
|
|
|
|
|
|
(use_statement
|
|
|
|
|
(qualified_identifier
|
2024-01-06 15:05:50 +09:00
|
|
|
(_) @module .)
|
2021-11-23 18:23:57 +01:00
|
|
|
(use_clause))
|
|
|
|
|
|
|
|
|
|
(use_statement
|
2024-01-06 15:05:50 +09:00
|
|
|
(use_type
|
|
|
|
|
"namespace")
|
2021-11-23 18:23:57 +01:00
|
|
|
(use_clause
|
|
|
|
|
(qualified_identifier
|
2024-01-06 15:05:50 +09:00
|
|
|
(identifier) @module .)
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
alias: (identifier)? @module))
|
2021-11-23 18:23:57 +01:00
|
|
|
|
|
|
|
|
(use_statement
|
2024-01-06 15:05:50 +09:00
|
|
|
(use_type
|
|
|
|
|
"const")
|
2021-11-23 18:23:57 +01:00
|
|
|
(use_clause
|
|
|
|
|
(qualified_identifier
|
2024-01-06 15:05:50 +09:00
|
|
|
(identifier) @constant .)
|
2021-11-23 18:23:57 +01:00
|
|
|
alias: (identifier)? @constant))
|
|
|
|
|
|
|
|
|
|
(use_statement
|
2024-01-06 15:05:50 +09:00
|
|
|
(use_type
|
|
|
|
|
"function")
|
2021-11-23 18:23:57 +01:00
|
|
|
(use_clause
|
|
|
|
|
(qualified_identifier
|
2024-01-06 15:05:50 +09:00
|
|
|
(identifier) @function .)
|
2021-11-23 18:23:57 +01:00
|
|
|
alias: (identifier)? @function))
|
|
|
|
|
|
|
|
|
|
(use_statement
|
2024-01-06 15:05:50 +09:00
|
|
|
(use_type
|
|
|
|
|
"type")
|
2021-11-23 18:23:57 +01:00
|
|
|
(use_clause
|
|
|
|
|
(qualified_identifier
|
2024-01-06 15:05:50 +09:00
|
|
|
(identifier) @type .)
|
2021-11-23 18:23:57 +01:00
|
|
|
alias: (identifier)? @type))
|
|
|
|
|
|
|
|
|
|
(use_clause
|
2024-01-06 15:05:50 +09:00
|
|
|
(use_type
|
|
|
|
|
"namespace")
|
2021-11-23 18:23:57 +01:00
|
|
|
(qualified_identifier
|
2024-01-06 15:05:50 +09:00
|
|
|
(_) @module .)
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
alias: (identifier)? @module)
|
2021-11-23 18:23:57 +01:00
|
|
|
|
|
|
|
|
(use_clause
|
2024-01-06 15:05:50 +09:00
|
|
|
(use_type
|
|
|
|
|
"function")
|
2021-11-23 18:23:57 +01:00
|
|
|
(qualified_identifier
|
2024-01-06 15:05:50 +09:00
|
|
|
(_) @function .)
|
2021-11-23 18:23:57 +01:00
|
|
|
alias: (identifier)? @function)
|
|
|
|
|
|
|
|
|
|
(use_clause
|
2024-01-06 15:05:50 +09:00
|
|
|
(use_type
|
|
|
|
|
"const")
|
2021-11-23 18:23:57 +01:00
|
|
|
(qualified_identifier
|
2024-01-06 15:05:50 +09:00
|
|
|
(_) @constant .)
|
2021-11-23 18:23:57 +01:00
|
|
|
alias: (identifier)? @constant)
|
|
|
|
|
|
|
|
|
|
(use_clause
|
2024-01-06 15:05:50 +09:00
|
|
|
(use_type
|
|
|
|
|
"type")
|
2021-11-23 18:23:57 +01:00
|
|
|
(qualified_identifier
|
2024-01-06 15:05:50 +09:00
|
|
|
(_) @type .)
|
2021-11-23 18:23:57 +01:00
|
|
|
alias: (identifier)? @type)
|
2021-11-23 01:20:25 +01:00
|
|
|
|
|
|
|
|
(function_declaration
|
|
|
|
|
name: (identifier) @function)
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2021-11-23 18:23:57 +01:00
|
|
|
(method_declaration
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
name: (identifier) @function.method)
|
2021-11-23 01:20:25 +01:00
|
|
|
|
|
|
|
|
(type_arguments
|
2024-01-06 15:05:50 +09:00
|
|
|
[
|
|
|
|
|
"<"
|
|
|
|
|
">"
|
|
|
|
|
] @punctuation.bracket)
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"("
|
|
|
|
|
")"
|
|
|
|
|
"["
|
|
|
|
|
"]"
|
|
|
|
|
"{"
|
|
|
|
|
"}"
|
|
|
|
|
"<<"
|
|
|
|
|
">>"
|
|
|
|
|
] @punctuation.bracket
|
2021-11-23 01:20:25 +01:00
|
|
|
|
2021-11-23 18:23:57 +01:00
|
|
|
(xhp_open
|
2024-01-06 15:05:50 +09:00
|
|
|
[
|
|
|
|
|
"<"
|
|
|
|
|
">"
|
|
|
|
|
] @tag.delimiter)
|
|
|
|
|
|
2021-11-23 18:23:57 +01:00
|
|
|
(xhp_close
|
2024-01-06 15:05:50 +09:00
|
|
|
[
|
|
|
|
|
"</"
|
|
|
|
|
">"
|
|
|
|
|
] @tag.delimiter)
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"."
|
|
|
|
|
";"
|
|
|
|
|
"::"
|
|
|
|
|
":"
|
|
|
|
|
","
|
|
|
|
|
] @punctuation.delimiter
|
2021-11-23 18:23:57 +01:00
|
|
|
|
2022-11-20 15:14:25 +02:00
|
|
|
(qualified_identifier
|
|
|
|
|
"\\" @punctuation.delimiter)
|
2021-11-23 01:20:25 +01:00
|
|
|
|
|
|
|
|
(ternary_expression
|
2024-01-06 15:05:50 +09:00
|
|
|
[
|
|
|
|
|
"?"
|
|
|
|
|
":"
|
|
|
|
|
] @keyword.conditional.ternary)
|
2021-11-23 01:20:25 +01:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"if"
|
|
|
|
|
"else"
|
|
|
|
|
"elseif"
|
|
|
|
|
"switch"
|
|
|
|
|
"case"
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
] @keyword.conditional
|
2021-11-23 01:20:25 +01:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"try"
|
|
|
|
|
"catch"
|
|
|
|
|
"finally"
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
] @keyword.exception
|
2021-11-23 01:20:25 +01:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"for"
|
|
|
|
|
"while"
|
2021-11-23 18:23:57 +01:00
|
|
|
"foreach"
|
2021-11-23 01:20:25 +01:00
|
|
|
"do"
|
|
|
|
|
"continue"
|
|
|
|
|
"break"
|
feat!: align standard captures with upstream
Problem: Sharing highlight queries with upstream tree-sitter and
Helix is difficult.
Solution: Where reasonable, use capture names in tree-sitter's standard
list or Helix's Atom-style hierarchy.
Specifically:
* tree-sitter "standard capture names"
(https://github.com/tree-sitter/tree-sitter/blob/3f44b896852eb7daaa6df4fb778c9bb52c70c815/highlight/src/lib.rs#L20-L72):
- `@parameter` -> `@variable.parameter`
- `@field` -> `@variable.member`
- `@namespace` -> `@module`
- `@float` -> `@number.float`
- `@symbol` -> `@string.special.symbol`
- `@string.regex` -> `@string.regexp`
- `@text.*` -> `@markup.*` (`strong`, `italic`, `link`, `strikethrough`; with exceptions; see below)
- `@text.title` -> `@markup.heading`
- `@text.literal` -> `@markup.raw`
- `@text.reference` -> `@markup.link`
- `@text.uri` -> `@markup.link.url` (in markup links)
- `@string.special` -> `@markup.link.label` (non-url links)
- `@punctuation.special` -> `@markup.list` (markdown lists only; move subitems from `@text.todo`)
* Helix captures
(https://docs.helix-editor.com/master/themes.html#syntax-highlighting):
- `@method` -> `@function.method`
- `@method.call` -> `@function.method.call`
- `@text.{todo,warning,note,danger}` -> `@comment.{error,warning,hint,info,todo}`
- `@text.diff.{add,delete,}` -> `@diff.{plus,minus,delta}`
- `@text.uri` -> `@string.special.url` (outside markup)
- `@preproc` -> `@keyword.directive`
- `@define` -> `@keyword.directive`(`.define`?)
- `@storageclass` -> `@keyword.storage`
- `@conditional` -> `@keyword.conditional`
- `@debug` -> `@keyword.debug`
- `@exception` -> `@keyword.exception`
- `@include` -> `@keyword.import`
- `@repeat` -> `@keyword.repeat`
* cleanup
- remove some redundant `@conceal` (but still allow it for conceal-only patterns)
- remove obsolete `@error` (syntax linting is out of scope for this repo)
- sort, cleanup capture list in `CONTRIBUTING.md`
2023-12-24 10:00:20 +01:00
|
|
|
] @keyword.repeat
|
2021-11-23 01:20:25 +01:00
|
|
|
|
2021-11-23 18:23:57 +01:00
|
|
|
[
|
2024-01-06 15:05:50 +09:00
|
|
|
(string)
|
|
|
|
|
(xhp_string)
|
2021-11-23 18:23:57 +01:00
|
|
|
] @string
|
|
|
|
|
|
|
|
|
|
[
|
2024-01-06 15:05:50 +09:00
|
|
|
(xhp_open)
|
|
|
|
|
(xhp_close)
|
2021-11-23 18:23:57 +01:00
|
|
|
] @tag
|