1

Refresh generated neovim config

This commit is contained in:
2024-08-15 13:01:03 +02:00
parent 64b51cf53a
commit f5af8e2b28
1836 changed files with 38979 additions and 31094 deletions

View File

@ -92,13 +92,6 @@
"{"
"}"
"@"
"} @"
(if_end_expression)
(for_end_expression)
(switch_end_expression)
(case_end_expression)
(default_end_expression)
(defer_end_expression)
] @punctuation.bracket
(two_way_binding

View File

@ -1 +1,16 @@
; inherits: html_tags
[
(statement_block)
(switch_statement)
] @indent.begin
(statement_block
"{" @indent.branch)
(statement_block
"}" @indent.end)
"}" @indent.branch
"}" @indent.end

View File

@ -65,3 +65,15 @@
(#eq? @_command "printf")
(#eq? @_arg "--")
(#set! injection.language "printf"))
((command
name: (command_name) @_command
.
argument: [
(string)
(raw_string)
] @injection.content)
(#eq? @_command "bind")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children)
(#set! injection.language "readline"))

View File

@ -42,6 +42,7 @@
[
(unset)
(default)
(any)
] @variable.builtin
(condition

View File

@ -9,4 +9,7 @@
(assignment
left: (identifier) @local.definition.var)
(pattern_binding
binding: (identifier) @local.definition.var)
(identifier) @local.reference

View File

@ -1,6 +1,6 @@
; Lower priority to prefer @variable.parameter when identifier appears in parameter_declaration.
((identifier) @variable
(#set! "priority" 95))
(#set! priority 95))
(preproc_def
(preproc_arg) @variable)

View File

@ -11,7 +11,7 @@
; have multiple highlight groups applied to them.
; >> Literals
((dis_expr) @comment
(#set! "priority" 105)
(#set! priority 105)
; Higher priority to mark the whole sexpr as a comment
)

View File

@ -3,11 +3,12 @@
((call_expression
(type) @_printf
(arguments
(named_arguments
"("
.
(expression
(string_literal) @injection.content)))
(named_argument
(expression
(string_literal) @injection.content))))
(#eq? @_printf "printf")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "printf"))

View File

@ -12,7 +12,7 @@
(module_def
(module_declaration
(module_fqn) @local.definition.namespace)
(#set! "definition.namespace.scope" "global"))
(#set! definition.namespace.scope "global"))
(enum_declaration
(enum_member

View File

@ -1,3 +1,5 @@
(comment) @comment @spell
[
(addition)
(new_file)

View File

@ -22,7 +22,7 @@
(raw_block)
(frontmatter)
] @markup.raw.block
(#set! "priority" 90))
(#set! priority 90))
; Remove @markup.raw for code with a language spec
(code_block
@ -30,7 +30,7 @@
(code_block_marker_begin)
(language)
(code) @none
(#set! "priority" 90))
(#set! priority 90))
[
(code_block_marker_begin)
@ -204,12 +204,12 @@
(#set! conceal ""))
((math) @markup.math
(#set! "priority" 90))
(#set! priority 90))
(verbatim) @markup.raw
((raw_inline) @markup.raw
(#set! "priority" 90))
(#set! priority 90))
(comment
"%" @comment

View File

@ -43,7 +43,7 @@
((heredoc_block
(heredoc_line) @string)
(#set! "priority" 90))
(#set! priority 90))
(expansion
[

View File

@ -1,5 +1,5 @@
((tag_name) @keyword
(#set! "priority" 105))
(#set! priority 105))
[
"@code"

View File

@ -69,7 +69,7 @@
(ExternalID
(SystemLiteral
(URI) @string.special.url))
(#set! "priority" 105))
(#set! priority 105))
; Attlist declaration
(AttlistDecl

View File

@ -132,11 +132,6 @@
(new_expression
constructor: (identifier) @constructor)
; Variables
;----------
(namespace_import
(identifier) @module)
; Decorators
;----------
(decorator
@ -302,6 +297,19 @@
"}"
] @punctuation.special) @none
; Imports
;----------
(namespace_import
"*" @character.special
(identifier) @module)
(namespace_export
"*" @character.special
(identifier) @module)
(export_statement
"*" @character.special)
; Keywords
;----------
[

View File

@ -59,10 +59,11 @@
(statement_block
"{" @indent.branch)
(parenthesized_expression
("("
(_)
")" @indent.end))
((parenthesized_expression
"("
(_)
")" @indent.end) @_outer
(#not-has-parent? @_outer if_statement))
[
"}"
@ -75,3 +76,7 @@
(comment)
(ERROR)
] @indent.auto
(if_statement
consequence: (_) @indent.dedent
(#not-kind-eq? @indent.dedent statement_block)) @indent.begin

View File

@ -43,6 +43,25 @@
(#set! injection.include-children)
(#set! injection.language "html"))
; Vercel PostgreSQL
; foo.sql`...` or foo.sql(`...`)
(call_expression
function: [
(await_expression
(member_expression
property: (property_identifier) @injection.language))
(member_expression
property: (property_identifier) @injection.language)
]
arguments: [
(arguments
(template_string) @injection.content)
(template_string) @injection.content
]
(#eq? @injection.language "sql")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children))
(call_expression
function: [
(await_expression

View File

@ -1,5 +1,5 @@
((atom) @constant
(#set! "priority" "90"))
(#set! priority "90"))
(var) @variable
@ -86,15 +86,15 @@
; Macros
((macro_call_expr) @constant.macro
(#set! "priority" 101))
(#set! priority 101))
; Preprocessor
(pp_define
lhs: _ @constant.macro
(#set! "priority" 101))
(#set! priority 101))
(_preprocessor_directive) @keyword.directive
(#set! "priority" 99)
(#set! priority 99)
; Attributes
(pp_include) @keyword.import
@ -108,7 +108,7 @@
(export_type_attribute
types: (fa
fun: _ @type
(#set! "priority" 101)))
(#set! priority 101)))
(behaviour_attribute) @keyword.import

View File

@ -22,7 +22,10 @@
"errors"
] @keyword
"method" @keyword.function
[
"method"
"event"
] @keyword.function
[
"enum"

View File

@ -90,7 +90,7 @@
] @variable.member
((field_id) @variable.member
(#set! "priority" 105))
(#set! priority 105))
(port
(identifier) @variable.member)

View File

@ -48,7 +48,7 @@
; Function Definition
((function_definition
(name) @local.definition.function)
(#set! "definition.function.scope" "parent"))
(#set! definition.function.scope "parent"))
; Lambda
; lambda names are not accessible and are only for debugging.
@ -74,7 +74,7 @@
; Class
((class_definition
(name) @local.definition.type)
(#set! "definition.type.scope" "parent"))
(#set! definition.type.scope "parent"))
(class_definition
(body
@ -102,7 +102,7 @@
(body
(function_definition
(name) @local.definition.method)))
(#set! "definition.method.scope" "parent"))
(#set! definition.method.scope "parent"))
; Enum
(enum_definition

View File

@ -15,8 +15,6 @@
(subject) @markup.heading @spell
(overflow) @comment.warning @spell
(subject
(subject_prefix) @function @nospell)

View File

@ -1,5 +1,7 @@
(comment) @comment @spell
(pattern_char) @string.special.path
[
(directory_separator)
(directory_separator_escaped)
@ -9,16 +11,17 @@
(wildcard_char_single)
(wildcard_chars)
(wildcard_chars_allow_slash)
(bracket_negation)
] @operator
(negation) @punctuation.special
] @character.special
[
(pattern_char_escaped)
(bracket_char_escaped)
] @string.escape
(negation) @punctuation.special
(bracket_negation) @operator
; bracket expressions
[
"["

View File

@ -12,10 +12,21 @@
(block)
(call_expression)
(parameter_list)
(struct_type)
(field_declaration_list)
(interface_type)
] @indent.begin
"}" @indent.branch
(literal_value
"}" @indent.branch)
(block
"}" @indent.branch)
(field_declaration_list
"}" @indent.branch)
(interface_type
"}" @indent.branch)
(const_declaration
")" @indent.branch)

View File

@ -1,39 +1,49 @@
; Priorities of the highlight queries are raised, so that they overrule the
; often surrounding and overlapping highlights from the non-gotmpl injections.
;
; Identifiers
[
([
(field)
(field_identifier)
] @variable.member
(#set! priority 110))
(variable) @variable
((variable) @variable
(#set! priority 110))
; Function calls
(function_call
function: (identifier) @function)
function: (identifier) @function
(#set! priority 110))
(method_call
method: (selector_expression
field: (field_identifier) @function))
field: (field_identifier) @function
(#set! priority 110)))
; Builtin functions
(function_call
function: (identifier) @function.builtin
(#set! priority 110)
(#any-of? @function.builtin
"and" "call" "html" "index" "slice" "js" "len" "not" "or" "print" "printf" "println" "urlquery"
"eq" "ne" "lt" "ge" "gt" "ge"))
; Operators
[
([
"|"
":="
] @operator
(#set! priority 110))
; Delimiters
[
([
"."
","
] @punctuation.delimiter
(#set! priority 110))
[
([
"{{"
"}}"
"{{-"
@ -41,6 +51,7 @@
")"
"("
] @punctuation.bracket
(#set! priority 110))
; Actions
(if_action
@ -49,59 +60,73 @@
"else"
"else if"
"end"
] @keyword.conditional)
] @keyword.conditional
(#set! priority 110))
(range_action
[
"range"
"else"
"end"
] @keyword.repeat)
] @keyword.repeat
(#set! priority 110))
(template_action
"template" @function.builtin)
"template" @function.builtin
(#set! priority 110))
(block_action
[
"block"
"end"
] @keyword.directive)
] @keyword.directive
(#set! priority 110))
(define_action
[
"define"
"end"
] @keyword.directive.define)
] @keyword.directive.define
(#set! priority 110))
(with_action
[
"with"
"else"
"end"
] @keyword.conditional)
] @keyword.conditional
(#set! priority 110))
; Literals
[
([
(interpreted_string_literal)
(raw_string_literal)
] @string
(#set! priority 110))
(rune_literal) @string.special.symbol
((rune_literal) @string.special.symbol
(#set! priority 110))
(escape_sequence) @string.escape
((escape_sequence) @string.escape
(#set! priority 110))
[
([
(int_literal)
(imaginary_literal)
] @number
(#set! priority 110))
(float_literal) @number.float
((float_literal) @number.float
(#set! priority 110))
[
([
(true)
(false)
] @boolean
(#set! priority 110))
(nil) @constant.builtin
((nil) @constant.builtin
(#set! priority 110))
(comment) @comment @spell
((comment) @comment @spell
(#set! priority 110))

View File

@ -148,6 +148,8 @@
"!"
] @operator
(wildcard_import) @character.special
(string
"/" @string)

View File

@ -39,7 +39,7 @@
((scoped_type_identifier
path: (_) @module)
(#set! "priority" 105))
(#set! priority 105))
; Keywords
[
@ -93,7 +93,7 @@
; Labels
((label) @label
(#set! "priority" 105))
(#set! priority 105))
; Functions
(function_declaration
@ -144,7 +144,7 @@
((member_expression
"."
(_) @variable.member)
(#set! "priority" 105))
(#set! priority 105))
(field
.

View File

@ -14,7 +14,8 @@
(if_statement
("("
condition: (_)")") @indent.begin)
condition: (_)
")") @indent.begin)
[
"}"

View File

@ -144,7 +144,8 @@
.
(decl
name: (variable) @variable)
match: (_)(#eq? @_name @variable))
match: (_)
(#eq? @_name @variable))
; but consider a type that involves 'IO' a decl/function
(decl/signature
@ -161,7 +162,8 @@
.
(decl
name: (variable) @function)
match: (_)(#eq? @_name @function))
match: (_)
(#eq? @_name @function))
((decl/signature) @function
.

View File

@ -1,8 +1,11 @@
; inherits: gotmpl
; For the reasoning concerning the priorities, see gotmpl highlights.
;
; Builtin functions
(function_call
function: (identifier) @function.builtin
(#set! priority 110)
(#any-of? @function.builtin
"and" "or" "not" "eq" "ne" "lt" "le" "gt" "ge" "default" "required" "empty" "fail" "coalesce"
"ternary" "print" "println" "printf" "trim" "trimAll" "trimPrefix" "trimSuffix" "lower" "upper"
@ -33,6 +36,7 @@
(selector_expression
operand: (field
name: (identifier) @constant.builtin
(#set! priority 110)
(#any-of? @constant.builtin
"Values" "Chart" "Release" "Capabilities" "Files" "Subcharts" "Template"))
(field_identifier))
@ -41,5 +45,6 @@
(selector_expression
operand: (variable)
field: (field_identifier) @constant.builtin
(#set! priority 110)
(#any-of? @constant.builtin
"Values" "Chart" "Release" "Capabilities" "Files" "Subcharts" "Template"))

View File

@ -7,7 +7,7 @@
((attribute
(quoted_attribute_value) @string)
(#set! "priority" 99))
(#set! priority 99))
(text) @none @spell
@ -86,14 +86,15 @@
((element
(start_tag
(tag_name) @_tag)
(text) @string.special.url)
(text) @markup.link.label)
(#eq? @_tag "a"))
((attribute
(attribute_name) @_attr
(quoted_attribute_value
(attribute_value) @string.special.url))
(#any-of? @_attr "href" "src"))
(#any-of? @_attr "href" "src")
(#set! @string.special.url url @string.special.url))
[
"<"

View File

@ -11,4 +11,5 @@
(multiline_string
(multiline_string_type) @_lang
(multiline_string_content) @injection.content
(#set-lang-from-info-string! @_lang))
(#set-lang-from-info-string! @_lang)
(#set! injection.combined))

View File

@ -77,18 +77,31 @@
(map_type)
(object_type)
(value_base_type)
(wide_string_type)
(wide_char_type)
] @type.builtin
(escape_sequence) @string.escape
(scoped_name) @type
(boolean_literal) @boolean
(number_literal) @number
(integer_literal) @number
[
(floating_pt_literal)
(fixed_pt_literal)
] @number.float
(char_literal) @character
(wide_character_literal) @character
(string_literal) @string
(wide_string_literal) @string
[
"("
")"
@ -111,7 +124,7 @@
"~"
"|"
"^"
"$"
"&"
] @operator
[
@ -128,15 +141,19 @@
(simple_declarator) @variable.member)
(annotation_appl
"@" @attribute
"@" @attribute)
(annotation_appl_custom_body
(scoped_name) @attribute)
(op_dcl
(identifier) @function.method)
(type_declarator
(simple_type_spec) @type
(any_declarators) @type)
(simple_type_spec) @type)
(type_declarator
(any_declarators) @variable.member)
(param_dcl
(simple_declarator) @variable.parameter)
@ -205,8 +222,8 @@
(bitfield_spec
"bitfield" @keyword.modifier
(positive_int_const) @number
(destination_type)* @type)
(identifier) @variable.member)
(destination_type)? @type)
(identifier)* @variable.member)
(bit_value) @constant
@ -327,3 +344,36 @@
(factory_param_dcl
(simple_declarator) @variable.parameter)
(element_spec
(declarator) @variable.member)
(preproc_include
(keyword_include) @type
path: (_) @string)
(system_lib_string
"<" @string
">" @string)
(extend_annotation_appl
"//@" @attribute
(annotation_appl_custom_body))
(extend_annotation_appl
"//@" @attribute.builtin
(annotation_appl_builtin_body))
[
(autoid_kind)
(extensibility_kind)
(verbatim_language)
(placement_kind)
(service_platform)
(try_construct_fail_action)
(data_representation_mask)
] @constant
(anno_name) @attribute.builtin
(range_kind) @attribute.builtin

View File

@ -257,6 +257,10 @@
"uses"
] @keyword.import
(import_declaration
(asterisk
"*" @character.special))
; Punctuation
[
";"

View File

@ -1,3 +1,40 @@
(tag_name) @keyword @nospell
(type) @type @nospell
[
"{"
"}"
"["
"]"
] @punctuation.bracket
[
":"
"/"
"."
"#"
"~"
] @punctuation.delimiter
(identifier) @variable
(tag
(tag_name) @_name
(identifier) @function
(#any-of? @_name "@callback" "@function" "@func" "@method"))
(tag
(tag_name) @_name
(identifier) @variable.parameter
(#any-of? @_name "@param" "@arg" "@argument"))
(tag
(tag_name) @_name
(identifier) @property
(#any-of? @_name "@prop" "@property"))
(tag
(tag_name) @_name
(identifier) @type
(#eq? @_name "@typedef"))

View File

@ -11,7 +11,7 @@
(field
function: (fieldname
(id) @local.definition.function)
(#set! "definition.function.scope" "parent"))
(#set! definition.function.scope "parent"))
(bind
(id) @local.definition.var)

View File

@ -65,3 +65,87 @@
(jsx_text) @none @spell
(html_character_reference) @character.special
((jsx_element
(jsx_opening_element
name: (identifier) @_tag)
(jsx_text) @markup.heading)
(#eq? @_tag "title"))
((jsx_element
(jsx_opening_element
name: (identifier) @_tag)
(jsx_text) @markup.heading.1)
(#eq? @_tag "h1"))
((jsx_element
(jsx_opening_element
name: (identifier) @_tag)
(jsx_text) @markup.heading.2)
(#eq? @_tag "h2"))
((jsx_element
(jsx_opening_element
name: (identifier) @_tag)
(jsx_text) @markup.heading.3)
(#eq? @_tag "h3"))
((jsx_element
(jsx_opening_element
name: (identifier) @_tag)
(jsx_text) @markup.heading.4)
(#eq? @_tag "h4"))
((jsx_element
(jsx_opening_element
name: (identifier) @_tag)
(jsx_text) @markup.heading.5)
(#eq? @_tag "h5"))
((jsx_element
(jsx_opening_element
name: (identifier) @_tag)
(jsx_text) @markup.heading.6)
(#eq? @_tag "h6"))
((jsx_element
(jsx_opening_element
name: (identifier) @_tag)
(jsx_text) @markup.strong)
(#any-of? @_tag "strong" "b"))
((jsx_element
(jsx_opening_element
name: (identifier) @_tag)
(jsx_text) @markup.italic)
(#any-of? @_tag "em" "i"))
((jsx_element
(jsx_opening_element
name: (identifier) @_tag)
(jsx_text) @markup.strikethrough)
(#any-of? @_tag "s" "del"))
((jsx_element
(jsx_opening_element
name: (identifier) @_tag)
(jsx_text) @markup.underline)
(#eq? @_tag "u"))
((jsx_element
(jsx_opening_element
name: (identifier) @_tag)
(jsx_text) @markup.raw)
(#any-of? @_tag "code" "kbd"))
((jsx_element
(jsx_opening_element
name: (identifier) @_tag)
(jsx_text) @markup.link.label)
(#eq? @_tag "a"))
((jsx_attribute
(property_identifier) @_attr
(string
(string_fragment) @string.special.url))
(#any-of? @_attr "href" "src"))

View File

@ -13,14 +13,27 @@
(#set! injection.language "markdown")
(#offset! @injection.content 0 3 0 -3))
; Inject comments
([
(line_comment)
(block_comment)
] @injection.content
(#set! injection.language "comment"))
; Inject regex in r"hello\bworld"
((prefixed_string_literal
prefix: (identifier) @_prefix) @injection.content
(#eq? @_prefix "r")
(#set! injection.language "regex")
(#offset! @injection.content 0 2 0 -1))
; Inject markdown in md"**Bold** and _Italics_"
((prefixed_string_literal
prefix: (identifier) @_prefix) @injection.content
(#eq? @_prefix "md")
(#set! injection.language "markdown")
(#offset! @injection.content 0 3 0 -1))
; Inject bash in `git add --help`
((command_literal) @injection.content
(#set! injection.language "bash"))

View File

@ -101,7 +101,7 @@
; Fallback highlighting for recipe bodies
(recipe
(recipe_body) @string
(#set! "priority" 90))
(#set! priority 90))
; Ref: https://just.systems/man/en/chapter_26.html
;(setting (identifier) @error)

View File

@ -58,13 +58,13 @@
(node
(node_comment)
(#set! "priority" 105)) @comment
(#set! priority 105)) @comment
(node
(node_field
(node_field_comment)
(#set! "priority" 105)) @comment)
(#set! priority 105)) @comment)
(node_children
(node_children_comment)
(#set! "priority" 105)) @comment
(#set! priority 105)) @comment

View File

@ -73,6 +73,8 @@
(import_header
"import" @keyword.import)
(wildcard_import) @character.special
; The last `simple_identifier` in a `import_header` will always either be a function
; or a type. Classes can appear anywhere in the import path, unlike functions
(import_header

View File

@ -13,13 +13,13 @@
(function_declaration
.
(simple_identifier) @local.definition.function
(#set! "definition.function.scope" "parent"))
(#set! definition.function.scope "parent"))
(class_body
(function_declaration
.
(simple_identifier) @local.definition.method)
(#set! "definition.method.scope" "parent"))
(#set! definition.method.scope "parent"))
; Variables
(function_declaration
@ -52,11 +52,11 @@
; Types
(class_declaration
(type_identifier) @local.definition.type
(#set! "definition.type.scope" "parent"))
(#set! definition.type.scope "parent"))
(type_alias
(type_identifier) @local.definition.type
(#set! "definition.type.scope" "parent"))
(#set! definition.type.scope "parent"))
; Scopes
[

View File

@ -1,24 +1,29 @@
; General syntax
(command_name) @function
(text_mode
[
"\\text"
"\\intertext"
"\\shortintertext"
] @function)
(command_name) @function @nospell
(caption
command: _ @function)
; Turn spelling on for text
(text) @spell
; \text, \intertext, \shortintertext, ...
(text_mode
command: _ @function @nospell
content: (curly_group
(_) @none @spell))
; Variables, parameters
(placeholder) @variable
(key_value_pair
key: (_) @variable.parameter
key: (_) @variable.parameter @nospell
value: (_))
[
(brack_group)
(brack_group_argc)
] @variable.parameter
(curly_group_spec
(text) @variable.parameter)
(brack_group_argc) @variable.parameter
[
(operator)
@ -29,8 +34,13 @@
"\\item" @punctuation.special
((word) @punctuation.delimiter
(#eq? @punctuation.delimiter "&"))
(delimiter) @punctuation.delimiter
(math_delimiter
left_command: _ @punctuation.delimiter
left_delimiter: _ @punctuation.delimiter
right_command: _ @punctuation.delimiter
right_delimiter: _ @punctuation.delimiter)
[
"["
@ -43,46 +53,42 @@
(begin
command: _ @module
name: (curly_group_text
(text) @label))
(text) @label @nospell))
(end
command: _ @module
name: (curly_group_text
(text) @label))
(text) @label @nospell))
; Definitions and references
(new_command_definition
command: _ @function.macro
declaration: (curly_group_command_name
(_) @function))
command: _ @function.macro @nospell)
(old_command_definition
command: _ @function.macro
declaration: (_) @function)
command: _ @function.macro @nospell)
(let_command_definition
command: _ @function.macro
declaration: (_) @function)
command: _ @function.macro @nospell)
(environment_definition
command: _ @function.macro
command: _ @function.macro @nospell
name: (curly_group_text
(_) @markup.link))
(_) @label @nospell))
(theorem_definition
command: _ @function.macro
command: _ @function.macro @nospell
name: (curly_group_text_list
(_) @label))
(_) @label @nospell))
(paired_delimiter_definition
command: _ @function.macro
command: _ @function.macro @nospell
declaration: (curly_group_command_name
(_) @function))
(label_definition
command: _ @function.macro
name: (curly_group_text
(_) @markup.link))
(_) @markup.link @nospell))
(label_reference_range
command: _ @function.macro
@ -103,13 +109,18 @@
number: (_) @markup.link)
(citation
command: _ @function.macro
keys: (curly_group_text_list) @markup.link)
command: _ @function.macro @nospell
keys: (curly_group_text_list) @markup.link @nospell)
(hyperlink
command: _ @function @nospell
uri: (curly_group_uri
(_) @markup.link.url @nospell))
(glossary_entry_definition
command: _ @function.macro
command: _ @function.macro @nospell
name: (curly_group_text
(_) @markup.link))
(_) @markup.link @nospell))
(glossary_entry_reference
command: _ @function.macro
@ -117,9 +128,9 @@
(_) @markup.link))
(acronym_definition
command: _ @function.macro
command: _ @function.macro @nospell
name: (curly_group_text
(_) @markup.link))
(_) @markup.link @nospell))
(acronym_reference
command: _ @function.macro
@ -136,26 +147,6 @@
name: (curly_group_text
(_) @markup.link))
; Formatting
(text_mode
content: (curly_group
(_) @none @spell))
(math_environment
(begin
command: _ @markup.math
name: (curly_group_text
(_) @markup.math)))
(math_environment
(_) @markup.math)
(math_environment
(end
command: _ @markup.math
name: (curly_group_text
(_) @markup.math)))
; Sectioning
(title_declaration
command: _ @module
@ -231,20 +222,14 @@
((generic_command
command: (command_name) @_name
arg: (curly_group
(text) @markup.heading))
(_) @markup.heading))
(#eq? @_name "\\frametitle"))
((generic_command
command: (command_name) @_name
arg: (curly_group
(_) @markup.italic))
(#eq? @_name "\\emph"))
((generic_command
command: (command_name) @_name
arg: (curly_group
(_) @markup.italic))
(#any-of? @_name "\\textit" "\\mathit"))
(#any-of? @_name "\\emph" "\\textit" "\\mathit"))
((generic_command
command: (command_name) @_name
@ -252,13 +237,6 @@
(_) @markup.strong))
(#any-of? @_name "\\textbf" "\\mathbf"))
((generic_command
command: (command_name) @_name
.
arg: (curly_group
(_) @markup.link.url))
(#any-of? @_name "\\url" "\\href"))
; File inclusion commands
(class_include
command: _ @keyword.import
@ -270,12 +248,16 @@
(latex_include
command: _ @keyword.import
path: (curly_group_path) @string)
path: (curly_group_path) @string.special.path)
(verbatim_include
command: _ @keyword.import
path: (curly_group_path) @string.special.path)
(import_include
command: _ @keyword.import
directory: (curly_group_path) @string
file: (curly_group_path) @string)
directory: (curly_group_path) @string.special.path
file: (curly_group_path) @string.special.path)
(bibstyle_include
command: _ @keyword.import
@ -283,7 +265,7 @@
(bibtex_include
command: _ @keyword.import
paths: (curly_group_path_list) @string)
paths: (curly_group_path_list) @string.special.path)
(biblatex_include
"\\addbibresource" @keyword.import
@ -291,41 +273,53 @@
(graphics_include
command: _ @keyword.import
path: (curly_group_path) @string)
path: (curly_group_path) @string.special.path)
(svg_include
command: _ @keyword.import
path: (curly_group_path) @string.special.path)
(inkscape_include
command: _ @keyword.import
path: (curly_group_path) @string.special.path)
(tikz_library_import
command: _ @keyword.import
paths: (curly_group_path_list) @string)
(text) @spell
(inline_formula) @nospell
(displayed_equation) @nospell
(key_value_pair) @nospell
(generic_environment
begin: _ @nospell
end: _ @nospell)
(citation
keys: _ @nospell)
(command_name) @nospell
(label_definition) @nospell
(label_reference) @nospell
(label_reference_range) @nospell
; Turn spelling off for whole nodes
[
(label_reference)
(label_reference_range)
(label_number)
(glossary_entry_reference)
(acronym_reference)
(color_definition)
(color_reference)
(class_include)
(package_include)
(latex_include)
(verbatim_include)
(import_include)
(bibstyle_include)
(bibtex_include)
(biblatex_include)
(graphics_include)
(svg_include)
(inkscape_include)
(tikz_library_import)
] @nospell
; Math
[
(displayed_equation)
(inline_formula)
] @markup.math
] @markup.math @nospell
(math_environment
(_) @markup.math)
; Comments
[
(line_comment)
(block_comment)

View File

@ -17,15 +17,20 @@
code: (source_code) @injection.content
(#set! injection.language "python"))
(luacode_environment
code: (source_code) @injection.content
(#set! injection.language "lua"))
(asy_environment
code: (source_code) @injection.content
(#set! injection.language "c"))
(asydef_environment
code: (source_code) @injection.content
(#set! injection.language "c"))
(minted_environment
(begin
language: (curly_group_text
(text) @injection.language))
(source_code) @injection.content)
((generic_environment
(begin
name: (curly_group_text
(text) @_env))) @injection.content
(#set! injection.language "c")
(#any-of? @_env "asy" "asydef"))

View File

@ -181,7 +181,7 @@
(address_literal)
(signature_literal)
((affine_group_literal)
(#set! "priority" 101))
(#set! priority 101))
(field_literal)
(product_group_literal)
(scalar_literal)

View File

@ -59,9 +59,9 @@
(#set! priority 110))
([
"break"
(break_statement)
(continue_statement)
"by"
"continue"
"cycle"
"endfor"
"endpaginate"

View File

@ -162,7 +162,7 @@
; Tables
(field
name: (identifier) @variable.member)
name: (identifier) @property)
(dot_index_expression
field: (identifier) @variable.member)

View File

@ -16,10 +16,12 @@
[
"end"
")"
"}"
] @indent.end
(")" @indent.end
(#not-has-parent? @indent.end parameters))
(return_statement
(expression_list
(function_call))) @indent.dedent
@ -39,3 +41,6 @@
(comment) @indent.auto
(string) @indent.auto
(ERROR
"function") @indent.begin

View File

@ -121,7 +121,7 @@
"["
"]"
] @type)
(#set! "priority" 105))
(#set! priority 105))
(type) @type

View File

@ -32,7 +32,11 @@
(negated_set
(character) @constant)
(class) @keyword
(class) @string.escape
(class
"%" @string.regexp
(escape_char) @string.regexp)
(negated_set
"^" @operator)

View File

@ -45,7 +45,7 @@
(indented_code_block) @markup.raw.block
((fenced_code_block) @markup.raw.block
(#set! "priority" 90))
(#set! priority 90))
(fenced_code_block
(fenced_code_block_delimiter) @markup.raw.block
@ -103,13 +103,13 @@
(task_list_marker_checked) @markup.list.checked
((block_quote) @markup.quote
(#set! "priority" 90))
(#set! priority 90))
([
(plus_metadata)
(minus_metadata)
] @keyword.directive
(#set! "priority" 90))
(#set! priority 90))
[
(block_continuation)

View File

@ -43,7 +43,7 @@
(inline_link
(link_text) @_label
(link_destination) @_url
(#set! @_label "url" @_url))
(#set! @_label url @_url))
; Conceal image links
(image
@ -88,6 +88,13 @@
(email_autolink)
] @markup.link.url @nospell
((link_destination) @_url
(#set! @_url url @_url))
((uri_autolink) @_url
(#offset! @_url 0 1 0 -1)
(#set! @_url url @_url))
(entity_reference) @nospell
; Replace common HTML entities.

View File

@ -4,7 +4,7 @@
; =============================================================================
; catch all rules
((identifier) @variable
(#set! "priority" 99))
(#set! priority 99))
; NOTE: we need priority, since (identifier) is most specific and we have to
; capture nodes containing (identifier) as a whole, while overruling the
@ -12,7 +12,7 @@
(type_expression) @type
; NOTE: has to be after
; ((identifier) @variable (#set! "priority" 99))
; ((identifier) @variable (#set! priority 99))
; overrule identifiers in pragmas in (proc_type)s and (pragma_expression)s
(proc_type
pragmas: (pragma_list) @variable)

View File

@ -33,7 +33,7 @@
(exported_symbol
(accent_quoted) @local.definition.function)
]
(#set! "definition.function.scope" "parent"))
(#set! definition.function.scope "parent"))
(func_declaration
name: [
@ -44,7 +44,7 @@
(exported_symbol
(accent_quoted) @local.definition.function)
]
(#set! "definition.function.scope" "parent"))
(#set! definition.function.scope "parent"))
(iterator_declaration
name: [
@ -55,7 +55,7 @@
(exported_symbol
(accent_quoted) @local.definition.function)
]
(#set! "definition.function.scope" "parent"))
(#set! definition.function.scope "parent"))
(converter_declaration
name: [
@ -66,7 +66,7 @@
(exported_symbol
(accent_quoted) @local.definition.function)
]
(#set! "definition.function.scope" "parent"))
(#set! definition.function.scope "parent"))
; ==============================================================================
; @local.definition.method ; methods
@ -79,7 +79,7 @@
(exported_symbol
(accent_quoted) @local.definition.method)
]
(#set! "definition.method.scope" "parent"))
(#set! definition.method.scope "parent"))
; ==============================================================================
; @local.definition.var ; variables
@ -193,7 +193,7 @@
(exported_symbol
(accent_quoted) @local.definition.macro)
]
(#set! "definition.macro.scope" "parent"))
(#set! definition.macro.scope "parent"))
(macro_declaration
name: [
@ -204,7 +204,7 @@
(exported_symbol
(accent_quoted) @local.definition.macro)
]
(#set! "definition.macro.scope" "parent"))
(#set! definition.macro.scope "parent"))
; ==============================================================================
; @local.definition.type ; types or classes

View File

@ -89,7 +89,7 @@
;----------
; Don't let normal parens take priority over this
((unit) @constant.builtin
(#set! "priority" 105))
(#set! priority 105))
(boolean) @boolean

View File

@ -64,7 +64,7 @@
"else"
"when"
] @keyword.conditional.ternary)
(#set! "priority" 105))
(#set! priority 105))
; Repeats
[

View File

@ -270,4 +270,4 @@
")"
] @punctuation.bracket
; priority hack so nvim + ts-cli behave the same
(#set! "priority" 90))
(#set! priority 90))

View File

@ -40,6 +40,12 @@
(compound_statement
"}" @indent.end)
(declaration_list
"}" @indent.end)
(enum_declaration_list
"}" @indent.end)
(return_statement
";" @indent.end)

View File

@ -8,7 +8,7 @@
((command_paragraph
(command) @keyword
(content) @string)
(#set! "priority" 99))
(#set! priority 99))
(command_paragraph
(command) @keyword

View File

@ -133,7 +133,7 @@
((ffi_method
(string) @string.special)
(#set! "priority" 105))
(#set! priority 105))
(call_expression
callee: [

View File

@ -59,7 +59,7 @@
; Decorators
((decorator
"@" @attribute)
(#set! "priority" 101))
(#set! priority 101))
(decorator
(identifier) @attribute)
@ -199,46 +199,27 @@
] @string.escape
; doc-strings
(module
.
(comment)*
.
(expression_statement
(string) @string.documentation))
(class_definition
body: (block
.
(expression_statement
(string) @string.documentation)))
(function_definition
body: (block
.
(expression_statement
(string) @string.documentation)))
(module
.
(comment)*
.
(expression_statement
(string
(string_content) @spell)))
(string_content) @spell) @string.documentation))
(class_definition
body: (block
.
(expression_statement
(string
(string_content) @spell))))
(string_content) @spell) @string.documentation)))
(function_definition
body: (block
.
(expression_statement
(string
(string_content) @spell))))
(string_content) @spell) @string.documentation)))
; Tokens
[
@ -339,6 +320,9 @@
(aliased_import
"as" @keyword.import)
(wildcard_import
"*" @character.special)
[
"if"
"elif"

View File

@ -1,6 +1,5 @@
[
(import_from_statement)
(parenthesized_expression)
(generator_expression)
(list_comprehension)
(set_comprehension)
@ -24,6 +23,10 @@
(#set! indent.open_delimiter "{")
(#set! indent.close_delimiter "}"))
((parenthesized_expression) @indent.align
(#set! indent.open_delimiter "(")
(#set! indent.close_delimiter ")"))
((for_statement) @indent.begin
(#set! indent.immediate 1))
@ -67,14 +70,40 @@
((case_clause) @indent.begin
(#set! indent.immediate 1))
; if (cond1
; or cond2
; or cond3):
; pass
;
(if_statement
condition: (parenthesized_expression) @indent.align
(#lua-match? @indent.align "^%([^\n]")
(#set! indent.open_delimiter "(")
(#set! indent.close_delimiter ")")
(#set! indent.avoid_last_matching_next 1))
; while (
; cond1
; or cond2
; or cond3):
; pass
;
(while_statement
condition: (parenthesized_expression) @indent.align
(#lua-match? @indent.align "[^\n ]%)$")
(#set! indent.open_delimiter "(")
(#set! indent.close_delimiter ")")
(#set! indent.avoid_last_matching_next 1))
; if (
; cond1
; or cond2
; or cond3):
; pass
;
(if_statement
condition: (parenthesized_expression) @indent.align
(#lua-match? @indent.align "[^\n ]%)$")
(#set! indent.open_delimiter "(")
(#set! indent.close_delimiter ")")
(#set! indent.avoid_last_matching_next 1))
@ -91,6 +120,11 @@
(#set! indent.close_delimiter ")"))
((parameters) @indent.align
(#set! indent.open_delimiter "(")
(#set! indent.close_delimiter ")"))
((parameters) @indent.align
(#lua-match? @indent.align "[^\n ]%)$")
(#set! indent.open_delimiter "(")
(#set! indent.close_delimiter ")")
(#set! indent.avoid_last_matching_next 1))
@ -130,9 +164,6 @@
.
(#lua-match? @indent.branch "^elif"))
(parenthesized_expression
")" @indent.end)
(generator_expression
")" @indent.end)

View File

@ -12,7 +12,7 @@
name: (identifier) @variable)
(field_definition
name: (identifier) @property)
name: (identifier) @variable.member)
(negated_field
"!" @operator
@ -63,6 +63,15 @@
((comment) @keyword.directive @nospell
(#lua-match? @keyword.directive "^;+%s*format%-ignore%s*$"))
((predicate
name: (identifier) @_name
parameters: (parameters
.
(capture)?
.
(identifier) @property))
(#eq? @_name "set"))
((predicate
name: (identifier) @_name
parameters: (parameters

View File

@ -12,7 +12,12 @@
"]" @indent.branch @indent.end
")" @indent.end
[
")"
"?"
"*"
"+"
] @indent.end
; Captures always mark the end of a node
; Because of that, mark it as indent.end

View File

@ -1,28 +1,28 @@
((predicate
name: (identifier) @_name
parameters: (parameters
(string) @injection.content))
(string
(string_content) @injection.content)))
(#any-of? @_name "match" "not-match" "any-match" "vim-match" "not-vim-match" "any-vim-match")
(#set! injection.language "regex")
(#offset! @injection.content 0 1 0 -1))
(#set! injection.language "regex"))
((predicate
name: (identifier) @_name
parameters: (parameters
(string) @injection.content))
(string
(string_content) @injection.content)))
(#any-of? @_name "lua-match" "not-lua-match" "any-lua-match")
(#set! injection.language "luap")
(#offset! @injection.content 0 1 0 -1))
(#set! injection.language "luap"))
((predicate
name: (identifier) @_name
parameters: (parameters
(string) @injection.content
(string
(string_content) @injection.content)
.
(string) .))
(#any-of? @_name "gsub" "not-gsub")
(#set! injection.language "luap")
(#offset! @injection.content 0 1 0 -1))
(#set! injection.language "luap"))
((comment) @injection.content
(#set! injection.language "comment"))

View File

@ -1,4 +1,3 @@
; highlights.scm
; Literals
(integer) @number
@ -9,8 +8,10 @@
(string) @string
(string
(escape_sequence) @string.escape)
(string_content
(escape_sequence) @string.escape))
; Comments
(comment) @comment @spell
((program
@ -18,116 +19,109 @@
(comment) @keyword.directive @nospell)
(#lua-match? @keyword.directive "^#!/"))
(identifier) @variable
((dollar
(identifier) @variable.builtin)
(#eq? @variable.builtin "self"))
(dollar
_
(identifier) @variable.member)
; Parameters
(formal_parameters
(identifier) @variable.parameter)
(formal_parameters
(default_parameter
name: (identifier) @variable.parameter))
(default_argument
name: (identifier) @variable.parameter)
; Namespace
(namespace_get
namespace: (identifier) @module)
(namespace_get_internal
namespace: (identifier) @module)
; Operators
[
"?"
":="
"="
"<-"
"<<-"
"->"
] @operator
(unary
operator: [
"-"
"+"
"!"
"~"
"?"
] @operator)
(binary
operator: [
"-"
"+"
"*"
"/"
"^"
"<"
">"
"<="
">="
"=="
"!="
"||"
"|"
"&&"
"&"
":"
"~"
] @operator)
[
"->>"
"~"
"|>"
(special)
"||"
"|"
"&&"
"&"
"<"
"<="
">"
">="
"=="
"!="
"+"
"-"
"*"
"/"
"::"
":::"
"**"
"^"
"$"
"@"
":"
"!"
"special"
] @operator
(lambda_function
"\\" @operator)
; Punctuation
[
"("
")"
"["
"]"
"{"
"}"
"["
"]"
"[["
"]]"
] @punctuation.bracket
"," @punctuation.delimiter
(comma) @punctuation.delimiter
(dollar
_
"$" @operator)
; Variables
(identifier) @variable
(subset2
"[[" @punctuation.bracket
"]]" @punctuation.bracket)
; Functions
(binary_operator
lhs: (identifier) @function
operator: "<-"
rhs: (function_definition))
[
(dots)
(break)
(next)
] @keyword
(binary_operator
lhs: (identifier) @function
operator: "="
rhs: (function_definition))
[
(nan)
(na)
(null)
(inf)
] @constant.builtin
; Calls
(call
function: (identifier) @function.call)
(extract_operator
rhs: (identifier) @variable.member)
function: (extract_operator
rhs: (identifier) @function.method.call)
; Parameters
(parameters
(parameter
name: (identifier) @variable.parameter))
(arguments
(argument
name: (identifier) @variable.parameter))
; Namespace
(namespace_operator
lhs: (identifier) @module)
(call
function: (namespace_operator
rhs: (identifier) @function))
; Keywords
(function_definition
name: "function" @keyword.function)
(function_definition
name: "\\" @operator)
(return) @keyword.return
[
"if"
"else"
"switch"
] @keyword.conditional
[
@ -135,6 +129,8 @@
"repeat"
"for"
"in"
(break)
(next)
] @keyword.repeat
[
@ -142,21 +138,11 @@
(false)
] @boolean
"function" @keyword.function
; Functions/Methods
(call
function: (identifier) @function.call)
(call
(namespace_get
function: (identifier) @function.call))
(call
(namespace_get_internal
function: (identifier) @function.call))
(call
function: (dollar
_
(identifier) @function.method.call))
[
(null)
(inf)
(nan)
(na)
(dots)
(dot_dot_i)
] @constant.builtin

View File

@ -1,10 +1,7 @@
[
(brace_list)
(paren_list)
(special)
(pipe)
(braced_expression)
(parenthesized_expression)
(call)
"|>"
"if"
"else"
"while"
@ -12,16 +9,19 @@
"for"
] @indent.begin
(binary
operator: (special)) @indent.begin
(binary_operator
rhs: (_) @_no_indent
(#not-kind-eq? @_no_indent function_definition)) @indent.begin
[
"}"
")"
] @indent.branch
((formal_parameters
(identifier)) @indent.align
((parameters
.
(parameter
name: (identifier))) @indent.align
(#set! indent.open_delimiter "(")
(#set! indent.close_delimiter ")"))

View File

@ -1,16 +1,22 @@
; locals.scm
(function_definition) @local.scope
(formal_parameters
(identifier) @local.definition.parameter)
(left_assignment
(argument
name: (identifier) @local.definition)
(equals_assignment
(parameter
name: (identifier) @local.definition)
(right_assignment
name: (identifier) @local.definition)
(binary_operator
lhs: (identifier) @local.definition
operator: "<-")
(binary_operator
lhs: (identifier) @local.definition
operator: "=")
(binary_operator
operator: "->"
rhs: (identifier) @local.definition)
(identifier) @local.reference

View File

@ -674,12 +674,12 @@
.
(symbol) @keyword.import
(#eq? @keyword.import "require")
(#set! "priority" 101))
(#set! priority 101))
(quote
.
(symbol)
(#set! "priority" 105)) @string.special.symbol
(#set! priority 105)) @string.special.symbol
((sexp_comment) @comment
(#set! "priority" 110))
(#set! priority 110))

View File

@ -71,9 +71,6 @@
"ensure"
] @keyword.exception
((identifier) @keyword.exception
(#any-of? @keyword.exception "fail" "raise"))
; Function calls
"defined?" @function
@ -127,6 +124,14 @@
(#any-of? @constant.builtin
"__callee__" "__dir__" "__id__" "__method__" "__send__" "__ENCODING__" "__FILE__" "__LINE__"))
((identifier) @function.builtin
(#any-of? @function.builtin
"include" "extend" "prepend" "attr_reader" "attr_writer" "attr_accessor" "module_function"
"refine" "using"))
((identifier) @keyword.exception
(#any-of? @keyword.exception "raise" "fail" "catch" "throw"))
((constant) @type
(#not-lua-match? @type "^[A-Z0-9_]+$"))
@ -270,6 +275,7 @@
","
";"
"."
"&."
] @punctuation.delimiter
[

View File

@ -382,6 +382,9 @@
"||"
] @operator
(use_wildcard
"*" @character.special)
; Punctuation
[
"("

View File

@ -213,7 +213,11 @@
(wildcard) @variable.parameter
(namespace_wildcard) @punctuation.special
(namespace_wildcard
[
"*"
"_"
] @character.special)
(annotation) @attribute

View File

@ -20,7 +20,7 @@
(comment)
(directive)
] @comment
(#set! "priority" 105))
(#set! priority 105))
(escape_sequence) @string.escape

View File

@ -51,7 +51,7 @@
(trait_statement
(shape_id
(#set! "priority" 105)) @attribute)
(#set! priority 105)) @attribute)
; Operators
[

View File

@ -44,7 +44,8 @@
; Wildcard names
(wildcard
(identifier) @variable)
(identifier) @variable
(flag) @variable.parameter.builtin)
; builtin variables
((identifier) @variable.builtin

View File

@ -4,11 +4,11 @@
((sub_select
(select_clause
(var) @local.definition.var))
(#set! "definition.var.scope" "parent"))
(#set! definition.var.scope "parent"))
((select_query
(select_clause
(var) @local.definition.var))
(#set! "definition.var.scope" "parent"))
(#set! definition.var.scope "parent"))
(var) @local.reference

View File

@ -104,7 +104,7 @@
"="
":"
])
(#set! "priority" 105))
(#set! priority 105))
; Types
((identifier) @type

View File

@ -40,7 +40,7 @@
; Decorators
((decorator
"@" @attribute)
(#set! "priority" 101))
(#set! priority 101))
(decorator
(identifier) @attribute)

View File

@ -1,2 +1,2 @@
((comment) @injection.language
(#set! @injection.language "comment"))
((comment) @injection.content
(#set! injection.language "comment"))

View File

@ -9,7 +9,7 @@
; Definitions
(argument
name: (identifier) @local.definition.parameter
(#set! "definition.var.scope" "local"))
(#set! definition.var.scope "local"))
(variable_definition
name: (variable
@ -20,10 +20,10 @@
name: (variable
(environment_var
(identifier) @local.definition.var))
(#set! "definition.var.scope" "global"))
(#set! definition.var.scope "global"))
(function_definition
name: (variable) @local.definition.var
(#set! "definition.var.scope" "parent"))
(#set! definition.var.scope "parent"))
(identifier) @local.reference

View File

@ -98,7 +98,7 @@
(bang_operator)
(cond_operator)
] @function
(#set! "priority" 105))
(#set! priority 105))
; Operators
[

View File

@ -1,6 +1,6 @@
[
; import …
(import_statement)+
(import)+
; (…, …)
(parameter_list)
(argument_list)

View File

@ -108,7 +108,7 @@
; string.special.path
; -------------------
(import_statement
(import
library: (string) @string.special.path)
; boolean
@ -117,7 +117,10 @@
; constant
; --------
(constant
(global_constant
name: (identifier) @constant)
(storage_constant
name: (identifier) @constant)
; constant.builtin
@ -142,17 +145,12 @@
(field_access_expression
name: (identifier) @variable.member)
(trait_body
(constant
name: (identifier) @variable.member))
(contract_body
(constant
name: (identifier) @variable.member))
(field
name: (identifier) @variable.member)
(storage_variable
name: (identifier) @variable.member)
; number
; ------
(integer) @number
@ -248,7 +246,7 @@
(native_function
name: (identifier) @function)
(static_function
(global_function
name: (identifier) @function)
(func_identifier) @function
@ -267,7 +265,7 @@
(external_function
"external" @function.method)
(function
(storage_function
name: (identifier) @function.method)
; function.call
@ -289,19 +287,19 @@
"contractAddress" "contractAddressExt" "emit" "cell" "ton" "dump" "dumpStack" "beginString"
"beginComment" "beginTailString" "beginStringFromBuilder" "beginCell" "emptyCell" "randomInt"
"random" "checkSignature" "checkDataSignature" "sha256" "min" "max" "abs" "pow" "pow2" "throw"
"nativeThrowWhen" "nativeThrowUnless" "getConfigParam" "nativeRandomize" "nativeRandomizeLt"
"nativeThrowIf" "nativeThrowUnless" "getConfigParam" "nativeRandomize" "nativeRandomizeLt"
"nativePrepareRandom" "nativeRandom" "nativeRandomInterval" "nativeReserve"))
; comment
; -------
(comment) @comment @spell
((comment) @comment.documentation
(#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$"))
; attribute
; ---------
[
"@name"
"@interface"
] @attribute
; comment
; -------
(comment) @comment @spell
((comment) @comment.documentation
(#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$"))

View File

@ -1,12 +1,12 @@
; Scopes @local.scope
; -------------------------
[
(static_function)
(global_function)
(init_function)
(bounced_function)
(receive_function)
(external_function)
(function)
(storage_function)
(block_statement)
] @local.scope
@ -17,11 +17,14 @@
name: (identifier) @local.definition.var)
; constants
(constant
(global_constant
name: (identifier) @local.definition.constant)
(storage_constant
name: (identifier) @local.definition.constant)
; functions
(static_function
(global_function
name: (identifier) @local.definition.function
(#set! definition.var.scope parent))
@ -42,7 +45,7 @@
"external" @local.definition.method
(#set! definition.var.scope parent))
(function
(storage_function
name: (identifier) @local.definition.method
(#set! definition.var.scope parent))
@ -53,12 +56,12 @@
; user-defined types (structs and messages)
(type_identifier) @local.definition.type
; fields (and properties)
; fields (of messages and structs)
(field
name: (identifier) @local.definition.field)
; imports
(import_statement
(import
(string) @local.definition.import)
; References @local.reference

View File

@ -16,8 +16,8 @@
(expr)
(arguments)
] @indent.align
(#set! "indent.open_delimiter" "{")
(#set! "indent.close_delimiter" "}"))
(#set! indent.open_delimiter "{")
(#set! indent.close_delimiter "}"))
[
"}"

View File

@ -1,6 +1,6 @@
; Variables
((identifier) @variable
(#set! "priority" 95))
(#set! priority 95))
; Includes
[

View File

@ -14,22 +14,22 @@
; Definitions {{{
(type_declaration
name: (identifier) @local.definition.type
(#set! "definition.var.scope" "parent"))
(#set! definition.var.scope "parent"))
(parameters
name: (identifier) @local.definition.parameter)
(function_declaration
name: (identifier) @local.definition.function
(#set! "definition.var.scope" "parent"))
(#set! definition.var.scope "parent"))
(primitive_declaration
name: (identifier) @local.definition.function
(#set! "definition.var.scope" "parent"))
(#set! definition.var.scope "parent"))
(variable_declaration
name: (identifier) @local.definition.var
(#set! "definition.var.scope" "parent"))
(#set! definition.var.scope "parent"))
; }}}
; References {{{

View File

@ -86,7 +86,7 @@
"or"
"procedure"
"process"
"skip"
(pcal_skip)
"variable"
"variables"
"when"
@ -119,7 +119,7 @@
(pcal_end_with)
] @keyword.repeat
"return" @keyword.return
(pcal_return) @keyword.return
"print" @function.macro

View File

@ -30,14 +30,14 @@
(function_definition
name: (identifier) @local.definition.function
(#set! "definition.function.scope" "parent"))
(#set! definition.function.scope "parent"))
(lambda
(identifier) @local.definition.parameter)
(module_definition
name: (_) @local.definition.import
(#set! "definition.import.scope" "parent"))
(#set! definition.import.scope "parent"))
(module_definition
parameter: (identifier) @local.definition.parameter)
@ -48,7 +48,7 @@
(operator_definition
name: (_) @local.definition.macro
(#set! "definition.macro.scope" "parent"))
(#set! definition.macro.scope "parent"))
(operator_definition
parameter: (identifier) @local.definition.parameter)
@ -97,7 +97,7 @@
(theorem
name: (identifier) @local.definition.constant
(#set! "definition.constant.scope" "parent"))
(#set! definition.constant.scope "parent"))
; PlusCal scopes and definitions
[

View File

@ -1,4 +1,5 @@
[
(statement)
(directive)
(triple)
(blank_node_property_list)
] @fold

View File

@ -1,5 +1,6 @@
[
(statement)
(directive)
(triple)
(blank_node_property_list)
(collection)
] @indent.begin

View File

@ -1,4 +1,4 @@
(turtle_doc) @local.scope
(document) @local.scope
(subject
[

View File

@ -10,12 +10,12 @@
((fmt_sub
.
_ @character.special)
(#set! "priority" 101))
(#set! priority 101))
((var_sub
.
_ @variable.builtin)
(#set! "priority" 101))
(#set! priority 101))
[
(system_const)
@ -26,24 +26,24 @@
] @attribute
((attribute) @attribute
(#set! "priority" 101))
(#set! priority 101))
((env_var) @constant
(#set! "priority" 101))
(#set! priority 101))
((pattern) @string.special
(#set! "priority" 101))
(#set! priority 101))
([
"\\\""
(c_escape)
] @string.escape
(#set! "priority" 101))
(#set! priority 101))
(octal) @number
((number) @number
(#set! "priority" 101))
(#set! priority 101))
[
(match_op)
@ -51,13 +51,13 @@
] @operator
("+" @punctuation.special
(#set! "priority" 101))
(#set! priority 101))
([
"{"
"}"
] @punctuation.bracket
(#set! "priority" 101))
(#set! priority 101))
[
","

View File

@ -1,3 +1,5 @@
(shebang) @keyword.directive
; Includes
[
"import"
@ -290,6 +292,7 @@
(_
(line_comment)+ @comment.documentation
.
[
(function_declaration)
(type_declaration)

View File

@ -22,7 +22,6 @@
"localparam"
"defparam"
"assign"
"typedef"
"modport"
"fork"
"join"
@ -44,6 +43,7 @@
"enum"
"struct"
"union"
"typedef"
] @keyword.type
[
@ -96,9 +96,6 @@
(package_identifier
(simple_identifier) @constant))
(parameter_port_list
"#" @constructor)
[
"="
"-"
@ -110,12 +107,9 @@
"|"
"&&"
"||"
":"
"{"
"}"
"'{"
"<="
"@"
"@*"
"=="
"!="
"==="
@ -130,8 +124,12 @@
"|="
(unary_operator)
(inc_or_dec_operator)
"#"
] @operator
(parameter_port_list
"#" @constructor)
[
"or"
"and"
@ -160,6 +158,8 @@
[
"signed"
"unsigned"
"input"
"output"
] @keyword.modifier
(data_type
@ -197,10 +197,17 @@
[
";"
"::"
":"
","
"."
] @punctuation.delimiter
(conditional_expression
[
"?"
":"
] @keyword.conditional.ternary)
(default_nettype_compiler_directive
(default_nettype_value) @string)
@ -223,7 +230,7 @@
(unbased_unsized_literal)
] @number
(time_unit) @attribute
(time_unit) @type.builtin
(checker_instantiation
(checker_identifier
@ -307,4 +314,7 @@
"]"
"("
")"
"{"
"}"
"'{"
] @punctuation.bracket

View File

@ -41,7 +41,7 @@
text: (_) @markup.raw)
((codeblock) @markup.raw.block
(#set! "priority" 90))
(#set! priority 90))
(codeblock
">" @markup.raw
@ -59,7 +59,8 @@
(keycode) @string.special
(url) @string.special.url
((url) @string.special.url
(#set! @string.special.url url @string.special.url))
(modeline) @keyword.directive

View File

@ -4,7 +4,7 @@
(id)) @type
(package_decl
(id)) @module
(id) @module)
(valid_semver) @string.special
@ -38,7 +38,7 @@
alias: (id) @type.definition)
(func_item
name: (id) @function)
name: (id) @function.method)
(handle
(id) @type)
@ -62,29 +62,38 @@
name: (id) @type)
(variant_case
name: (id) @type)
name: (id) @constant)
(enum_items
name: (id) @type)
(enum_body
enum_cases: (id) @constant)
(enum_case
name: (id) @constant)
(resource_item
name: (id) @type)
(resource_method
(id) @function.method)
(resource_method
"constructor" @constructor)
(toplevel_use_item
"use" @keyword.import)
(toplevel_use_item
alias: (id) @module)
(use_item
"use" @keyword.import)
(use_path
(id) @module)
(use_names_item
(id) @module)
"func" @keyword.function
[
@ -105,6 +114,7 @@
"include"
"import"
"export"
"as"
] @keyword.import
[
@ -118,6 +128,8 @@
"s64"
"f32"
"f64"
"float32" ; deprecated
"float64" ; deprecated
"char"
"bool"
"string"
@ -130,7 +142,7 @@
[
"@"
"->"
"_"
] @punctuation.special
[
@ -138,6 +150,8 @@
";"
":"
","
"."
"->"
] @punctuation.delimiter
[
@ -145,6 +159,8 @@
"}"
"("
")"
">"
"<"
] @punctuation.bracket
"=" @operator

View File

@ -54,7 +54,7 @@
(CDStart) @module
(CData) @markup.raw
"]]>" @module)
(#set! "priority" 105))
(#set! priority 105))
; Delimiters & punctuation
[

View File

@ -7,7 +7,7 @@
(single_quote_scalar) @string
((block_scalar) @string
(#set! "priority" 99))
(#set! priority 99))
(string_scalar) @string

View File

@ -52,13 +52,13 @@ exception: "!" @keyword.exception
(PtrTypeStart
"c" @variable.builtin)
((ContainerDeclType
[
(ErrorUnionExpr)
"enum"
])
(ContainerDecl
(ContainerDeclType
"enum")
(ContainerField
(IDENTIFIER) @constant))
(ErrorUnionExpr
(SuffixExpr
(IDENTIFIER) @constant))))
field_constant: (IDENTIFIER) @constant
@ -190,6 +190,7 @@ field_constant: (IDENTIFIER) @constant
(AssignOp)
(MultiplyOp)
(PrefixOp)
"="
"*"
"**"
"->"
@ -229,6 +230,9 @@ field_constant: (IDENTIFIER) @constant
(PtrIndexPayload
"|" @punctuation.bracket)
(PtrListPayload
"|" @punctuation.bracket)
(ParamType
(ErrorUnionExpr
(SuffixExpr