2021-03-09 23:14:27 +01:00
|
|
|
; inherits: ecma
|
2024-02-19 00:00:07 +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
|
|
|
"require" @keyword.import
|
2023-06-08 10:53:33 -04:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(import_require_clause
|
|
|
|
|
source: (string) @string.special.url)
|
2023-06-08 10:53:33 -04:00
|
|
|
|
2020-06-12 07:41:20 -05:00
|
|
|
[
|
2022-10-22 16:46:12 +03:00
|
|
|
"declare"
|
|
|
|
|
"implements"
|
|
|
|
|
"type"
|
|
|
|
|
"override"
|
2022-12-05 10:30:43 +07:00
|
|
|
"module"
|
2023-06-08 10:53:33 -04:00
|
|
|
"asserts"
|
2023-03-10 23:15:19 +07:00
|
|
|
"infer"
|
2023-06-04 11:04:00 +07:00
|
|
|
"is"
|
2024-01-31 10:56:51 -05:00
|
|
|
"using"
|
2020-06-12 07:41:20 -05:00
|
|
|
] @keyword
|
|
|
|
|
|
2024-04-23 12:23:15 -07:00
|
|
|
[
|
|
|
|
|
"namespace"
|
|
|
|
|
"interface"
|
|
|
|
|
"enum"
|
|
|
|
|
] @keyword.type
|
|
|
|
|
|
2023-06-04 11:04:40 +07:00
|
|
|
[
|
|
|
|
|
"keyof"
|
|
|
|
|
"satisfies"
|
|
|
|
|
] @keyword.operator
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(as_expression
|
|
|
|
|
"as" @keyword.operator)
|
|
|
|
|
|
|
|
|
|
(mapped_type_clause
|
|
|
|
|
"as" @keyword.operator)
|
2022-11-24 11:12:38 -08:00
|
|
|
|
2022-10-22 16:46:12 +03:00
|
|
|
[
|
|
|
|
|
"abstract"
|
|
|
|
|
"private"
|
|
|
|
|
"protected"
|
|
|
|
|
"public"
|
|
|
|
|
"readonly"
|
2024-03-08 19:09:51 +09:00
|
|
|
] @keyword.modifier
|
2022-10-22 16:46:12 +03:00
|
|
|
|
2020-11-14 18:44:55 -05:00
|
|
|
; types
|
2020-06-12 07:41:20 -05:00
|
|
|
(type_identifier) @type
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2020-06-12 07:41:20 -05:00
|
|
|
(predefined_type) @type.builtin
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(import_statement
|
|
|
|
|
"type"
|
2021-06-26 15:25:57 +06:00
|
|
|
(import_clause
|
|
|
|
|
(named_imports
|
2024-01-21 22:05:44 +09:00
|
|
|
(import_specifier
|
|
|
|
|
name: (identifier) @type))))
|
2021-06-26 15:25:57 +06:00
|
|
|
|
2023-03-10 23:15:19 +07:00
|
|
|
(template_literal_type) @string
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(non_null_expression
|
|
|
|
|
"!" @operator)
|
2020-11-14 18:44:55 -05:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; punctuation
|
2020-06-12 07:41:20 -05:00
|
|
|
(type_arguments
|
2024-01-06 15:05:50 +09:00
|
|
|
[
|
|
|
|
|
"<"
|
|
|
|
|
">"
|
|
|
|
|
] @punctuation.bracket)
|
2022-10-22 16:46:12 +03:00
|
|
|
|
|
|
|
|
(type_parameters
|
2024-01-06 15:05:50 +09:00
|
|
|
[
|
|
|
|
|
"<"
|
|
|
|
|
">"
|
|
|
|
|
] @punctuation.bracket)
|
2020-06-12 07:41:20 -05:00
|
|
|
|
2023-06-08 10:53:33 -04:00
|
|
|
(object_type
|
2024-01-06 15:05:50 +09:00
|
|
|
[
|
|
|
|
|
"{|"
|
|
|
|
|
"|}"
|
|
|
|
|
] @punctuation.bracket)
|
2023-06-08 10:53:33 -04:00
|
|
|
|
2022-10-22 16:46:12 +03:00
|
|
|
(union_type
|
2020-11-14 19:02:20 -05:00
|
|
|
"|" @punctuation.delimiter)
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(intersection_type
|
2020-11-14 19:02:20 -05:00
|
|
|
"&" @punctuation.delimiter)
|
|
|
|
|
|
2020-11-14 18:44:55 -05:00
|
|
|
(type_annotation
|
|
|
|
|
":" @punctuation.delimiter)
|
|
|
|
|
|
2023-06-04 11:04:00 +07:00
|
|
|
(type_predicate_annotation
|
|
|
|
|
":" @punctuation.delimiter)
|
|
|
|
|
|
2023-03-10 23:15:19 +07:00
|
|
|
(index_signature
|
|
|
|
|
":" @punctuation.delimiter)
|
|
|
|
|
|
2023-06-08 10:53:33 -04:00
|
|
|
(omitting_type_annotation
|
|
|
|
|
"-?:" @punctuation.delimiter)
|
|
|
|
|
|
2024-01-31 10:56:51 -05:00
|
|
|
(adding_type_annotation
|
|
|
|
|
"+?:" @punctuation.delimiter)
|
|
|
|
|
|
2023-03-10 23:15:19 +07:00
|
|
|
(opting_type_annotation
|
|
|
|
|
"?:" @punctuation.delimiter)
|
|
|
|
|
|
2022-08-19 06:49:31 +00:00
|
|
|
"?." @punctuation.delimiter
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(abstract_method_signature
|
|
|
|
|
"?" @punctuation.special)
|
|
|
|
|
|
|
|
|
|
(method_signature
|
|
|
|
|
"?" @punctuation.special)
|
|
|
|
|
|
|
|
|
|
(method_definition
|
|
|
|
|
"?" @punctuation.special)
|
2020-11-14 19:02:20 -05:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(property_signature
|
|
|
|
|
"?" @punctuation.special)
|
|
|
|
|
|
|
|
|
|
(optional_parameter
|
|
|
|
|
"?" @punctuation.special)
|
|
|
|
|
|
|
|
|
|
(optional_type
|
|
|
|
|
"?" @punctuation.special)
|
|
|
|
|
|
|
|
|
|
(public_field_definition
|
|
|
|
|
[
|
|
|
|
|
"?"
|
|
|
|
|
"!"
|
|
|
|
|
] @punctuation.special)
|
|
|
|
|
|
|
|
|
|
(flow_maybe_type
|
|
|
|
|
"?" @punctuation.special)
|
2023-03-10 23:15:19 +07:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(template_type
|
|
|
|
|
[
|
|
|
|
|
"${"
|
|
|
|
|
"}"
|
|
|
|
|
] @punctuation.special)
|
2023-03-10 23:15:19 +07:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(conditional_type
|
|
|
|
|
[
|
|
|
|
|
"?"
|
|
|
|
|
":"
|
|
|
|
|
] @keyword.conditional.ternary)
|
|
|
|
|
|
|
|
|
|
; Parameters
|
|
|
|
|
(required_parameter
|
|
|
|
|
(identifier) @variable.parameter)
|
|
|
|
|
|
|
|
|
|
(optional_parameter
|
|
|
|
|
(identifier) @variable.parameter)
|
2021-04-23 14:20:51 +02:00
|
|
|
|
|
|
|
|
(required_parameter
|
|
|
|
|
(rest_pattern
|
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
|
|
|
(identifier) @variable.parameter))
|
2021-04-23 14:20:51 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; ({ a }) => null
|
2021-04-23 14:20:51 +02:00
|
|
|
(required_parameter
|
|
|
|
|
(object_pattern
|
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
|
|
|
(shorthand_property_identifier_pattern) @variable.parameter))
|
2021-04-23 14:20:51 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; ({ a = b }) => null
|
2023-07-01 16:25:05 +07:00
|
|
|
(required_parameter
|
|
|
|
|
(object_pattern
|
|
|
|
|
(object_assignment_pattern
|
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
|
|
|
(shorthand_property_identifier_pattern) @variable.parameter)))
|
2023-07-01 16:25:05 +07:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; ({ a: b }) => null
|
2021-04-23 14:20:51 +02:00
|
|
|
(required_parameter
|
|
|
|
|
(object_pattern
|
|
|
|
|
(pair_pattern
|
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
|
|
|
value: (identifier) @variable.parameter)))
|
2021-04-23 14:20:51 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; ([ a ]) => null
|
2021-04-23 14:20:51 +02:00
|
|
|
(required_parameter
|
|
|
|
|
(array_pattern
|
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
|
|
|
(identifier) @variable.parameter))
|
2021-04-23 14:20:51 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; a => null
|
2021-04-23 14:20:51 +02:00
|
|
|
(arrow_function
|
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
|
|
|
parameter: (identifier) @variable.parameter)
|
2023-03-22 01:08:57 -04:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; global declaration
|
|
|
|
|
(ambient_declaration
|
|
|
|
|
"global" @module)
|
2023-07-18 01:19:28 +07:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; function signatures
|
2023-03-22 01:08:57 -04:00
|
|
|
(ambient_declaration
|
|
|
|
|
(function_signature
|
|
|
|
|
name: (identifier) @function))
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; method signatures
|
|
|
|
|
(method_signature
|
|
|
|
|
name: (_) @function.method)
|
2023-03-22 01:08:57 -04:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; property signatures
|
2023-03-22 01:08:57 -04:00
|
|
|
(property_signature
|
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: (property_identifier) @function.method
|
2024-03-21 20:44:35 +09:00
|
|
|
type: (type_annotation
|
|
|
|
|
[
|
|
|
|
|
(union_type
|
|
|
|
|
(parenthesized_type
|
|
|
|
|
(function_type)))
|
|
|
|
|
(function_type)
|
|
|
|
|
]))
|