2024-01-06 15:05:50 +09:00
|
|
|
; Primitives
|
2023-09-03 14:05:18 -05:00
|
|
|
(comment) @comment @spell
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-09-03 14:05:18 -05:00
|
|
|
(nat) @number
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-09-03 14:05:18 -05:00
|
|
|
(unit) @constant.builtin
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-09-03 14:05:18 -05:00
|
|
|
(literal_char) @character
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-09-03 14:05:18 -05:00
|
|
|
(literal_text) @string
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-09-03 14:05:18 -05:00
|
|
|
(literal_boolean) @boolean
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Keywords
|
2024-11-11 20:01:13 +01:00
|
|
|
(type_kw) @keyword.type
|
|
|
|
|
|
2023-09-03 14:05:18 -05:00
|
|
|
[
|
|
|
|
|
(kw_forall)
|
|
|
|
|
(do)
|
|
|
|
|
(kw_let)
|
2023-10-15 20:36:15 +02:00
|
|
|
(ability)
|
|
|
|
|
(where)
|
2023-09-03 14:05:18 -05:00
|
|
|
] @keyword
|
|
|
|
|
|
2024-03-08 19:09:51 +09:00
|
|
|
(structural) @keyword.modifier
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2024-03-08 19:09:51 +09:00
|
|
|
(unique) @keyword.modifier
|
2023-09-03 14:05:18 -05:00
|
|
|
|
|
|
|
|
(type_constructor) @constructor
|
|
|
|
|
|
2024-11-11 20:01:13 +01:00
|
|
|
((doc_block) @comment.documentation @spell
|
|
|
|
|
(#set! priority 90))
|
2023-09-03 14:05:18 -05:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
(operator)
|
2024-01-06 15:05:50 +09:00
|
|
|
(pipe)
|
|
|
|
|
(arrow_symbol)
|
2023-09-03 14:05:18 -05:00
|
|
|
(or)
|
2024-11-11 20:01:13 +01:00
|
|
|
(kw_equals)
|
|
|
|
|
] @operator
|
2023-09-03 14:05:18 -05:00
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"if"
|
|
|
|
|
"else"
|
|
|
|
|
"then"
|
|
|
|
|
(match)
|
|
|
|
|
(with)
|
|
|
|
|
(cases)
|
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
|
2023-09-03 14:05:18 -05:00
|
|
|
|
|
|
|
|
(blank_pattern) @variable.builtin
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(pattern) @variable
|
|
|
|
|
|
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
|
|
|
(use_clause) @keyword.import
|
2023-09-03 14:05:18 -05:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Types
|
|
|
|
|
(record_field
|
2024-11-11 20:01:13 +01:00
|
|
|
(field_name) @variable.member
|
|
|
|
|
type: (regular_identifier) @type)
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-10-15 20:36:15 +02:00
|
|
|
(type_name) @type
|
|
|
|
|
|
2024-11-11 20:01:13 +01:00
|
|
|
(type_declaration
|
|
|
|
|
(regular_identifier) @type)
|
|
|
|
|
|
|
|
|
|
(ability_name
|
|
|
|
|
(path)? @module
|
|
|
|
|
(regular_identifier) @type)
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(ability_declaration
|
2024-10-05 06:43:24 +00:00
|
|
|
(ability_name) @type
|
|
|
|
|
(type_argument) @variable.parameter)
|
2023-10-15 20:36:15 +02:00
|
|
|
|
2024-11-11 20:01:13 +01:00
|
|
|
(constructor
|
|
|
|
|
(constructor_name) @constructor)
|
|
|
|
|
|
|
|
|
|
(constructor
|
|
|
|
|
type: (regular_identifier) @type)
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(effect
|
2024-11-11 20:01:13 +01:00
|
|
|
(regular_identifier) @attribute) ; NOTE: an effect is a special type
|
2023-09-03 14:05:18 -05:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Namespaces
|
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) @module
|
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
|
|
|
(namespace) @module
|
2023-09-03 14:05:18 -05:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Terms
|
|
|
|
|
(type_signature
|
|
|
|
|
term_name: (path) @module
|
2024-11-11 20:01:13 +01:00
|
|
|
term_name: (regular_identifier) @variable)
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
(type_signature
|
2024-11-11 20:01:13 +01:00
|
|
|
term_name: (regular_identifier) @variable)
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-10-15 20:36:15 +02:00
|
|
|
(term_type) @type
|
|
|
|
|
|
2024-11-11 20:01:13 +01:00
|
|
|
(term_definition
|
|
|
|
|
name: (path) @module)
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
(term_definition
|
2024-11-11 20:01:13 +01:00
|
|
|
name: (regular_identifier) @variable)
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
(term_definition
|
2024-11-11 20:01:13 +01:00
|
|
|
param: (regular_identifier) @variable.parameter)
|
2023-10-15 20:36:15 +02:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Punctuation
|
2023-09-03 14:05:18 -05:00
|
|
|
[
|
|
|
|
|
(type_signature_colon)
|
|
|
|
|
":"
|
|
|
|
|
] @punctuation.delimiter
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
"("
|
|
|
|
|
")"
|
|
|
|
|
"{"
|
|
|
|
|
"}"
|
|
|
|
|
"["
|
|
|
|
|
"]"
|
|
|
|
|
] @punctuation.bracket
|
2023-10-15 20:36:15 +02:00
|
|
|
|
2024-11-11 20:01:13 +01:00
|
|
|
(watch_expression) @keyword.directive
|
|
|
|
|
|
|
|
|
|
(test_watch_expression) @keyword.directive
|