2021-08-20 13:35:04 -05:00
|
|
|
(identifier) @variable
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
((identifier) @constant
|
|
|
|
|
(#lua-match? @constant "^[A-Z][A-Z_0-9]*$"))
|
2021-04-18 09:57:02 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Keywords
|
2021-04-18 09:57:02 +02:00
|
|
|
[
|
|
|
|
|
"if"
|
|
|
|
|
"else"
|
|
|
|
|
"elseif"
|
|
|
|
|
"endif"
|
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-04-18 09:57:02 +02:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"try"
|
|
|
|
|
"catch"
|
|
|
|
|
"finally"
|
|
|
|
|
"endtry"
|
|
|
|
|
"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-04-18 09:57:02 +02:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"for"
|
|
|
|
|
"endfor"
|
|
|
|
|
"in"
|
|
|
|
|
"while"
|
|
|
|
|
"endwhile"
|
2022-08-17 11:09:14 +02: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-04-18 09:57:02 +02:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"function"
|
|
|
|
|
"endfunction"
|
|
|
|
|
] @keyword.function
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Function related
|
|
|
|
|
(function_declaration
|
|
|
|
|
name: (_) @function)
|
|
|
|
|
|
|
|
|
|
(call_expression
|
|
|
|
|
function: (identifier) @function.call)
|
|
|
|
|
|
|
|
|
|
(call_expression
|
2024-03-21 20:44:35 +09:00
|
|
|
function: (scoped_identifier
|
|
|
|
|
(identifier) @function.call))
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
(parameters
|
|
|
|
|
(identifier) @variable.parameter)
|
|
|
|
|
|
|
|
|
|
(default_parameter
|
|
|
|
|
(identifier) @variable.parameter)
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
(bang)
|
|
|
|
|
(spread)
|
|
|
|
|
] @punctuation.special
|
2021-04-18 09:57:02 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
[
|
|
|
|
|
(no_option)
|
|
|
|
|
(inv_option)
|
|
|
|
|
(default_option)
|
|
|
|
|
(option_name)
|
|
|
|
|
] @variable.builtin
|
2021-04-18 09:57:02 +02:00
|
|
|
|
2021-08-20 13:35:04 -05:00
|
|
|
[
|
|
|
|
|
(scope)
|
|
|
|
|
"a:"
|
|
|
|
|
"$"
|
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
|
|
|
] @module
|
2021-04-18 09:57:02 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Commands and user defined commands
|
2021-04-18 09:57:02 +02:00
|
|
|
[
|
|
|
|
|
"let"
|
|
|
|
|
"unlet"
|
2022-05-01 19:19:39 +02:00
|
|
|
"const"
|
2021-04-18 09:57:02 +02:00
|
|
|
"call"
|
|
|
|
|
"execute"
|
|
|
|
|
"normal"
|
|
|
|
|
"set"
|
2022-09-18 20:04:06 +03:00
|
|
|
"setfiletype"
|
2021-09-30 10:30:01 -05:00
|
|
|
"setlocal"
|
2021-04-18 09:57:02 +02:00
|
|
|
"silent"
|
|
|
|
|
"echo"
|
2022-09-18 20:04:06 +03:00
|
|
|
"echon"
|
|
|
|
|
"echohl"
|
2022-02-08 15:42:27 +01:00
|
|
|
"echomsg"
|
2022-09-18 20:04:06 +03:00
|
|
|
"echoerr"
|
2021-04-18 09:57:02 +02:00
|
|
|
"autocmd"
|
2021-08-20 14:44:24 +02:00
|
|
|
"augroup"
|
2021-04-18 09:57:02 +02:00
|
|
|
"return"
|
2021-08-31 09:35:48 +02:00
|
|
|
"syntax"
|
2022-10-15 10:54:43 +02:00
|
|
|
"filetype"
|
|
|
|
|
"source"
|
2021-04-18 09:57:02 +02:00
|
|
|
"lua"
|
|
|
|
|
"ruby"
|
|
|
|
|
"perl"
|
|
|
|
|
"python"
|
2021-08-25 17:02:02 +02:00
|
|
|
"highlight"
|
2022-08-23 14:17:55 +02:00
|
|
|
"command"
|
2022-01-19 16:31:29 +01:00
|
|
|
"delcommand"
|
|
|
|
|
"comclear"
|
2022-02-08 15:42:27 +01:00
|
|
|
"colorscheme"
|
2023-12-06 11:10:33 +02:00
|
|
|
"scriptencoding"
|
2022-02-08 15:42:27 +01:00
|
|
|
"startinsert"
|
|
|
|
|
"stopinsert"
|
|
|
|
|
"global"
|
|
|
|
|
"runtime"
|
|
|
|
|
"wincmd"
|
2022-08-23 14:17:55 +02:00
|
|
|
"cnext"
|
|
|
|
|
"cprevious"
|
|
|
|
|
"cNext"
|
|
|
|
|
"vertical"
|
|
|
|
|
"leftabove"
|
|
|
|
|
"aboveleft"
|
|
|
|
|
"rightbelow"
|
|
|
|
|
"belowright"
|
|
|
|
|
"topleft"
|
|
|
|
|
"botright"
|
2022-08-23 14:44:27 +02:00
|
|
|
(unknown_command_name)
|
2022-08-26 20:20:49 +02:00
|
|
|
"edit"
|
|
|
|
|
"enew"
|
|
|
|
|
"find"
|
|
|
|
|
"ex"
|
|
|
|
|
"visual"
|
|
|
|
|
"view"
|
2022-11-21 11:00:23 +00:00
|
|
|
"eval"
|
2023-08-27 02:43:10 -05:00
|
|
|
"sign"
|
2024-04-19 09:00:11 -07:00
|
|
|
"abort"
|
2021-04-18 09:57:02 +02:00
|
|
|
] @keyword
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
(map_statement
|
|
|
|
|
cmd: _ @keyword)
|
|
|
|
|
|
2024-01-24 18:14:19 +02:00
|
|
|
(keycode) @character.special
|
|
|
|
|
|
2022-08-23 14:44:27 +02:00
|
|
|
(command_name) @function.macro
|
2021-04-18 09:57:02 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Filetype command
|
|
|
|
|
(filetype_statement
|
|
|
|
|
[
|
|
|
|
|
"detect"
|
|
|
|
|
"plugin"
|
|
|
|
|
"indent"
|
|
|
|
|
"on"
|
|
|
|
|
"off"
|
|
|
|
|
] @keyword)
|
|
|
|
|
|
|
|
|
|
; Syntax command
|
|
|
|
|
(syntax_statement
|
|
|
|
|
(keyword) @string)
|
|
|
|
|
|
|
|
|
|
(syntax_statement
|
|
|
|
|
[
|
|
|
|
|
"enable"
|
|
|
|
|
"on"
|
|
|
|
|
"off"
|
|
|
|
|
"reset"
|
|
|
|
|
"case"
|
|
|
|
|
"spell"
|
|
|
|
|
"foldlevel"
|
|
|
|
|
"iskeyword"
|
|
|
|
|
"keyword"
|
|
|
|
|
"match"
|
|
|
|
|
"cluster"
|
|
|
|
|
"region"
|
|
|
|
|
"clear"
|
|
|
|
|
"include"
|
|
|
|
|
] @keyword)
|
|
|
|
|
|
|
|
|
|
(syntax_argument
|
|
|
|
|
name: _ @keyword)
|
2022-01-19 16:31:29 +01:00
|
|
|
|
2021-08-20 10:05:34 +02:00
|
|
|
[
|
|
|
|
|
"<buffer>"
|
|
|
|
|
"<nowait>"
|
|
|
|
|
"<silent>"
|
|
|
|
|
"<script>"
|
|
|
|
|
"<expr>"
|
|
|
|
|
"<unique>"
|
|
|
|
|
] @constant.builtin
|
|
|
|
|
|
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
|
|
|
(augroup_name) @module
|
2021-08-25 17:02:02 +02:00
|
|
|
|
|
|
|
|
(au_event) @constant
|
2021-04-18 09:57:02 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(normal_statement
|
|
|
|
|
(commands) @constant)
|
2022-01-19 16:35:27 +01:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Highlight command
|
2022-09-07 09:30:00 +02:00
|
|
|
(hl_attribute
|
|
|
|
|
key: _ @property
|
|
|
|
|
val: _ @constant)
|
|
|
|
|
|
|
|
|
|
(hl_group) @type
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(highlight_statement
|
|
|
|
|
[
|
|
|
|
|
"default"
|
|
|
|
|
"link"
|
|
|
|
|
"clear"
|
|
|
|
|
] @keyword)
|
2022-08-23 14:17:55 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Command command
|
2022-09-07 09:30:00 +02:00
|
|
|
(command) @string
|
|
|
|
|
|
2022-08-23 14:17:55 +02:00
|
|
|
(command_attribute
|
2022-08-26 20:20:49 +02:00
|
|
|
name: _ @property
|
2024-03-21 20:44:35 +09:00
|
|
|
val: (behavior
|
|
|
|
|
name: _ @constant
|
|
|
|
|
val: (identifier)? @function)?)
|
2022-08-26 20:20:49 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Edit command
|
2022-08-26 20:20:49 +02:00
|
|
|
(plus_plus_opt
|
|
|
|
|
val: _? @constant) @property
|
2022-02-08 15:42:27 +01:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(plus_cmd
|
|
|
|
|
"+" @property) @property
|
2022-02-08 15:42:27 +01:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Runtime command
|
|
|
|
|
(runtime_statement
|
|
|
|
|
(where) @keyword.operator)
|
2023-12-06 11:10:33 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Colorscheme command
|
|
|
|
|
(colorscheme_statement
|
|
|
|
|
(name) @string)
|
2023-12-06 11:10:33 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Scriptencoding command
|
|
|
|
|
(scriptencoding_statement
|
|
|
|
|
(encoding) @string.special)
|
2021-04-18 09:57:02 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Literals
|
2021-04-18 09:57:02 +02:00
|
|
|
(string_literal) @string
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2021-04-18 09:57:02 +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
|
|
|
(float_literal) @number.float
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2022-09-07 09:30:00 +02:00
|
|
|
(comment) @comment @spell
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2022-11-21 11:00:23 +00:00
|
|
|
(line_continuation_comment) @comment @spell
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2022-02-16 23:25:46 +01:00
|
|
|
(pattern) @string.special
|
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
|
|
|
(pattern_multi) @string.regexp
|
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
|
|
|
(filename) @string.special.path
|
2021-04-18 09:57:02 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(heredoc
|
|
|
|
|
(body) @string)
|
2021-04-18 09:57:02 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(heredoc
|
|
|
|
|
(parameter) @keyword)
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
(marker_definition)
|
|
|
|
|
(endmarker)
|
|
|
|
|
] @label
|
|
|
|
|
|
|
|
|
|
(literal_dictionary
|
2024-01-10 18:05:37 +02:00
|
|
|
(literal_key) @property)
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
((scoped_identifier
|
|
|
|
|
(scope) @_scope
|
|
|
|
|
.
|
|
|
|
|
(identifier) @boolean)
|
|
|
|
|
(#eq? @_scope "v:")
|
|
|
|
|
(#any-of? @boolean "true" "false"))
|
|
|
|
|
|
|
|
|
|
; Operators
|
2021-04-18 09:57:02 +02:00
|
|
|
[
|
|
|
|
|
"||"
|
|
|
|
|
"&&"
|
2021-08-20 13:35:04 -05:00
|
|
|
"&"
|
2021-04-18 09:57:02 +02:00
|
|
|
"+"
|
|
|
|
|
"-"
|
|
|
|
|
"*"
|
|
|
|
|
"/"
|
|
|
|
|
"%"
|
|
|
|
|
".."
|
|
|
|
|
"=="
|
|
|
|
|
"!="
|
|
|
|
|
">"
|
|
|
|
|
">="
|
|
|
|
|
"<"
|
|
|
|
|
"<="
|
|
|
|
|
"=~"
|
|
|
|
|
"!~"
|
|
|
|
|
"="
|
|
|
|
|
"+="
|
|
|
|
|
"-="
|
|
|
|
|
"*="
|
|
|
|
|
"/="
|
|
|
|
|
"%="
|
|
|
|
|
".="
|
2022-08-26 20:20:49 +02:00
|
|
|
"..="
|
2022-11-21 11:00:23 +00:00
|
|
|
"<<"
|
|
|
|
|
"=<<"
|
2024-04-19 09:00:11 -07:00
|
|
|
"->"
|
2022-11-21 11:00:23 +00:00
|
|
|
(match_case)
|
2021-04-18 09:57:02 +02:00
|
|
|
] @operator
|
|
|
|
|
|
2024-04-19 09:00:11 -07:00
|
|
|
[
|
|
|
|
|
"is"
|
|
|
|
|
"isnot"
|
|
|
|
|
] @keyword.operator
|
|
|
|
|
|
2021-04-18 09:57:02 +02:00
|
|
|
; Some characters have different meanings based on the context
|
2024-01-06 15:05:50 +09:00
|
|
|
(unary_operation
|
|
|
|
|
"!" @operator)
|
2021-08-16 17:19:35 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(binary_operation
|
|
|
|
|
"." @operator)
|
2022-11-21 11:00:23 +00:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Punctuation
|
2021-08-16 17:19:35 +02:00
|
|
|
[
|
|
|
|
|
"("
|
|
|
|
|
")"
|
|
|
|
|
"{"
|
|
|
|
|
"}"
|
|
|
|
|
"["
|
|
|
|
|
"]"
|
2022-11-21 11:00:23 +00:00
|
|
|
"#{"
|
2021-08-16 17:19:35 +02:00
|
|
|
] @punctuation.bracket
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(field_expression
|
|
|
|
|
"." @punctuation.delimiter)
|
2021-08-20 13:35:04 -05:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
","
|
|
|
|
|
":"
|
|
|
|
|
] @punctuation.delimiter
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(ternary_expression
|
|
|
|
|
[
|
|
|
|
|
"?"
|
|
|
|
|
":"
|
|
|
|
|
] @keyword.conditional.ternary)
|
2021-08-20 13:35:04 -05:00
|
|
|
|
|
|
|
|
; Options
|
|
|
|
|
((set_value) @number
|
2024-01-06 15:05:50 +09:00
|
|
|
(#lua-match? @number "^[%d]+(%.[%d]+)?$"))
|
|
|
|
|
|
|
|
|
|
(inv_option
|
|
|
|
|
"!" @operator)
|
2021-09-25 00:17:46 -05:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(set_item
|
|
|
|
|
"?" @operator)
|
2022-11-21 11:00:23 +00:00
|
|
|
|
2021-09-25 00:17:46 -05:00
|
|
|
((set_item
|
2024-01-06 15:05:50 +09:00
|
|
|
option: (option_name) @_option
|
|
|
|
|
value: (set_value) @function)
|
|
|
|
|
(#any-of? @_option "tagfunc" "tfu" "completefunc" "cfu" "omnifunc" "ofu" "operatorfunc" "opfunc"))
|