2023-03-02 08:06:35 -05:00
|
|
|
(line_comment) @comment @spell
|
|
|
|
|
|
2021-08-08 18:54:24 +09:00
|
|
|
[
|
|
|
|
|
(container_doc_comment)
|
|
|
|
|
(doc_comment)
|
2023-03-02 08:06:35 -05:00
|
|
|
] @comment.documentation @spell
|
2021-11-21 14:42:32 +09:00
|
|
|
|
2021-08-23 14:46:27 +09:00
|
|
|
[
|
|
|
|
|
variable: (IDENTIFIER)
|
|
|
|
|
variable_type_function: (IDENTIFIER)
|
|
|
|
|
] @variable
|
2024-01-20 18:47:56 +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
|
|
|
parameter: (IDENTIFIER) @variable.parameter
|
2021-03-23 06:18:43 +05:30
|
|
|
|
2021-08-23 14:46:27 +09:00
|
|
|
[
|
|
|
|
|
field_member: (IDENTIFIER)
|
|
|
|
|
field_access: (IDENTIFIER)
|
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.member
|
2021-03-23 06:18:43 +05:30
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; assume TitleCase is a type
|
|
|
|
|
([
|
|
|
|
|
variable_type_function: (IDENTIFIER)
|
|
|
|
|
field_access: (IDENTIFIER)
|
|
|
|
|
parameter: (IDENTIFIER)
|
|
|
|
|
] @type
|
|
|
|
|
(#lua-match? @type "^%u([%l]+[%u%l%d]*)*$"))
|
2021-08-24 13:39:52 +09:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; assume camelCase is a function
|
|
|
|
|
([
|
|
|
|
|
variable_type_function: (IDENTIFIER)
|
|
|
|
|
field_access: (IDENTIFIER)
|
|
|
|
|
parameter: (IDENTIFIER)
|
|
|
|
|
] @function
|
|
|
|
|
(#lua-match? @function "^%l+([%u][%l%d]*)+$"))
|
|
|
|
|
|
|
|
|
|
; assume all CAPS_1 is a constant
|
|
|
|
|
([
|
|
|
|
|
variable_type_function: (IDENTIFIER)
|
|
|
|
|
field_access: (IDENTIFIER)
|
|
|
|
|
] @constant
|
|
|
|
|
(#lua-match? @constant "^%u[%u%d_]+$"))
|
2024-01-20 18:47:56 +09:00
|
|
|
|
2023-06-22 13:36:46 +05:30
|
|
|
function: (IDENTIFIER) @function
|
2024-01-20 18:47:56 +09:00
|
|
|
|
2023-06-22 13:36:46 +05:30
|
|
|
function_call: (IDENTIFIER) @function.call
|
2024-01-20 18:47:56 +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
|
|
|
exception: "!" @keyword.exception
|
2021-08-08 18:54:24 +09:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
((IDENTIFIER) @variable.builtin
|
|
|
|
|
(#eq? @variable.builtin "_"))
|
2021-11-25 20:42:01 +09:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(PtrTypeStart
|
|
|
|
|
"c" @variable.builtin)
|
2021-03-23 06:18:43 +05:30
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
((ContainerDeclType
|
|
|
|
|
[
|
|
|
|
|
(ErrorUnionExpr)
|
|
|
|
|
"enum"
|
|
|
|
|
])
|
|
|
|
|
(ContainerField
|
|
|
|
|
(IDENTIFIER) @constant))
|
2024-01-20 18:47:56 +09:00
|
|
|
|
2021-08-23 14:46:27 +09:00
|
|
|
field_constant: (IDENTIFIER) @constant
|
2021-08-13 13:36:01 +09:00
|
|
|
|
2021-08-08 18:54:24 +09:00
|
|
|
(BUILTINIDENTIFIER) @function.builtin
|
2021-03-23 06:18:43 +05:30
|
|
|
|
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
|
|
|
((BUILTINIDENTIFIER) @keyword.import
|
|
|
|
|
(#any-of? @keyword.import "@import" "@cImport"))
|
2021-03-30 19:53:03 +02:00
|
|
|
|
2021-08-08 18:54:24 +09:00
|
|
|
(INTEGER) @number
|
2021-03-23 06:18:43 +05:30
|
|
|
|
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-03-30 19:53:03 +02:00
|
|
|
|
2023-02-24 06:38:47 -05:00
|
|
|
[
|
|
|
|
|
"true"
|
|
|
|
|
"false"
|
|
|
|
|
] @boolean
|
|
|
|
|
|
2021-08-08 18:54:24 +09:00
|
|
|
[
|
2021-08-23 14:46:27 +09:00
|
|
|
(LINESTRING)
|
2021-08-08 18:54:24 +09:00
|
|
|
(STRINGLITERALSINGLE)
|
2023-02-14 08:39:37 +11:00
|
|
|
] @string @spell
|
2021-03-23 06:18:43 +05:30
|
|
|
|
2021-08-08 18:54:24 +09:00
|
|
|
(CHAR_LITERAL) @character
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2021-08-23 14:46:27 +09:00
|
|
|
(EscapeSequence) @string.escape
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2021-08-23 14:46:27 +09:00
|
|
|
(FormatSequence) @string.special
|
2021-03-23 06:18:43 +05:30
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(BreakLabel
|
|
|
|
|
(IDENTIFIER) @label)
|
|
|
|
|
|
|
|
|
|
(BlockLabel
|
|
|
|
|
(IDENTIFIER) @label)
|
2022-10-28 16:57:38 +03:00
|
|
|
|
|
|
|
|
[
|
2023-02-13 10:20:02 +11:00
|
|
|
"asm"
|
|
|
|
|
"defer"
|
|
|
|
|
"errdefer"
|
|
|
|
|
"test"
|
2023-02-24 06:38:47 -05:00
|
|
|
"opaque"
|
|
|
|
|
"error"
|
2024-05-12 14:33:12 -07:00
|
|
|
"const"
|
|
|
|
|
"var"
|
2023-02-13 10:20:02 +11:00
|
|
|
] @keyword
|
2021-08-08 18:54:24 +09:00
|
|
|
|
2024-04-23 12:23:15 -07:00
|
|
|
[
|
|
|
|
|
"struct"
|
|
|
|
|
"union"
|
|
|
|
|
"enum"
|
|
|
|
|
] @keyword.type
|
|
|
|
|
|
2023-02-24 06:37:45 -05:00
|
|
|
[
|
|
|
|
|
"async"
|
|
|
|
|
"await"
|
|
|
|
|
"suspend"
|
|
|
|
|
"nosuspend"
|
|
|
|
|
"resume"
|
|
|
|
|
] @keyword.coroutine
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
"fn" @keyword.function
|
2021-03-23 06:18:43 +05:30
|
|
|
|
2021-07-08 22:28:51 +02:00
|
|
|
[
|
2023-02-13 10:20:02 +11:00
|
|
|
"and"
|
|
|
|
|
"or"
|
|
|
|
|
"orelse"
|
|
|
|
|
] @keyword.operator
|
2021-07-08 22:28:51 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
"return" @keyword.return
|
2021-03-23 06:18:43 +05:30
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"if"
|
2023-02-13 10:20:02 +11:00
|
|
|
"else"
|
2021-03-23 06:18:43 +05:30
|
|
|
"switch"
|
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-03-23 06:18:43 +05:30
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"for"
|
|
|
|
|
"while"
|
2023-02-14 08:52:45 +11:00
|
|
|
"break"
|
|
|
|
|
"continue"
|
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-03-23 06:18:43 +05:30
|
|
|
|
2024-05-12 18:00:55 -07:00
|
|
|
[
|
|
|
|
|
"usingnamespace"
|
|
|
|
|
"export"
|
|
|
|
|
] @keyword.import
|
2021-03-23 06:18:43 +05:30
|
|
|
|
2022-10-28 16:57:38 +03:00
|
|
|
[
|
2023-02-13 10:20:02 +11:00
|
|
|
"try"
|
|
|
|
|
"catch"
|
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
|
2022-10-28 16:57:38 +03:00
|
|
|
|
2021-03-23 06:18:43 +05:30
|
|
|
[
|
2023-02-13 10:20:02 +11:00
|
|
|
"anytype"
|
|
|
|
|
(BuildinTypeExpr)
|
|
|
|
|
] @type.builtin
|
2021-03-23 06:18:43 +05:30
|
|
|
|
2021-08-08 18:54:24 +09:00
|
|
|
[
|
2023-02-13 10:20:02 +11:00
|
|
|
"volatile"
|
|
|
|
|
"allowzero"
|
|
|
|
|
"noalias"
|
|
|
|
|
"addrspace"
|
|
|
|
|
"align"
|
|
|
|
|
"callconv"
|
|
|
|
|
"linksection"
|
2024-05-12 14:33:12 -07:00
|
|
|
"pub"
|
|
|
|
|
"inline"
|
|
|
|
|
"noinline"
|
|
|
|
|
"extern"
|
2024-03-16 14:23:57 +09:00
|
|
|
] @keyword.modifier
|
2021-08-08 18:54:24 +09:00
|
|
|
|
|
|
|
|
[
|
2023-02-13 10:20:02 +11:00
|
|
|
"comptime"
|
|
|
|
|
"packed"
|
|
|
|
|
"threadlocal"
|
|
|
|
|
] @attribute
|
2021-08-08 18:54:24 +09:00
|
|
|
|
|
|
|
|
[
|
2023-02-13 10:20:02 +11:00
|
|
|
"null"
|
|
|
|
|
"unreachable"
|
|
|
|
|
"undefined"
|
|
|
|
|
] @constant.builtin
|
2021-08-08 18:54:24 +09:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
(CompareOp)
|
|
|
|
|
(BitwiseOp)
|
|
|
|
|
(BitShiftOp)
|
|
|
|
|
(AdditionOp)
|
2021-10-21 13:56:32 +09:00
|
|
|
(AssignOp)
|
2021-08-08 18:54:24 +09:00
|
|
|
(MultiplyOp)
|
|
|
|
|
(PrefixOp)
|
2021-08-13 13:36:01 +09:00
|
|
|
"*"
|
|
|
|
|
"**"
|
|
|
|
|
"->"
|
|
|
|
|
".?"
|
|
|
|
|
".*"
|
2021-09-20 17:58:15 +09:00
|
|
|
"?"
|
2021-03-23 06:18:43 +05:30
|
|
|
] @operator
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
";"
|
|
|
|
|
"."
|
|
|
|
|
","
|
2021-08-08 18:54:24 +09:00
|
|
|
":"
|
2024-05-12 14:33:12 -07:00
|
|
|
"=>"
|
2021-03-23 06:18:43 +05:30
|
|
|
] @punctuation.delimiter
|
|
|
|
|
|
2021-08-13 13:36:01 +09:00
|
|
|
[
|
|
|
|
|
".."
|
|
|
|
|
"..."
|
|
|
|
|
] @punctuation.special
|
|
|
|
|
|
2021-08-08 18:54:24 +09:00
|
|
|
[
|
|
|
|
|
"["
|
|
|
|
|
"]"
|
|
|
|
|
"("
|
|
|
|
|
")"
|
|
|
|
|
"{"
|
|
|
|
|
"}"
|
|
|
|
|
] @punctuation.bracket
|
2024-05-12 14:33:12 -07:00
|
|
|
|
|
|
|
|
(Payload
|
|
|
|
|
"|" @punctuation.bracket)
|
|
|
|
|
|
|
|
|
|
(PtrPayload
|
|
|
|
|
"|" @punctuation.bracket)
|
|
|
|
|
|
|
|
|
|
(PtrIndexPayload
|
|
|
|
|
"|" @punctuation.bracket)
|
|
|
|
|
|
|
|
|
|
(ParamType
|
|
|
|
|
(ErrorUnionExpr
|
|
|
|
|
(SuffixExpr
|
|
|
|
|
variable_type_function: (IDENTIFIER) @type)))
|