2023-08-17 06:27:51 +02:00
|
|
|
[
|
|
|
|
|
(comment)
|
|
|
|
|
(extra_text)
|
2023-09-13 00:25:01 +09:00
|
|
|
] @comment @spell
|
2023-07-17 10:21:10 +02:00
|
|
|
|
2023-08-17 06:27:51 +02:00
|
|
|
[
|
|
|
|
|
(section_header)
|
|
|
|
|
(setting_statement)
|
|
|
|
|
(keyword_setting)
|
|
|
|
|
(test_case_setting)
|
|
|
|
|
] @keyword
|
2023-07-17 10:21:10 +02:00
|
|
|
|
2026-03-06 10:58:02 +01:00
|
|
|
(scalar_variable
|
|
|
|
|
(variable_name) @variable)
|
|
|
|
|
|
|
|
|
|
(list_variable
|
|
|
|
|
(variable_name) @variable)
|
|
|
|
|
|
|
|
|
|
(dictionary_variable
|
2024-01-06 15:05:50 +09:00
|
|
|
(variable_name) @variable)
|
|
|
|
|
|
|
|
|
|
(keyword_definition
|
|
|
|
|
(name) @function)
|
|
|
|
|
|
|
|
|
|
(test_case_definition
|
|
|
|
|
(name) @function)
|
|
|
|
|
|
|
|
|
|
(keyword_invocation
|
|
|
|
|
(keyword) @function.call)
|
2023-07-17 10:21:10 +02:00
|
|
|
|
2023-08-17 06:27:51 +02:00
|
|
|
(ellipses) @punctuation.delimiter
|
2023-07-17 10:21:10 +02:00
|
|
|
|
2023-08-17 06:27:51 +02:00
|
|
|
(text_chunk) @string
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-08-17 06:27:51 +02:00
|
|
|
(inline_python_expression) @string.special
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-08-17 06:27:51 +02:00
|
|
|
[
|
|
|
|
|
(scalar_variable)
|
|
|
|
|
(list_variable)
|
|
|
|
|
(dictionary_variable)
|
|
|
|
|
] @variable
|
2023-07-17 10:21:10 +02:00
|
|
|
|
2023-08-17 06:27:51 +02:00
|
|
|
; Control structures
|
|
|
|
|
[
|
|
|
|
|
"FOR"
|
|
|
|
|
"IN"
|
|
|
|
|
"IN RANGE"
|
|
|
|
|
"IN ENUMERATE"
|
|
|
|
|
"IN ZIP"
|
|
|
|
|
(break_statement)
|
|
|
|
|
(continue_statement)
|
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
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
(for_statement
|
|
|
|
|
"END" @keyword.repeat)
|
2023-08-17 06:27:51 +02: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
|
|
|
"WHILE" @keyword.repeat
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
(while_statement
|
|
|
|
|
"END" @keyword.repeat)
|
2023-08-17 06:27:51 +02:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"IF"
|
|
|
|
|
"ELSE IF"
|
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
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
(if_statement
|
|
|
|
|
"END" @keyword.conditional)
|
|
|
|
|
|
|
|
|
|
(if_statement
|
|
|
|
|
(else_statement
|
|
|
|
|
"ELSE" @keyword.conditional))
|
2023-08-17 06:27:51 +02:00
|
|
|
|
2024-11-21 10:44:40 +01:00
|
|
|
(inline_if_statement
|
|
|
|
|
(inline_else_statement
|
|
|
|
|
"ELSE" @keyword.conditional))
|
|
|
|
|
|
2023-08-17 06:27:51 +02:00
|
|
|
[
|
|
|
|
|
"TRY"
|
|
|
|
|
"EXCEPT"
|
|
|
|
|
"FINALLY"
|
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
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
(try_statement
|
|
|
|
|
"END" @keyword.exception)
|
|
|
|
|
|
|
|
|
|
(try_statement
|
|
|
|
|
(else_statement
|
|
|
|
|
"ELSE" @keyword.exception))
|
2024-11-21 10:44:40 +01:00
|
|
|
|
|
|
|
|
; Extra captures for "Documentation" settings
|
|
|
|
|
(setting_statement
|
|
|
|
|
name: (setting_name) @_name
|
|
|
|
|
(arguments
|
|
|
|
|
(argument
|
|
|
|
|
(text_chunk) @spell @string.documentation))
|
|
|
|
|
(#any-of? @_name "Documentation" "documentation" "DOCUMENTATION"))
|
|
|
|
|
|
|
|
|
|
(setting_statement
|
|
|
|
|
name: (setting_name) @_name
|
|
|
|
|
(arguments
|
|
|
|
|
(continuation
|
|
|
|
|
(argument
|
|
|
|
|
(text_chunk) @spell @string.documentation)))
|
|
|
|
|
(#any-of? @_name "Documentation" "documentation" "DOCUMENTATION"))
|
|
|
|
|
|
|
|
|
|
(keyword_setting
|
|
|
|
|
name: (keyword_setting_name) @_name
|
|
|
|
|
(arguments
|
|
|
|
|
(argument
|
|
|
|
|
(text_chunk) @spell @string.documentation))
|
|
|
|
|
(#any-of? @_name "Documentation" "documentation" "DOCUMENTATION"))
|
|
|
|
|
|
|
|
|
|
(keyword_setting
|
|
|
|
|
name: (keyword_setting_name) @_name
|
|
|
|
|
(arguments
|
|
|
|
|
(continuation
|
|
|
|
|
(argument
|
|
|
|
|
(text_chunk) @spell @string.documentation)))
|
|
|
|
|
(#any-of? @_name "Documentation" "documentation" "DOCUMENTATION"))
|
|
|
|
|
|
|
|
|
|
(test_case_setting
|
|
|
|
|
name: (test_case_setting_name) @_name
|
|
|
|
|
(arguments
|
|
|
|
|
(argument
|
|
|
|
|
(text_chunk) @spell @string.documentation))
|
|
|
|
|
(#any-of? @_name "Documentation" "documentation" "DOCUMENTATION"))
|
|
|
|
|
|
|
|
|
|
(test_case_setting
|
|
|
|
|
name: (test_case_setting_name) @_name
|
|
|
|
|
(arguments
|
|
|
|
|
(continuation
|
|
|
|
|
(argument
|
|
|
|
|
(text_chunk) @spell @string.documentation)))
|
|
|
|
|
(#any-of? @_name "Documentation" "documentation" "DOCUMENTATION"))
|