nvim-treesitter/runtime/queries/leo/highlights.scm

226 lines
2.8 KiB
Scheme
Raw Normal View History

2023-10-22 03:23:02 +02:00
[
2024-01-06 15:05:50 +09:00
"assert"
"assert_eq"
"assert_neq"
"block"
"console"
"const"
"let"
"mapping"
"program"
"self"
"then"
2023-10-22 03:23:02 +02:00
] @keyword
2024-04-23 12:23:15 -07:00
[
"record"
"struct"
] @keyword.type
[
"in"
"as"
] @keyword.operator
2023-10-22 03:23:02 +02:00
[
2024-01-06 15:05:50 +09:00
"constant"
"private"
"public"
] @keyword.modifier
2023-10-22 03:23:02 +02:00
"self" @variable.builtin
"network" @variable.builtin
"async" @keyword.coroutine
2023-10-22 03:23:02 +02:00
[
2024-01-06 15:05:50 +09:00
"finalize"
"function"
"inline"
"transition"
2023-10-22 03:23:02 +02:00
] @keyword.function
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
"import" @keyword.import
2023-10-22 03:23:02 +02:00
"return" @keyword.return
(return_arrow) @punctuation.delimiter
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
"for" @keyword.repeat
2023-10-22 03:23:02 +02:00
2024-01-06 15:05:50 +09:00
[
2023-10-22 03:23:02 +02:00
"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
2023-10-22 03:23:02 +02:00
[
2024-01-06 15:05:50 +09:00
(ternary_if)
(ternary_else)
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.ternary
2023-10-22 03:23:02 +02:00
[
2024-01-06 15:05:50 +09:00
"("
")"
"{"
"}"
"["
"]"
] @punctuation.bracket
2023-10-22 03:23:02 +02:00
2024-01-06 15:05:50 +09:00
[
";"
","
"::"
] @punctuation.delimiter
2023-10-22 03:23:02 +02:00
2024-01-06 15:05:50 +09:00
[
"!"
"&&"
"||"
"=="
"!="
"<"
"<="
">"
">="
"&"
"|"
"^"
"<<"
">>"
"+"
"-"
"*"
"/"
"%"
"**"
"="
"+="
"-="
"*="
"/="
"%="
"**="
"<<="
">>="
"&="
"|="
"^="
"&&="
"||="
2023-10-22 03:23:02 +02:00
] @operator
(comment) @comment @spell
(boolean_literal) @boolean
2024-01-06 15:05:50 +09:00
(constant_declaration
(identifier
(constant_identifier) @constant))
(variable
(constant_identifier) @constant)
(associated_constant) @constant
(variable) @variable
2023-10-22 03:23:02 +02:00
2024-08-30 06:42:19 +00:00
(program_id) @string.special
2023-10-22 03:23:02 +02:00
;record declaration
2024-01-06 15:05:50 +09:00
(record_declaration
(identifier) @type.definition)
2023-10-22 03:23:02 +02:00
2024-01-06 15:05:50 +09:00
;struct component
(struct_component_declaration
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
(identifier) @variable.member)
2023-10-22 03:23:02 +02:00
(struct_expression
(identifier) @type.definition)
(struct_component_initializer
(identifier) @variable.member)
[
(type)
(boolean_type)
(integer_type)
(field_type)
(group_type)
(scalar_type)
(address_type)
(signature_type)
(string_type)
] @type
2023-10-22 03:23:02 +02:00
[
2024-01-06 15:05:50 +09:00
(block_height)
(self_address)
2024-01-06 15:05:50 +09:00
(self_caller)
(self_signer)
(network_id)
2023-10-22 03:23:02 +02:00
] @constant.builtin
(free_function_call
2024-01-06 15:05:50 +09:00
(locator
(identifier) @function))
2023-10-22 03:23:02 +02:00
(associated_function_call
(named_type
(identifier
(constant_identifier) @function)))
(associated_function_call
(identifier) @function.call)
2023-10-22 03:23:02 +02:00
(record_type
2024-01-06 15:05:50 +09:00
(locator
(identifier) @variable.member))
2023-10-22 03:23:02 +02:00
(transition_declaration
name: (identifier) @function.builtin)
(finalizer
name: (identifier) @function.builtin)
2023-10-22 03:23:02 +02:00
(free_function_call
(identifier) @function.call)
(function_declaration
name: (identifier) @function)
(inline_declaration
name: (identifier) @function.macro)
(method_call
2024-01-06 15:05:50 +09:00
.
(_)
.
(identifier) @function.method.call)
2023-10-22 03:23:02 +02:00
(function_parameter
2024-01-06 15:05:50 +09:00
(identifier) @variable.parameter)
2023-10-22 03:23:02 +02:00
(struct_declaration
name: (identifier) @type.definition)
2023-10-22 03:23:02 +02:00
(variable_declaration
(identifier) @variable)
2023-10-22 03:23:02 +02:00
2024-01-06 15:05:50 +09:00
[
2023-10-22 03:23:02 +02:00
(address_literal)
(signature_literal)
2024-01-06 15:05:50 +09:00
((affine_group_literal)
(#set! priority 101))
2024-01-06 15:05:50 +09:00
(field_literal)
(product_group_literal)
(scalar_literal)
(signed_literal)
(unsigned_literal)
2023-10-22 03:23:02 +02:00
] @number
2024-08-26 04:37:52 -03:00
(string_literal) @string
(annotation) @attribute