2021-08-25 19:38:45 -04:00
|
|
|
; CREDITS @stumash (stuart.mashaal@gmail.com)
|
2023-01-12 12:52:44 +01:00
|
|
|
(class_definition
|
|
|
|
|
name: (identifier) @type)
|
|
|
|
|
|
|
|
|
|
(enum_definition
|
|
|
|
|
name: (identifier) @type)
|
|
|
|
|
|
|
|
|
|
(object_definition
|
|
|
|
|
name: (identifier) @type)
|
|
|
|
|
|
|
|
|
|
(trait_definition
|
|
|
|
|
name: (identifier) @type)
|
|
|
|
|
|
|
|
|
|
(full_enum_case
|
|
|
|
|
name: (identifier) @type)
|
|
|
|
|
|
|
|
|
|
(simple_enum_case
|
|
|
|
|
name: (identifier) @type)
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; variables
|
|
|
|
|
(class_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
|
|
|
name: (identifier) @variable.parameter)
|
2021-08-28 21:07:44 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(self_type
|
|
|
|
|
(identifier) @variable.parameter)
|
2023-06-09 10:15:06 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(interpolation
|
|
|
|
|
(identifier) @none)
|
2021-09-02 13:24:37 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(interpolation
|
|
|
|
|
(block) @none)
|
2021-08-28 21:07:44 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; types
|
2023-01-12 12:52:44 +01:00
|
|
|
(type_definition
|
|
|
|
|
name: (type_identifier) @type.definition)
|
|
|
|
|
|
2021-08-28 21:07:44 +02:00
|
|
|
(type_identifier) @type
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; val/var definitions/declarations
|
2023-01-12 12:52:44 +01:00
|
|
|
(val_definition
|
|
|
|
|
pattern: (identifier) @variable)
|
2021-08-28 21:07:44 +02:00
|
|
|
|
2023-01-12 12:52:44 +01:00
|
|
|
(var_definition
|
|
|
|
|
pattern: (identifier) @variable)
|
|
|
|
|
|
|
|
|
|
(val_declaration
|
|
|
|
|
name: (identifier) @variable)
|
|
|
|
|
|
|
|
|
|
(var_declaration
|
|
|
|
|
name: (identifier) @variable)
|
2021-08-25 19:38:45 -04:00
|
|
|
|
|
|
|
|
; method definition
|
2023-01-12 12:52:44 +01:00
|
|
|
(function_declaration
|
2024-01-06 15:05:50 +09:00
|
|
|
name: (identifier) @function.method)
|
2023-01-12 12:52:44 +01:00
|
|
|
|
|
|
|
|
(function_definition
|
2024-01-06 15:05:50 +09:00
|
|
|
name: (identifier) @function.method)
|
2021-08-25 19:38:45 -04:00
|
|
|
|
2023-01-12 12:52:44 +01:00
|
|
|
; imports/exports
|
2021-09-01 16:55:53 +02:00
|
|
|
(import_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
|
|
|
path: (identifier) @module)
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2024-01-21 22:05:44 +09:00
|
|
|
(stable_identifier
|
|
|
|
|
(identifier) @module)
|
2021-09-01 16:55:53 +02:00
|
|
|
|
|
|
|
|
((import_declaration
|
2024-01-06 15:05:50 +09:00
|
|
|
path: (identifier) @type)
|
|
|
|
|
(#lua-match? @type "^[A-Z]"))
|
|
|
|
|
|
|
|
|
|
((stable_identifier
|
|
|
|
|
(identifier) @type)
|
|
|
|
|
(#lua-match? @type "^[A-Z]"))
|
2021-09-01 16:55:53 +02:00
|
|
|
|
2023-01-12 12:52:44 +01:00
|
|
|
(export_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
|
|
|
path: (identifier) @module)
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2024-01-21 22:05:44 +09:00
|
|
|
(stable_identifier
|
|
|
|
|
(identifier) @module)
|
2023-01-12 12:52:44 +01:00
|
|
|
|
|
|
|
|
((export_declaration
|
2024-01-06 15:05:50 +09:00
|
|
|
path: (identifier) @type)
|
|
|
|
|
(#lua-match? @type "^[A-Z]"))
|
2023-01-12 12:52:44 +01:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
((stable_identifier
|
|
|
|
|
(identifier) @type)
|
|
|
|
|
(#lua-match? @type "^[A-Z]"))
|
2021-09-01 16:55:53 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
((namespace_selectors
|
|
|
|
|
(identifier) @type)
|
|
|
|
|
(#lua-match? @type "^[A-Z]"))
|
2021-08-28 21:07:44 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; method invocation
|
2021-08-28 21:07:44 +02:00
|
|
|
(call_expression
|
2022-07-29 21:09:58 -03:00
|
|
|
function: (identifier) @function.call)
|
2021-08-28 21:07:44 +02:00
|
|
|
|
2023-01-12 12:52:44 +01:00
|
|
|
(call_expression
|
|
|
|
|
function: (operator_identifier) @function.call)
|
|
|
|
|
|
2021-08-25 19:38:45 -04:00
|
|
|
(call_expression
|
2024-03-21 20:44:35 +09:00
|
|
|
function: (field_expression
|
|
|
|
|
field: (identifier) @function.method.call))
|
2021-08-25 19:38:45 -04:00
|
|
|
|
2021-09-01 16:55:53 +02:00
|
|
|
((call_expression
|
2024-01-06 15:05:50 +09:00
|
|
|
function: (identifier) @constructor)
|
|
|
|
|
(#lua-match? @constructor "^[A-Z]"))
|
2021-09-01 16:55:53 +02:00
|
|
|
|
2021-08-28 21:07:44 +02:00
|
|
|
(generic_function
|
2022-07-29 21:09:58 -03:00
|
|
|
function: (identifier) @function.call)
|
2021-08-28 21:07:44 +02:00
|
|
|
|
2023-01-18 12:06:32 +01:00
|
|
|
(interpolated_string_expression
|
|
|
|
|
interpolator: (identifier) @function.call)
|
|
|
|
|
|
2021-08-28 21:07:44 +02:00
|
|
|
; function definitions
|
|
|
|
|
(function_definition
|
|
|
|
|
name: (identifier) @function)
|
|
|
|
|
|
|
|
|
|
(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
|
|
|
name: (identifier) @variable.parameter)
|
2023-01-15 18:12:05 +01:00
|
|
|
|
|
|
|
|
(binding
|
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) @variable.parameter)
|
2021-08-28 21:07:44 +02:00
|
|
|
|
2024-05-12 18:23:41 -07:00
|
|
|
(lambda_expression
|
|
|
|
|
parameters: (identifier) @variable.parameter)
|
|
|
|
|
|
2021-08-28 21:07:44 +02:00
|
|
|
; expressions
|
2024-01-06 15:05:50 +09:00
|
|
|
(field_expression
|
2024-01-10 18:05:37 +02:00
|
|
|
field: (identifier) @variable.member)
|
2021-08-28 21:07:44 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(field_expression
|
|
|
|
|
value: (identifier) @type
|
|
|
|
|
(#lua-match? @type "^[A-Z]"))
|
2021-08-28 21:07:44 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(infix_expression
|
|
|
|
|
operator: (identifier) @operator)
|
2021-08-28 21:07:44 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(infix_expression
|
|
|
|
|
operator: (operator_identifier) @operator)
|
|
|
|
|
|
|
|
|
|
(infix_type
|
|
|
|
|
operator: (operator_identifier) @operator)
|
2021-08-28 21:07:44 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(infix_type
|
|
|
|
|
operator: (operator_identifier) @operator)
|
|
|
|
|
|
|
|
|
|
; literals
|
2021-08-28 21:07:44 +02:00
|
|
|
(boolean_literal) @boolean
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2021-08-28 21:07:44 +02:00
|
|
|
(integer_literal) @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
|
|
|
(floating_point_literal) @number.float
|
2021-08-28 21:07:44 +02:00
|
|
|
|
|
|
|
|
[
|
2023-01-12 12:52:44 +01:00
|
|
|
(string)
|
|
|
|
|
(interpolated_string_expression)
|
2021-08-28 21:07:44 +02:00
|
|
|
] @string
|
|
|
|
|
|
2024-01-09 11:50:31 +02:00
|
|
|
(character_literal) @character
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(interpolation
|
|
|
|
|
"$" @punctuation.special)
|
2021-08-25 19:38:45 -04:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; keywords
|
2024-03-08 19:09:51 +09:00
|
|
|
(opaque_modifier) @keyword.modifier
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-01-12 12:52:44 +01:00
|
|
|
(infix_modifier) @keyword
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2024-03-08 19:09:51 +09:00
|
|
|
(transparent_modifier) @keyword.modifier
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2024-03-08 19:09:51 +09:00
|
|
|
(open_modifier) @keyword.modifier
|
2023-01-12 12:52:44 +01:00
|
|
|
|
2021-08-25 19:38:45 -04:00
|
|
|
[
|
|
|
|
|
"case"
|
|
|
|
|
"extends"
|
2023-01-12 12:52:44 +01:00
|
|
|
"derives"
|
2021-08-25 19:38:45 -04:00
|
|
|
"finally"
|
2024-01-06 15:05:50 +09:00
|
|
|
; `forSome` existential types not implemented yet
|
|
|
|
|
; `macro` not implemented yet
|
2021-08-25 19:38:45 -04:00
|
|
|
"object"
|
|
|
|
|
"override"
|
|
|
|
|
"val"
|
|
|
|
|
"var"
|
|
|
|
|
"with"
|
2023-01-12 12:52:44 +01:00
|
|
|
"given"
|
|
|
|
|
"using"
|
|
|
|
|
"end"
|
|
|
|
|
"implicit"
|
|
|
|
|
"extension"
|
2021-08-25 19:38:45 -04:00
|
|
|
] @keyword
|
|
|
|
|
|
2024-04-23 12:23:15 -07:00
|
|
|
[
|
|
|
|
|
"enum"
|
|
|
|
|
"class"
|
|
|
|
|
"trait"
|
|
|
|
|
"type"
|
|
|
|
|
] @keyword.type
|
|
|
|
|
|
2022-10-30 11:56:53 +02:00
|
|
|
[
|
|
|
|
|
"abstract"
|
|
|
|
|
"final"
|
|
|
|
|
"lazy"
|
2023-01-12 12:52:44 +01:00
|
|
|
"sealed"
|
2022-10-30 11:56:53 +02:00
|
|
|
"private"
|
|
|
|
|
"protected"
|
2024-03-08 19:09:51 +09:00
|
|
|
] @keyword.modifier
|
2022-10-30 11:56:53 +02:00
|
|
|
|
2024-03-16 14:23:57 +09:00
|
|
|
(inline_modifier) @keyword.modifier
|
2023-01-12 12:52:44 +01:00
|
|
|
|
2022-10-30 11:56:53 +02:00
|
|
|
(null_literal) @constant.builtin
|
|
|
|
|
|
2024-09-19 23:15:01 -07:00
|
|
|
(wildcard
|
|
|
|
|
"_") @character.special
|
2022-10-30 11:56:53 +02:00
|
|
|
|
2024-08-01 01:24:40 -07:00
|
|
|
(namespace_wildcard
|
|
|
|
|
[
|
|
|
|
|
"*"
|
|
|
|
|
"_"
|
|
|
|
|
] @character.special)
|
2024-05-12 18:23:41 -07:00
|
|
|
|
2022-10-30 11:56:53 +02:00
|
|
|
(annotation) @attribute
|
2021-08-25 19:38:45 -04:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; special keywords
|
2021-08-25 19:38:45 -04:00
|
|
|
"new" @keyword.operator
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"else"
|
|
|
|
|
"if"
|
|
|
|
|
"match"
|
2023-01-12 12:52:44 +01:00
|
|
|
"then"
|
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-08-25 19:38:45 -04:00
|
|
|
|
2021-08-28 21:07:44 +02:00
|
|
|
[
|
2024-01-06 15:05:50 +09:00
|
|
|
"("
|
|
|
|
|
")"
|
|
|
|
|
"["
|
|
|
|
|
"]"
|
|
|
|
|
"{"
|
|
|
|
|
"}"
|
|
|
|
|
] @punctuation.bracket
|
2021-08-28 21:07:44 +02:00
|
|
|
|
|
|
|
|
[
|
2024-01-06 15:05:50 +09:00
|
|
|
"."
|
|
|
|
|
","
|
2024-05-12 18:23:41 -07:00
|
|
|
":"
|
2021-08-28 21:07:44 +02:00
|
|
|
] @punctuation.delimiter
|
|
|
|
|
|
2021-08-25 19:38:45 -04:00
|
|
|
[
|
|
|
|
|
"do"
|
|
|
|
|
"for"
|
|
|
|
|
"while"
|
|
|
|
|
"yield"
|
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-08-25 19:38:45 -04:00
|
|
|
|
|
|
|
|
"def" @keyword.function
|
|
|
|
|
|
2021-08-28 21:07:44 +02:00
|
|
|
[
|
2024-01-06 15:05:50 +09:00
|
|
|
"=>"
|
2024-05-12 18:23:41 -07:00
|
|
|
"?=>"
|
|
|
|
|
"="
|
|
|
|
|
"!"
|
2024-01-06 15:05:50 +09:00
|
|
|
"<-"
|
|
|
|
|
"@"
|
2021-08-28 21:07:44 +02:00
|
|
|
] @operator
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
[
|
|
|
|
|
"import"
|
|
|
|
|
"export"
|
2024-05-12 18:23:41 -07:00
|
|
|
"package"
|
2024-01-06 15:05:50 +09:00
|
|
|
] @keyword.import
|
2021-08-25 19:38:45 -04:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"try"
|
|
|
|
|
"catch"
|
|
|
|
|
"throw"
|
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-08-25 19:38:45 -04:00
|
|
|
|
|
|
|
|
"return" @keyword.return
|
|
|
|
|
|
2023-06-06 16:36:09 +02:00
|
|
|
[
|
|
|
|
|
(comment)
|
|
|
|
|
(block_comment)
|
|
|
|
|
] @comment @spell
|
2021-08-28 21:07:44 +02:00
|
|
|
|
2023-06-06 16:36:09 +02:00
|
|
|
((block_comment) @comment.documentation
|
2023-03-02 08:06:35 -05:00
|
|
|
(#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$"))
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; `case` is a conditional keyword in case_block
|
2021-08-25 19:38:45 -04:00
|
|
|
(case_block
|
2024-01-06 15:05:50 +09:00
|
|
|
(case_clause
|
2024-01-21 22:05:44 +09:00
|
|
|
"case" @keyword.conditional))
|
2023-01-12 12:52:44 +01:00
|
|
|
|
2024-05-12 18:23:41 -07:00
|
|
|
(case_block
|
|
|
|
|
(case_clause
|
|
|
|
|
"=>" @punctuation.delimiter))
|
|
|
|
|
|
2023-01-12 12:52:44 +01:00
|
|
|
(operator_identifier) @operator
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
((identifier) @type
|
|
|
|
|
(#lua-match? @type "^[A-Z]"))
|
|
|
|
|
|
2023-01-12 12:52:44 +01:00
|
|
|
((identifier) @variable.builtin
|
2024-01-06 15:05:50 +09:00
|
|
|
(#lua-match? @variable.builtin "^this$"))
|
2023-01-12 12:52:44 +01:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
((identifier) @function.builtin
|
|
|
|
|
(#lua-match? @function.builtin "^super$"))
|
2023-06-02 15:13:30 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Scala CLI using directives
|
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
|
|
|
(using_directive_key) @variable.parameter
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-06-02 15:13:30 +02:00
|
|
|
(using_directive_value) @string
|