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

376 lines
6.6 KiB
Scheme
Raw Permalink Normal View History

2024-01-06 15:05:50 +09:00
; Identifiers
(identifier) @variable
2024-11-11 08:39:00 +01:00
(field_expression
(identifier) @variable.member .)
; Symbols
(quote_expression
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
":" @string.special.symbol
2024-01-06 15:05:50 +09:00
[
(identifier)
(operator)
] @string.special.symbol)
2024-11-11 08:39:00 +01:00
; Function calls
(call_expression
(identifier) @function.call)
2024-01-06 15:05:50 +09:00
(call_expression
2024-01-06 15:05:50 +09:00
(field_expression
(identifier) @function.call .))
(broadcast_call_expression
(identifier) @function.call)
2024-01-06 15:05:50 +09:00
(broadcast_call_expression
2024-01-06 15:05:50 +09:00
(field_expression
(identifier) @function.call .))
(binary_expression
(_)
(operator) @_pipe
(identifier) @function.call
(#any-of? @_pipe "|>" ".|>"))
2024-11-11 08:39:00 +01:00
; Macros
(macro_identifier
"@" @function.macro
(identifier) @function.macro)
(macro_definition
(signature
(call_expression
.
(identifier) @function.macro)))
2024-11-11 08:39:00 +01:00
; Built-in functions
; print.("\"", filter(name -> getglobal(Core, name) isa Core.Builtin, names(Core)), "\" ")
((identifier) @function.builtin
(#any-of? @function.builtin
"applicable" "fieldtype" "getfield" "getglobal" "invoke" "isa" "isdefined" "isdefinedglobal"
"modifyfield!" "modifyglobal!" "nfields" "replacefield!" "replaceglobal!" "setfield!"
"setfieldonce!" "setglobal!" "setglobalonce!" "swapfield!" "swapglobal!" "throw" "tuple"
"typeassert" "typeof"))
2024-01-06 15:05:50 +09:00
2024-11-11 08:39:00 +01:00
; Type definitions
(type_head
(_) @type.definition)
2024-01-06 15:05:50 +09:00
2024-11-11 08:39:00 +01:00
; Type annotations
(parametrized_type_expression
2024-01-06 15:05:50 +09:00
[
(identifier) @type
(field_expression
(identifier) @type .)
2024-11-11 08:39:00 +01:00
]
2024-01-06 15:05:50 +09:00
(curly_expression
(_) @type))
(typed_expression
(identifier) @type .)
(unary_typed_expression
(identifier) @type .)
2024-11-11 08:39:00 +01:00
(where_expression
[
(curly_expression
(_) @type)
(_) @type
] .)
(unary_expression
(operator) @operator
(_) @type
(#any-of? @operator "<:" ">:"))
2024-11-11 08:39:00 +01:00
(binary_expression
(_) @type
(operator) @operator
(_) @type
(#any-of? @operator "<:" ">:"))
2024-01-06 15:05:50 +09:00
2024-11-11 08:39:00 +01:00
; Built-in types
; print.("\"", filter(name -> typeof(Base.eval(Core, name)) in [DataType, UnionAll], names(Core)), "\" ")
((identifier) @type.builtin
(#any-of? @type.builtin
2024-11-11 08:39:00 +01:00
"AbstractArray" "AbstractChar" "AbstractFloat" "AbstractString" "Any" "ArgumentError" "Array"
"AssertionError" "AtomicMemory" "AtomicMemoryRef" "Bool" "BoundsError" "Char"
"ConcurrencyViolationError" "Cvoid" "DataType" "DenseArray" "DivideError" "DomainError"
"ErrorException" "Exception" "Expr" "FieldError" "Float16" "Float32" "Float64" "Function"
"GenericMemory" "GenericMemoryRef" "GlobalRef" "IO" "InexactError" "InitError" "Int" "Int128"
"Int16" "Int32" "Int64" "Int8" "Integer" "InterruptException" "LineNumberNode" "LoadError"
"Memory" "MemoryRef" "Method" "MethodError" "Module" "NTuple" "NamedTuple" "Nothing" "Number"
"OutOfMemoryError" "OverflowError" "Pair" "Ptr" "QuoteNode" "ReadOnlyMemoryError" "Real" "Ref"
"SegmentationFault" "Signed" "StackOverflowError" "String" "Symbol" "Task" "Tuple" "Type"
"TypeError" "TypeVar" "UInt" "UInt128" "UInt16" "UInt32" "UInt64" "UInt8" "UndefInitializer"
"UndefKeywordError" "UndefRefError" "UndefVarError" "Union" "UnionAll" "Unsigned" "VecElement"
"WeakRef"))
2024-01-06 15:05:50 +09:00
; Keywords
[
"global"
"local"
] @keyword
(compound_statement
2024-01-06 15:05:50 +09:00
[
"begin"
"end"
] @keyword)
(quote_statement
2024-01-06 15:05:50 +09:00
[
"quote"
"end"
] @keyword)
(let_statement
2024-01-06 15:05:50 +09:00
[
"let"
"end"
] @keyword)
(if_statement
2024-01-06 15:05:50 +09:00
[
"if"
"end"
] @keyword.conditional)
(elseif_clause
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
"elseif" @keyword.conditional)
2024-01-06 15:05:50 +09:00
(else_clause
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
"else" @keyword.conditional)
2024-01-06 15:05:50 +09:00
(ternary_expression
2024-01-06 15:05:50 +09:00
[
"?"
":"
] @keyword.conditional.ternary)
(try_statement
2024-01-06 15:05:50 +09:00
[
"try"
"end"
] @keyword.exception)
(catch_clause
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
"catch" @keyword.exception)
2024-11-11 08:39:00 +01:00
(finally_clause
"finally" @keyword.exception)
(for_statement
2024-01-06 15:05:50 +09:00
[
"for"
"end"
] @keyword.repeat)
2024-11-11 08:39:00 +01:00
(for_binding
"outer" @keyword.repeat)
; comprehensions
(for_clause
"for" @keyword.repeat)
(if_clause
"if" @keyword.conditional)
(while_statement
2024-01-06 15:05:50 +09:00
[
"while"
"end"
] @keyword.repeat)
[
(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-11-11 08:39:00 +01:00
[
"const"
"mutable"
] @keyword.modifier
(function_definition
[
"function"
"end"
] @keyword.function)
(do_clause
[
"do"
"end"
] @keyword.function)
(macro_definition
[
"macro"
"end"
] @keyword)
(return_statement
"return" @keyword.return)
(module_definition
2024-01-06 15:05:50 +09:00
[
"module"
"baremodule"
"end"
] @keyword.import)
2024-11-11 08:39:00 +01:00
(export_statement
"export" @keyword.import)
(public_statement
"public" @keyword.import)
(import_statement
2024-11-11 08:39:00 +01:00
"import" @keyword.import)
(using_statement
"using" @keyword.import)
2024-01-06 15:05:50 +09:00
(import_alias
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
"as" @keyword.import)
2024-01-06 15:05:50 +09:00
(selected_import
":" @punctuation.delimiter)
(struct_definition
2024-01-06 15:05:50 +09:00
[
2024-11-11 08:39:00 +01:00
"mutable"
2024-01-06 15:05:50 +09:00
"struct"
"end"
2024-04-23 12:23:15 -07:00
] @keyword.type)
2024-11-11 08:39:00 +01:00
(abstract_definition
2024-01-06 15:05:50 +09:00
[
2024-11-11 08:39:00 +01:00
"abstract"
"type"
2024-01-06 15:05:50 +09:00
"end"
2024-11-11 08:39:00 +01:00
] @keyword.type)
2024-01-06 15:05:50 +09:00
2024-11-11 08:39:00 +01:00
(primitive_definition
2024-01-06 15:05:50 +09:00
[
2024-11-11 08:39:00 +01:00
"primitive"
"type"
2024-01-06 15:05:50 +09:00
"end"
2024-11-11 08:39:00 +01:00
] @keyword.type)
2024-01-06 15:05:50 +09:00
; Operators & Punctuation
2024-11-11 08:39:00 +01:00
(operator) @operator
2024-01-06 15:05:50 +09:00
(adjoint_expression
"'" @operator)
(range_expression
":" @operator)
2024-11-11 08:39:00 +01:00
(arrow_function_expression
"->" @operator)
2024-11-11 08:39:00 +01:00
[
"."
"..."
] @punctuation.special
[
","
";"
"::"
] @punctuation.delimiter
; Treat `::` as operator in type contexts, see
; https://github.com/nvim-treesitter/nvim-treesitter/pull/7392
(typed_expression
"::" @operator)
(unary_typed_expression
"::" @operator)
2024-01-06 15:05:50 +09:00
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket
; Interpolation
(string_interpolation
.
"$" @punctuation.special)
(interpolation_expression
.
"$" @punctuation.special)
2024-11-11 08:39:00 +01:00
; Keyword operators
((operator) @keyword.operator
(#any-of? @keyword.operator "in" "isa"))
(where_expression
"where" @keyword.operator)
; Built-in constants
((identifier) @constant.builtin
(#any-of? @constant.builtin "nothing" "missing"))
((identifier) @variable.builtin
(#any-of? @variable.builtin "begin" "end")
(#has-ancestor? @variable.builtin index_expression))
2024-01-06 15:05:50 +09:00
; Literals
(boolean_literal) @boolean
2024-01-06 15:05:50 +09: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
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) @number.float
2024-01-06 15:05:50 +09:00
(#any-of? @number.float "NaN" "NaN16" "NaN32" "Inf" "Inf16" "Inf32"))
(character_literal) @character
2024-01-06 15:05:50 +09:00
(escape_sequence) @string.escape
(string_literal) @string
2024-01-06 15:05:50 +09:00
(prefixed_string_literal
prefix: (identifier) @function.macro) @string
(command_literal) @string.special
2024-01-06 15:05:50 +09:00
(prefixed_command_literal
prefix: (identifier) @function.macro) @string.special
2024-11-11 08:39:00 +01:00
((string_literal) @string.documentation
2024-01-06 15:05:50 +09:00
.
[
(abstract_definition)
(assignment)
(const_statement)
2024-11-11 08:39:00 +01:00
(function_definition)
(macro_definition)
(module_definition)
(struct_definition)
2024-01-06 15:05:50 +09:00
])
(source_file
(string_literal) @string.documentation
.
[
(identifier)
(call_expression)
])
[
(line_comment)
(block_comment)
] @comment @spell