2024-01-06 15:05:50 +09:00
|
|
|
; Constants
|
2022-07-11 23:16:25 +08:00
|
|
|
(integer) @number
|
2022-07-10 14:16:09 +08:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Variables and Symbols
|
|
|
|
|
(typed_binding
|
|
|
|
|
(atom
|
|
|
|
|
(qid) @variable))
|
2022-07-10 14:16:09 +08:00
|
|
|
|
|
|
|
|
(untyped_binding) @variable
|
2024-01-06 15:05:50 +09:00
|
|
|
|
|
|
|
|
(typed_binding
|
|
|
|
|
(expr) @type)
|
2022-07-10 14:16:09 +08:00
|
|
|
|
|
|
|
|
(id) @function
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2022-07-10 14:16:09 +08:00
|
|
|
(bid) @function
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(function_name
|
|
|
|
|
(atom
|
|
|
|
|
(qid) @function))
|
2022-07-10 14:16:09 +08:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(field_name) @function
|
2022-07-10 14:16:09 +08:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
[
|
|
|
|
|
(data_name)
|
|
|
|
|
(record_name)
|
|
|
|
|
] @constructor
|
2022-07-10 14:16:09 +08:00
|
|
|
|
|
|
|
|
; Set
|
|
|
|
|
(SetN) @type.builtin
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
(expr
|
|
|
|
|
.
|
|
|
|
|
(atom) @function)
|
2022-08-27 08:40:42 +08:00
|
|
|
|
|
|
|
|
((atom) @boolean
|
|
|
|
|
(#any-of? @boolean "true" "false" "True" "False"))
|
2022-07-10 14:16:09 +08:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Imports and Module Declarations
|
|
|
|
|
"import" @keyword.import
|
2022-07-10 14:16:09 +08: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
|
|
|
(module_name) @module
|
2022-07-10 14:16:09 +08:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Pragmas and comments
|
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
|
|
|
(pragma) @keyword.directive
|
2022-07-10 14:16:09 +08:00
|
|
|
|
2023-09-13 00:25:01 +09:00
|
|
|
(comment) @comment @spell
|
2022-07-10 14:16:09 +08:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Keywords
|
2022-07-10 14:16:09 +08:00
|
|
|
[
|
|
|
|
|
"where"
|
|
|
|
|
"data"
|
|
|
|
|
"rewrite"
|
|
|
|
|
"postulate"
|
|
|
|
|
"public"
|
|
|
|
|
"private"
|
|
|
|
|
"tactic"
|
|
|
|
|
"Prop"
|
|
|
|
|
"quote"
|
|
|
|
|
"renaming"
|
|
|
|
|
"open"
|
|
|
|
|
"in"
|
|
|
|
|
"hiding"
|
|
|
|
|
"constructor"
|
|
|
|
|
"abstract"
|
|
|
|
|
"let"
|
|
|
|
|
"field"
|
|
|
|
|
"mutual"
|
|
|
|
|
"module"
|
|
|
|
|
"infix"
|
|
|
|
|
"infixl"
|
|
|
|
|
"infixr"
|
2024-01-06 15:05:50 +09:00
|
|
|
] @keyword
|
2022-07-10 14:16:09 +08:00
|
|
|
|
2024-04-23 12:23:15 -07:00
|
|
|
"record" @keyword.type
|
|
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
;(expr
|
|
|
|
|
; f_name: (atom) @function)
|
|
|
|
|
; Brackets
|
2022-07-10 14:16:09 +08:00
|
|
|
[
|
|
|
|
|
"("
|
|
|
|
|
")"
|
|
|
|
|
"{"
|
2024-01-06 15:05:50 +09:00
|
|
|
"}"
|
|
|
|
|
] @punctuation.bracket
|
2022-07-10 14:16:09 +08:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
"=" @operator
|