2023-06-29 13:34:46 +03:00
|
|
|
(identifier) @variable
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-06-29 13:34:46 +03:00
|
|
|
(reference_identifier) @variable
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2024-01-10 18:05:37 +02:00
|
|
|
(member_identifier) @variable.member
|
2023-06-29 13:34:46 +03:00
|
|
|
|
|
|
|
|
; Classes
|
|
|
|
|
(custom_type) @type
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
(class_field
|
2024-08-31 18:28:56 -07:00
|
|
|
name: (identifier) @property)
|
|
|
|
|
|
|
|
|
|
(struct_field
|
|
|
|
|
name: (identifier) @property)
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
(class_definition
|
2023-06-29 13:34:46 +03:00
|
|
|
name: (identifier) @type)
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2024-08-31 18:28:56 -07:00
|
|
|
(struct_definition
|
|
|
|
|
name: (identifier) @type)
|
|
|
|
|
|
|
|
|
|
(interface_definition
|
|
|
|
|
name: (identifier) @type)
|
|
|
|
|
|
2023-06-29 13:34:46 +03:00
|
|
|
(method_definition
|
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)
|
2023-06-29 13:34:46 +03:00
|
|
|
|
2024-08-31 18:28:56 -07:00
|
|
|
(json_literal_member
|
|
|
|
|
(identifier) @property)
|
|
|
|
|
|
2023-06-29 13:34:46 +03:00
|
|
|
; Functions
|
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_argument_key) @variable.parameter
|
2023-06-29 13:34:46 +03:00
|
|
|
|
2024-08-31 18:28:56 -07:00
|
|
|
(parameter_definition
|
|
|
|
|
name: (identifier) @variable.parameter)
|
|
|
|
|
|
|
|
|
|
(variadic) @variable.parameter.builtin
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(call
|
2024-03-21 20:44:35 +09:00
|
|
|
caller: (reference
|
|
|
|
|
(nested_identifier
|
|
|
|
|
property: (member_identifier) @function.method.call)))
|
2023-06-29 13:34:46 +03:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(call
|
2024-03-21 20:44:35 +09:00
|
|
|
caller: (reference
|
|
|
|
|
(reference_identifier) @function.method.call))
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
; Primitives
|
2023-06-29 13:34:46 +03:00
|
|
|
(number) @number
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-06-29 13:34:46 +03:00
|
|
|
(duration) @constant
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-06-29 13:34:46 +03:00
|
|
|
(string) @string
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-06-29 13:34:46 +03:00
|
|
|
(bool) @boolean
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2024-08-31 18:28:56 -07:00
|
|
|
[
|
|
|
|
|
(builtin_type)
|
|
|
|
|
"MutSet"
|
|
|
|
|
"MutMap"
|
|
|
|
|
"MutArray"
|
|
|
|
|
"Json"
|
|
|
|
|
"Set"
|
|
|
|
|
"Map"
|
|
|
|
|
"Array"
|
|
|
|
|
"MutJson"
|
|
|
|
|
] @type.builtin
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-06-29 13:34:46 +03:00
|
|
|
(json_container_type) @type.builtin
|
|
|
|
|
|
|
|
|
|
; Special
|
2023-09-13 00:25:01 +09:00
|
|
|
(comment) @comment @spell
|
2023-06-29 13:34:46 +03:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"-"
|
2024-08-31 18:28:56 -07:00
|
|
|
"-="
|
2023-06-29 13:34:46 +03:00
|
|
|
"+"
|
2024-08-31 18:28:56 -07:00
|
|
|
"+="
|
2023-06-29 13:34:46 +03:00
|
|
|
"*"
|
2024-08-31 18:28:56 -07:00
|
|
|
"**"
|
2023-06-29 13:34:46 +03:00
|
|
|
"/"
|
|
|
|
|
"%"
|
|
|
|
|
"<"
|
|
|
|
|
"<="
|
|
|
|
|
"="
|
|
|
|
|
"=="
|
|
|
|
|
"!"
|
|
|
|
|
"!="
|
|
|
|
|
">"
|
|
|
|
|
">="
|
|
|
|
|
"&&"
|
|
|
|
|
"??"
|
|
|
|
|
"||"
|
2024-08-31 18:28:56 -07:00
|
|
|
"?"
|
2023-06-29 13:34:46 +03:00
|
|
|
] @operator
|
|
|
|
|
|
2024-08-31 18:28:56 -07:00
|
|
|
[
|
|
|
|
|
"("
|
|
|
|
|
")"
|
|
|
|
|
"{"
|
|
|
|
|
"}"
|
|
|
|
|
"["
|
|
|
|
|
"]"
|
|
|
|
|
] @punctuation.bracket
|
|
|
|
|
|
|
|
|
|
(mutable_container_type
|
|
|
|
|
[
|
|
|
|
|
"<"
|
|
|
|
|
">"
|
|
|
|
|
] @punctuation.bracket)
|
|
|
|
|
|
|
|
|
|
(immutable_container_type
|
|
|
|
|
[
|
|
|
|
|
"<"
|
|
|
|
|
">"
|
|
|
|
|
] @punctuation.bracket)
|
|
|
|
|
|
2023-06-29 13:34:46 +03:00
|
|
|
[
|
|
|
|
|
";"
|
|
|
|
|
"."
|
|
|
|
|
","
|
2024-08-31 18:28:56 -07:00
|
|
|
":"
|
|
|
|
|
"=>"
|
2023-06-29 13:34:46 +03:00
|
|
|
] @punctuation.delimiter
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"as"
|
|
|
|
|
"let"
|
|
|
|
|
"new"
|
bot(lockfile): update arduino, awk, bash, c, cpp, css, cuda, go, groovy, haskell, hlsl, html, http, javascript, jsdoc, json, julia, liquid, norg, ocaml, ocaml_interface, php, php_only, phpdoc, python, ql, regex, ruby, rust, scala, slang, tcl, templ, tsx, typescript, v, wing
2024-09-05 13:25:50 +00:00
|
|
|
(phase_specifier)
|
2024-08-31 18:28:56 -07:00
|
|
|
"impl"
|
|
|
|
|
"test"
|
2023-06-29 13:34:46 +03:00
|
|
|
] @keyword
|
2024-01-09 11:50:31 +02:00
|
|
|
|
2024-08-31 18:28:56 -07:00
|
|
|
"bring" @keyword.import
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"class"
|
|
|
|
|
"struct"
|
|
|
|
|
"interface"
|
|
|
|
|
] @keyword.type
|
2024-04-23 12:23:15 -07:00
|
|
|
|
2024-01-09 11:50:31 +02:00
|
|
|
[
|
|
|
|
|
"for"
|
|
|
|
|
"in"
|
|
|
|
|
] @keyword.repeat
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"if"
|
|
|
|
|
"else"
|
|
|
|
|
] @keyword.conditional
|
|
|
|
|
|
2024-04-14 11:53:37 -04:00
|
|
|
[
|
|
|
|
|
"pub"
|
|
|
|
|
"protected"
|
|
|
|
|
"internal"
|
2024-08-31 18:28:56 -07:00
|
|
|
"extern"
|
|
|
|
|
(static)
|
2024-04-14 11:53:37 -04:00
|
|
|
] @keyword.modifier
|
|
|
|
|
|
2024-01-09 11:50:31 +02:00
|
|
|
"return" @keyword.return
|
2024-08-31 18:28:56 -07:00
|
|
|
|
|
|
|
|
(import_statement
|
|
|
|
|
module_name: (identifier) @module)
|
|
|
|
|
|
|
|
|
|
(import_statement
|
|
|
|
|
alias: (identifier) @module)
|
|
|
|
|
|
|
|
|
|
(call
|
|
|
|
|
(reference
|
|
|
|
|
(nested_identifier
|
|
|
|
|
object: (reference) @_ref
|
|
|
|
|
property: (member_identifier) @_ident))
|
|
|
|
|
(argument_list
|
|
|
|
|
(positional_argument
|
|
|
|
|
(string) @string.regexp))
|
|
|
|
|
(#eq? @_ref "regex")
|
|
|
|
|
(#eq? @_ident "compile")
|
|
|
|
|
(#offset! @string.regexp 0 1 0 -1))
|