2023-03-12 06:09:35 -04:00
|
|
|
; Variables
|
|
|
|
|
((identifier) @variable
|
2024-07-27 16:28:19 -07:00
|
|
|
(#set! priority 95))
|
2023-01-21 07:39:15 -05:00
|
|
|
|
|
|
|
|
; Includes
|
2023-01-28 15:47:47 -05:00
|
|
|
[
|
2023-02-18 04:36:15 -05:00
|
|
|
"include"
|
2023-01-21 07:39:15 -05:00
|
|
|
"cpp_include"
|
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
|
2023-01-21 07:39:15 -05:00
|
|
|
|
2023-03-12 06:09:35 -04:00
|
|
|
; Function
|
|
|
|
|
(function_definition
|
|
|
|
|
(identifier) @function)
|
2023-01-21 07:39:15 -05:00
|
|
|
|
2023-03-12 06:09:35 -04:00
|
|
|
; Fields
|
2024-01-06 15:05:50 +09:00
|
|
|
(field
|
2024-10-28 18:40:29 -07:00
|
|
|
(identifier) @property)
|
2023-01-21 07:39:15 -05:00
|
|
|
|
2023-03-12 06:09:35 -04:00
|
|
|
; Parameters
|
|
|
|
|
(function_definition
|
|
|
|
|
(parameters
|
2024-01-06 15:05:50 +09:00
|
|
|
(parameter
|
|
|
|
|
(identifier) @variable.parameter)))
|
2023-01-21 07:39:15 -05:00
|
|
|
|
2023-03-12 06:09:35 -04:00
|
|
|
(throws
|
|
|
|
|
(parameters
|
2024-01-06 15:05:50 +09:00
|
|
|
(parameter
|
|
|
|
|
(identifier) @variable.parameter)))
|
2023-01-21 07:39:15 -05:00
|
|
|
|
2023-03-12 06:09:35 -04:00
|
|
|
; Types
|
|
|
|
|
(typedef_identifier) @type
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-03-12 06:09:35 -04:00
|
|
|
(struct_definition
|
2024-01-06 15:05:50 +09:00
|
|
|
"struct"
|
|
|
|
|
(identifier) @type)
|
2023-01-21 07:39:15 -05:00
|
|
|
|
2023-03-12 06:09:35 -04:00
|
|
|
(union_definition
|
2024-01-06 15:05:50 +09:00
|
|
|
"union"
|
|
|
|
|
(identifier) @type)
|
2023-01-21 07:39:15 -05:00
|
|
|
|
2023-03-12 06:09:35 -04:00
|
|
|
(exception_definition
|
2024-01-06 15:05:50 +09:00
|
|
|
"exception"
|
|
|
|
|
(identifier) @type)
|
2023-03-12 06:09:35 -04:00
|
|
|
|
|
|
|
|
(service_definition
|
2024-01-06 15:05:50 +09:00
|
|
|
"service"
|
|
|
|
|
(identifier) @type)
|
2023-03-12 06:09:35 -04:00
|
|
|
|
|
|
|
|
(interaction_definition
|
2024-01-06 15:05:50 +09:00
|
|
|
"interaction"
|
|
|
|
|
(identifier) @type)
|
2023-01-21 07:39:15 -05:00
|
|
|
|
2023-03-12 06:09:35 -04:00
|
|
|
(type
|
|
|
|
|
type: (identifier) @type)
|
|
|
|
|
|
|
|
|
|
(definition_type
|
|
|
|
|
type: (identifier) @type)
|
|
|
|
|
|
|
|
|
|
((identifier) @type
|
|
|
|
|
(#lua-match? @type "^[_]*[A-Z]"))
|
2023-01-21 07:39:15 -05:00
|
|
|
|
2023-01-22 05:29:50 -05:00
|
|
|
; Constants
|
2024-01-06 15:05:50 +09:00
|
|
|
(const_definition
|
|
|
|
|
(identifier) @constant)
|
2023-01-22 05:29:50 -05:00
|
|
|
|
2023-03-12 06:09:35 -04:00
|
|
|
((identifier) @constant
|
|
|
|
|
(#lua-match? @constant "^[_A-Z][A-Z0-9_]*$"))
|
2023-01-22 05:29:50 -05:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(enum_definition
|
2024-10-28 18:40:29 -07:00
|
|
|
type: (identifier) @type)
|
|
|
|
|
|
|
|
|
|
(enum_definition
|
2024-01-06 15:05:50 +09:00
|
|
|
"{"
|
2024-10-28 18:40:29 -07:00
|
|
|
(identifier) @constant)
|
2023-01-22 05:29:50 -05:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Builtin Types
|
2023-03-12 06:09:35 -04:00
|
|
|
[
|
2024-10-28 18:40:29 -07:00
|
|
|
(primitive)
|
2023-03-12 06:09:35 -04:00
|
|
|
"list"
|
|
|
|
|
"map"
|
|
|
|
|
"set"
|
|
|
|
|
"sink"
|
|
|
|
|
"stream"
|
|
|
|
|
"void"
|
|
|
|
|
] @type.builtin
|
|
|
|
|
|
|
|
|
|
; Namespace
|
|
|
|
|
(namespace_declaration
|
2024-10-28 18:40:29 -07:00
|
|
|
(namespace_scope) @string.special)
|
|
|
|
|
|
|
|
|
|
(namespace_declaration
|
|
|
|
|
(namespace_scope)
|
2024-01-06 15:05:50 +09:00
|
|
|
[
|
2024-10-28 18:40:29 -07:00
|
|
|
type: (namespace) @module
|
2024-01-06 15:05:50 +09:00
|
|
|
(_
|
|
|
|
|
(identifier) @module)
|
|
|
|
|
])
|
2023-01-22 05:29:50 -05:00
|
|
|
|
|
|
|
|
; Attributes
|
2023-03-12 06:09:35 -04:00
|
|
|
(annotation_definition
|
2024-01-06 15:05:50 +09:00
|
|
|
(annotation_identifier
|
|
|
|
|
(identifier) @attribute))
|
|
|
|
|
|
2023-03-12 06:09:35 -04:00
|
|
|
(fb_annotation_definition
|
2024-01-06 15:05:50 +09:00
|
|
|
"@" @attribute
|
|
|
|
|
(annotation_identifier
|
|
|
|
|
(identifier) @attribute)
|
2023-03-12 06:09:35 -04:00
|
|
|
(identifier)? @attribute)
|
2023-01-22 05:29:50 -05:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(namespace_uri
|
|
|
|
|
(string) @attribute)
|
2023-01-21 07:39:15 -05:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Operators
|
2023-01-21 07:39:15 -05:00
|
|
|
[
|
2023-03-12 06:09:35 -04:00
|
|
|
"="
|
|
|
|
|
"&"
|
2023-01-21 07:39:15 -05:00
|
|
|
] @operator
|
|
|
|
|
|
|
|
|
|
; Exceptions
|
2024-01-06 15:05:50 +09:00
|
|
|
"throws" @keyword.exception
|
2023-01-21 07:39:15 -05:00
|
|
|
|
|
|
|
|
; Keywords
|
|
|
|
|
[
|
|
|
|
|
"exception"
|
|
|
|
|
"extends"
|
|
|
|
|
"typedef"
|
2023-03-12 06:09:35 -04:00
|
|
|
"uri"
|
2023-01-21 07:39:15 -05:00
|
|
|
] @keyword
|
|
|
|
|
|
2024-04-23 12:23:15 -07:00
|
|
|
[
|
|
|
|
|
"enum"
|
|
|
|
|
"struct"
|
|
|
|
|
"union"
|
|
|
|
|
"senum"
|
|
|
|
|
"interaction"
|
|
|
|
|
"namespace"
|
|
|
|
|
"service"
|
|
|
|
|
] @keyword.type
|
|
|
|
|
|
2023-01-22 05:29:50 -05:00
|
|
|
; Deprecated Keywords
|
2023-01-21 07:39:15 -05:00
|
|
|
[
|
|
|
|
|
"cocoa_prefix"
|
|
|
|
|
"cpp_namespace"
|
|
|
|
|
"csharp_namespace"
|
|
|
|
|
"delphi_namespace"
|
|
|
|
|
"java_package"
|
|
|
|
|
"perl_package"
|
|
|
|
|
"php_namespace"
|
|
|
|
|
"py_module"
|
|
|
|
|
"ruby_namespace"
|
|
|
|
|
"smalltalk_category"
|
|
|
|
|
"smalltalk_prefix"
|
|
|
|
|
"xsd_all"
|
|
|
|
|
"xsd_attrs"
|
|
|
|
|
"xsd_namespace"
|
|
|
|
|
"xsd_nillable"
|
|
|
|
|
"xsd_optional"
|
|
|
|
|
] @keyword
|
|
|
|
|
|
2023-03-21 13:50:54 +08:00
|
|
|
; Extended Keywords
|
2023-03-12 06:09:35 -04:00
|
|
|
[
|
|
|
|
|
"package"
|
|
|
|
|
"performs"
|
|
|
|
|
] @keyword
|
|
|
|
|
|
2023-02-24 06:37:45 -05:00
|
|
|
[
|
|
|
|
|
"async"
|
2023-03-12 06:09:35 -04:00
|
|
|
"oneway"
|
2023-02-24 06:37:45 -05:00
|
|
|
] @keyword.coroutine
|
|
|
|
|
|
2023-03-12 06:09:35 -04:00
|
|
|
; Qualifiers
|
2023-01-28 15:47:47 -05:00
|
|
|
[
|
|
|
|
|
"client"
|
2023-03-12 06:09:35 -04:00
|
|
|
"const"
|
2023-01-28 15:47:47 -05:00
|
|
|
"idempotent"
|
2023-03-12 06:09:35 -04:00
|
|
|
"optional"
|
2023-01-28 15:47:47 -05:00
|
|
|
"permanent"
|
|
|
|
|
"readonly"
|
2023-03-12 06:09:35 -04:00
|
|
|
"required"
|
2023-01-28 15:47:47 -05:00
|
|
|
"safe"
|
2023-03-12 06:09:35 -04:00
|
|
|
"server"
|
2023-01-28 15:47:47 -05:00
|
|
|
"stateful"
|
|
|
|
|
"transient"
|
2024-03-08 19:09:51 +09:00
|
|
|
] @keyword.modifier
|
2023-01-21 07:39:15 -05:00
|
|
|
|
|
|
|
|
; Literals
|
2023-03-12 06:09:35 -04:00
|
|
|
(string) @string
|
2023-01-28 15:47:47 -05:00
|
|
|
|
|
|
|
|
(escape_sequence) @string.escape
|
2023-01-21 07:39:15 -05:00
|
|
|
|
2023-03-12 06:09:35 -04:00
|
|
|
(namespace_uri
|
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
|
|
|
(string) @string.special.url)
|
2023-01-23 08:37:15 -05:00
|
|
|
|
2023-01-21 07:39:15 -05:00
|
|
|
(number) @number
|
|
|
|
|
|
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
|
|
|
(double) @number.float
|
2023-01-21 07:39:15 -05:00
|
|
|
|
|
|
|
|
(boolean) @boolean
|
|
|
|
|
|
2023-01-22 22:27:45 -05:00
|
|
|
; Typedefs
|
2023-03-12 06:09:35 -04:00
|
|
|
(typedef_identifier) @type.definition
|
2023-01-21 07:39:15 -05:00
|
|
|
|
2023-01-28 15:47:47 -05:00
|
|
|
; Punctuation
|
2024-01-06 15:05:50 +09:00
|
|
|
"*" @punctuation.special
|
2023-01-28 15:47:47 -05:00
|
|
|
|
2023-01-21 07:39:15 -05:00
|
|
|
[
|
2024-01-06 15:05:50 +09:00
|
|
|
"{"
|
|
|
|
|
"}"
|
|
|
|
|
"("
|
|
|
|
|
")"
|
|
|
|
|
"["
|
|
|
|
|
"]"
|
|
|
|
|
"<"
|
|
|
|
|
">"
|
|
|
|
|
] @punctuation.bracket
|
2023-01-22 05:29:50 -05:00
|
|
|
|
2023-01-21 07:39:15 -05:00
|
|
|
[
|
2023-03-12 06:09:35 -04:00
|
|
|
"."
|
2023-01-21 07:39:15 -05:00
|
|
|
","
|
2023-03-12 06:09:35 -04:00
|
|
|
";"
|
|
|
|
|
":"
|
2023-01-21 07:39:15 -05:00
|
|
|
] @punctuation.delimiter
|
|
|
|
|
|
|
|
|
|
; Comments
|
|
|
|
|
(comment) @comment @spell
|
2023-03-02 08:06:35 -05:00
|
|
|
|
|
|
|
|
((comment) @comment.documentation
|
|
|
|
|
(#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$"))
|
|
|
|
|
|
|
|
|
|
((comment) @comment.documentation
|
|
|
|
|
(#lua-match? @comment.documentation "^///[^/]"))
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-03-02 08:06:35 -05:00
|
|
|
((comment) @comment.documentation
|
|
|
|
|
(#lua-match? @comment.documentation "^///$"))
|
2023-03-12 06:09:35 -04:00
|
|
|
|
2024-05-01 10:43:21 +02:00
|
|
|
((comment) @keyword.directive @nospell
|
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
|
|
|
(#lua-match? @keyword.directive "#!.*"))
|