1

Update generated neovim config

This commit is contained in:
2024-08-15 14:28:54 +02:00
parent 07409c223d
commit 25cfcf2941
3809 changed files with 351157 additions and 0 deletions

View File

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

View File

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

View File

@ -0,0 +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

@ -0,0 +1,5 @@
([
(line_comment)
(block_comment)
] @injection.content
(#set! injection.language "comment"))

View File

@ -0,0 +1,66 @@
; General
(label
[
(ident)
(word)
] @label)
(reg) @variable.builtin
(meta
kind: (_) @function.builtin)
(instruction
kind: (_) @function.builtin)
(const
name: (word) @constant)
; Comments
[
(line_comment)
(block_comment)
] @comment @spell
; Literals
(int) @number
(float) @number.float
(string) @string
; Keywords
[
"byte"
"word"
"dword"
"qword"
"ptr"
"rel"
"label"
"const"
] @keyword
; Operators & Punctuation
[
"+"
"-"
"*"
"/"
"%"
"|"
"^"
"&"
] @operator
[
"("
")"
"["
"]"
] @punctuation.bracket
[
","
":"
] @punctuation.delimiter

View File

@ -0,0 +1,5 @@
([
(line_comment)
(block_comment)
] @injection.content
(#set! injection.language "comment"))

View File

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

View File

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

View File

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

View File

@ -0,0 +1,6 @@
[
(list_expression)
(map_expression)
(module)
(select_expression)
] @fold

View File

@ -0,0 +1,56 @@
(comment) @comment @spell
(operator) @operator
(integer_literal
"-" @operator)
[
","
":"
] @punctuation.delimiter
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket
(boolean_literal) @boolean
(integer_literal) @number
[
(raw_string_literal)
(interpreted_string_literal)
] @string
(escape_sequence) @string.escape
(identifier) @variable
(module
type: (identifier) @function.call)
(module
(property
field: (identifier) @variable.parameter))
[
(unset)
(default)
(any)
] @variable.builtin
(condition
name: (identifier) @function.builtin)
(map_expression
(property
field: (identifier) @property))
(select_expression
"select" @keyword.conditional)

View File

@ -0,0 +1,38 @@
(list_expression) @indent.begin
(list_expression
"]" @indent.branch)
(map_expression) @indent.begin
(map_expression
"}" @indent.branch)
(select_expression) @indent.begin
(select_expression
")" @indent.branch)
(select_value) @indent.begin
(select_value
")" @indent.branch)
(select_pattern
"(" @indent.begin)
(select_pattern
")" @indent.branch)
(select_cases) @indent.begin
(select_cases
"}" @indent.branch)
(module) @indent.begin
(module
")" @indent.branch)
(module
"}" @indent.branch)

View File

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

View File

@ -0,0 +1,15 @@
(module
(property
field: (identifier) @local.definition.parameter))
(map_expression
(property
field: (identifier) @local.definition.field))
(assignment
left: (identifier) @local.definition.var)
(pattern_binding
binding: (identifier) @local.definition.var)
(identifier) @local.reference

View File

@ -0,0 +1,5 @@
([
(bracket_comment)
(line_comment)
] @injection.content
(#set! injection.language "comment"))

View File

@ -0,0 +1,5 @@
([
(comment)
(block_comment)
] @injection.content
(#set! injection.language "comment"))

View File

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

View File

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

View File

@ -0,0 +1,79 @@
; Scopes
[
(source_file)
(block_statement)
(aggregate_body)
] @local.scope
; References
(identifier) @local.reference
; Definitions
(module_def
(module_declaration
(module_fqn) @local.definition.namespace)
(#set! "definition.namespace.scope" "global"))
(enum_declaration
(enum_member
.
(identifier) @local.definition.enum))
(class_declaration
(class)
.
(identifier) @local.definition.type)
(struct_declaration
(struct)
.
(identifier) @local.definition.type)
(union_declaration
(union)
.
(identifier) @local.definition.type)
(enum_declaration
(enum)
.
(identifier) @local.definition.type)
(alias_declaration
(alias_initializer
.
(identifier) @local.definition.type))
(constructor
(this) @local.definition.method)
(destructor
(this) @local.definition.method)
(postblit
(this) @local.definition.method)
(aggregate_body
(function_declaration
(identifier) @local.definition.method))
(manifest_declarator
.
(identifier) @local.definition.constant)
(anonymous_enum_declaration
(enum_member
.
(identifier) @local.definition.constant))
(variable_declaration
(declarator
(identifier) @local.definition.var))
(aggregate_body
(variable_declaration
(declarator
(identifier) @local.definition.field)))
(function_declaration
(identifier) @local.definition.function)

View File

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

View File

@ -0,0 +1,30 @@
(byte) @constant
[
(address)
(hexadecimal)
(integer)
] @number
(identifier) @variable
(bad_instruction) @comment.warning
(code_location
(identifier) @function.call)
(comment) @comment
(instruction) @function
(memory_dump) @string
[
"<"
">"
] @punctuation.special
[
"+"
":"
] @punctuation.delimiter

View File

@ -0,0 +1,6 @@
; TODO: https://github.com/nvim-treesitter/nvim-treesitter/pull/5548#issuecomment-1773707396
;
; To be added once a compatible Assembly parser is merged into nvim-treesitter
;
; ((instruction) @injection.content
; (#set! injection.language "asm"))

View File

@ -0,0 +1,7 @@
[
(section)
(code_block)
(raw_block)
(list)
(div)
] @fold

View File

@ -0,0 +1,396 @@
(heading1) @markup.heading.1
(heading2) @markup.heading.2
(heading3) @markup.heading.3
(heading4) @markup.heading.4
(heading5) @markup.heading.5
(heading6) @markup.heading.6
(thematic_break) @string.special
[
(div_marker_begin)
(div_marker_end)
] @punctuation.delimiter
([
(code_block)
(raw_block)
(frontmatter)
] @markup.raw.block
(#set! "priority" 90))
; Remove @markup.raw for code with a language spec
(code_block
.
(code_block_marker_begin)
(language)
(code) @none
(#set! "priority" 90))
[
(code_block_marker_begin)
(code_block_marker_end)
(raw_block_marker_begin)
(raw_block_marker_end)
] @punctuation.delimiter
(language) @attribute
(inline_attribute
_ @conceal
(#set! conceal ""))
((language_marker) @punctuation.delimiter
(#set! conceal ""))
(block_quote) @markup.quote
(block_quote_marker) @punctuation.special
(table_header) @markup.heading
(table_header
"|" @punctuation.special)
(table_row
"|" @punctuation.special)
(table_separator) @punctuation.special
(table_caption
(marker) @punctuation.special)
(table_caption) @markup.italic
[
(list_marker_dash)
(list_marker_plus)
(list_marker_star)
(list_marker_definition)
(list_marker_decimal_period)
(list_marker_decimal_paren)
(list_marker_decimal_parens)
(list_marker_lower_alpha_period)
(list_marker_lower_alpha_paren)
(list_marker_lower_alpha_parens)
(list_marker_upper_alpha_period)
(list_marker_upper_alpha_paren)
(list_marker_upper_alpha_parens)
(list_marker_lower_roman_period)
(list_marker_lower_roman_paren)
(list_marker_lower_roman_parens)
(list_marker_upper_roman_period)
(list_marker_upper_roman_paren)
(list_marker_upper_roman_parens)
] @markup.list
(list_marker_task
(unchecked)) @markup.list.unchecked
(list_marker_task
(checked)) @markup.list.checked
; Colorize `x` in `[x]`
((checked) @constant.builtin
(#offset! @constant.builtin 0 1 0 -1))
[
(ellipsis)
(en_dash)
(em_dash)
(quotation_marks)
] @string.special
(list_item
(term) @type.definition)
; Conceal { and } but leave " and '
((quotation_marks) @string.special
(#any-of? @string.special "\"}" "'}")
(#offset! @string.special 0 1 0 0)
(#set! conceal ""))
((quotation_marks) @string.special
(#any-of? @string.special "\\\"" "\\'" "{'" "{\"")
(#offset! @string.special 0 0 0 -1)
(#set! conceal ""))
[
(hard_line_break)
(backslash_escape)
] @string.escape
; Only conceal \ but leave escaped character.
((backslash_escape) @string.escape
(#offset! @string.escape 0 0 0 -1)
(#set! conceal ""))
(frontmatter_marker) @punctuation.delimiter
(emphasis) @markup.italic
(strong) @markup.strong
(symbol) @string.special.symbol
(insert) @markup.underline
(delete) @markup.strikethrough
[
(highlighted)
(superscript)
(subscript)
] @string.special
; We need to target tokens specifically because `{=` etc can exist as fallback symbols in
; regular text, which we don't want to highlight or conceal.
(highlighted
[
"{="
"=}"
] @punctuation.delimiter
(#set! conceal ""))
(insert
[
"{+"
"+}"
] @punctuation.delimiter
(#set! conceal ""))
(delete
[
"{-"
"-}"
] @punctuation.delimiter
(#set! conceal ""))
(superscript
[
"^"
"{^"
"^}"
] @punctuation.delimiter
(#set! conceal ""))
(subscript
[
"~"
"{~"
"~}"
] @punctuation.delimiter
(#set! conceal ""))
([
(emphasis_begin)
(emphasis_end)
(strong_begin)
(strong_end)
(verbatim_marker_begin)
(verbatim_marker_end)
(math_marker)
(math_marker_begin)
(math_marker_end)
(raw_inline_attribute)
(raw_inline_marker_begin)
(raw_inline_marker_end)
] @punctuation.delimiter
(#set! conceal ""))
((math) @markup.math
(#set! "priority" 90))
(verbatim) @markup.raw
((raw_inline) @markup.raw
(#set! "priority" 90))
(comment
"%" @comment
(#set! conceal ""))
(span
[
"["
"]"
] @punctuation.bracket)
(inline_attribute
[
"{"
"}"
] @punctuation.bracket)
(block_attribute
[
"{"
"}"
] @punctuation.bracket)
[
(class)
(class_name)
] @type
(identifier) @tag
(key_value
"=" @operator)
(key_value
(key) @property)
(key_value
(value) @string)
(link_text
[
"["
"]"
] @punctuation.bracket
(#set! conceal ""))
(autolink
[
"<"
">"
] @punctuation.bracket
(#set! conceal ""))
(inline_link
(inline_link_destination) @markup.link.url
(#set! conceal ""))
(link_reference_definition
":" @punctuation.special)
(full_reference_link
(link_text) @markup.link)
(full_reference_link
(link_label) @markup.link.label
(#set! conceal ""))
(collapsed_reference_link
"[]" @punctuation.bracket
(#set! conceal ""))
(full_reference_link
[
"["
"]"
] @punctuation.bracket
(#set! conceal ""))
(collapsed_reference_link
(link_text) @markup.link)
(collapsed_reference_link
(link_text) @markup.link.label)
(inline_link
(link_text) @markup.link)
(full_reference_image
(link_label) @markup.link.label)
(full_reference_image
[
"!["
"["
"]"
] @punctuation.bracket)
(collapsed_reference_image
[
"!["
"]"
] @punctuation.bracket)
(inline_image
[
"!["
"]"
] @punctuation.bracket)
(image_description) @markup.italic
(image_description
[
"["
"]"
] @punctuation.bracket)
(link_reference_definition
[
"["
"]"
] @punctuation.bracket)
(link_reference_definition
(link_label) @markup.link.label)
(inline_link_destination
[
"("
")"
] @punctuation.bracket)
[
(autolink)
(inline_link_destination)
(link_destination)
(link_reference_definition)
] @markup.link.url
(footnote
(reference_label) @markup.link.label)
(footnote_reference
(reference_label) @markup.link.label)
[
(footnote_marker_begin)
(footnote_marker_end)
] @punctuation.bracket
(todo) @comment.todo
(note) @comment.note
(fixme) @comment.error
[
(paragraph)
(comment)
(table_cell)
] @spell
[
(autolink)
(inline_link_destination)
(link_destination)
(code_block)
(raw_block)
(math)
(raw_inline)
(verbatim)
(reference_label)
(class)
(class_name)
(identifier)
(key_value)
(frontmatter)
] @nospell
(full_reference_link
(link_label) @nospell)
(full_reference_image
(link_label) @nospell)

View File

@ -0,0 +1,10 @@
; The intention here is to rely on Neovims `autoindent` setting.
; This allows us to not indent after just a single list item
; so we can create narrow lists quickly, but indent blocks inside list items
; to the previous paragraph.
(list_item_content) @indent.auto
(footnote_content) @indent.align
((table_caption) @indent.begin
(#set! indent.immediate 1))

View File

@ -0,0 +1,20 @@
((comment) @injection.content
(#set! injection.language "comment"))
(code_block
(language) @injection.language
(code) @injection.content)
(raw_block
(raw_block_info
(language) @injection.language)
(content) @injection.content)
(raw_inline
(content) @injection.content
(raw_inline_attribute
(language) @injection.language))
(frontmatter
(language) @injection.language
(frontmatter_content) @injection.content)

View File

@ -0,0 +1,17 @@
(link_reference_definition
(link_label) @local.definition)
(footnote
(reference_label) @local.definition)
(collapsed_reference_link
(link_text) @local.reference)
(full_reference_link
(link_label) @local.reference)
(full_reference_image
(link_label) @local.reference)
(footnote_reference
(reference_label) @local.reference)

View File

@ -0,0 +1,9 @@
[
(block)
(attr_list)
] @indent.begin
[
"}"
"]"
] @indent.branch @indent.end

View File

@ -0,0 +1,129 @@
(string_array
"," @punctuation.delimiter)
(string_array
[
"["
"]"
] @punctuation.bracket)
[
"ARG"
"AS LOCAL"
"BUILD"
"CACHE"
"CMD"
"COPY"
"DO"
"ENTRYPOINT"
"ENV"
"EXPOSE"
"FROM DOCKERFILE"
"FROM"
"FUNCTION"
"GIT CLONE"
"HOST"
"IMPORT"
"LABEL"
"LET"
"PROJECT"
"RUN"
"SAVE ARTIFACT"
"SAVE IMAGE"
"SET"
"USER"
"VERSION"
"VOLUME"
"WORKDIR"
] @keyword
(for_command
[
"FOR"
"IN"
"END"
] @keyword.repeat)
(if_command
[
"IF"
"END"
] @keyword.conditional)
(elif_block
"ELSE IF" @keyword.conditional)
(else_block
"ELSE" @keyword.conditional)
(import_command
[
"IMPORT"
"AS"
] @keyword.import)
(try_command
[
"TRY"
"FINALLY"
"END"
] @keyword.exception)
(wait_command
[
"WAIT"
"END"
] @keyword)
(with_docker_command
[
"WITH DOCKER"
"END"
] @keyword)
[
(comment)
(line_continuation_comment)
] @comment @spell
[
(target_ref)
(target_artifact)
(function_ref)
] @function
(target
(identifier) @function)
[
(double_quoted_string)
(single_quoted_string)
] @string
(unquoted_string) @string.special
(escape_sequence) @string.escape
(variable) @variable
(expansion
[
"$"
"{"
"}"
"("
")"
] @punctuation.special)
(build_arg
[
"--"
(variable)
] @variable.parameter)
(options
(_) @property)
"=" @operator
(line_continuation) @operator

View File

@ -0,0 +1,9 @@
((comment) @injection.content
(#set! injection.language "comment"))
((line_continuation_comment) @injection.content
(#set! injection.language "comment"))
((shell_fragment) @injection.content
(#set! injection.language "bash")
(#set! injection.include-children))

View File

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

View File

@ -0,0 +1,56 @@
(comment) @comment @spell
; consistency with toml and ini
(section
(section_name) @type)
(character_choice
(character) @constant)
(character_range
start: (character) @constant
end: (character) @constant)
[
"["
"]"
"{"
"}"
] @punctuation.bracket
[
","
".."
(path_separator)
] @punctuation.delimiter
[
"-"
"="
(negation)
] @operator
[
(wildcard_characters)
(wildcard_any_characters)
(wildcard_single_character)
] @character.special
(escaped_character) @string.escape
(pair
key: (identifier) @property
value: (_) @string)
(boolean) @boolean
(integer) @number
(unset) @constant.builtin
[
(spelling_language)
(indent_style)
(end_of_line)
(charset)
] @string.special

View File

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

View File

@ -0,0 +1,14 @@
((function_call_expr) @_fn
(#not-has-parent? @_fn parenthesized_expr)) @fold
[
(case_of_branch)
(case_of_expr)
(value_declaration)
(type_declaration)
(type_alias_declaration)
(list_expr)
(record_expr)
(parenthesized_expr)
(import_clause)+
] @fold

View File

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

View File

@ -0,0 +1,219 @@
; Identifiers
(identifier) @variable
[
"process"
"effect"
] @variable.builtin
(parameters
(identifier)) @variable.parameter
(access
definition: (identifier) @variable.member)
(global_metadata
key: (identifier) @variable.member)
(function_metadata
function_name: (identifier) @variable.member)
; Literals
(_
filename: (string)) @string.special.path
(documentation) @string.documentation @spell
[
(string)
(fstring)
] @string
(int) @number
(real) @number.float
; Types
(_
type: [
(int_type)
(float_type)
(any_type)
]) @type.builtin
[
(single_precision)
(double_precision)
(quad_precision)
(fixed_point_precision)
] @attribute
; Functions
(function_definition
name: (identifier) @function)
(function_names) @function
(function_call
(identifier) @function.call)
(function_call
(access
definition: (identifier) @function.call))
[
"exp"
"log"
"log10"
"sqrt"
"abs"
"floor"
"ceil"
"rint"
"round"
"acos"
"asin"
"atan"
"cos"
"sin"
"tan"
"atan2"
"int"
"float"
"pow"
"min"
"max"
"fmod"
"remainder"
"prefix"
"attach"
"enable"
"control"
"rdtable"
"rwtable"
"select2"
"select3"
"lowest"
"highest"
"assertbounds"
(par)
(seq)
(sum)
(prod)
(component)
(library)
(vslider_type)
(hslider_type)
(nentry_type)
(vbargraph_type)
(hbargraph_type)
(vgroup_type)
(hgroup_type)
(tgroup_type)
"button"
"checkbox"
"soundfile"
"inputs"
"outputs"
"route"
] @function.builtin
; xor is a @keyword.operator
[
(add)
(sub)
(mult)
(div)
(mod)
(pow)
(or)
(and)
(lshift)
(rshift)
(lt)
(le)
(gt)
(ge)
(eq)
(neq)
(delay)
(one_sample_delay)
"="
"=>"
"->"
] @operator
(recursive
"~" @operator)
(sequential
":" @operator)
(split
"<:" @operator)
(merge
":>" @operator)
(parallel
"," @operator)
; Keywords
[
(par)
(seq)
(sum)
(prod)
] @keyword.repeat
(file_import
"import" @keyword.import)
[
(wire)
(cut)
(mem)
"declare"
"with"
"environment"
"case"
"ffunction"
"fconstant"
"fvariable"
] @keyword
(xor) @keyword.operator
; Punctuation
[
","
";"
"."
] @punctuation.delimiter
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket
; Comments
(comment) @comment @spell
; Tags
[
"<mdoc>"
"</mdoc>"
"<metadata>"
"</metadata>"
"<equation>"
"</equation>"
"<diagram>"
"</diagram>"
"<listing"
"<notice"
"/>"
] @tag

View File

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

View File

@ -0,0 +1,6 @@
[
(layout_declaration)
(protocol_declaration)
(resource_declaration)
(service_declaration)
] @fold

View File

@ -0,0 +1,67 @@
[
"ajar"
"alias"
"as"
"bits"
"closed"
"compose"
"const"
"error"
"flexible"
"library"
"open"
; "optional" we did not specify a node for optional yet
"overlay"
"protocol"
"reserved"
"strict"
"using"
] @keyword
[
"enum"
"struct"
"table"
"union"
"resource"
"service"
"type"
] @keyword.type
(primitives_type) @type.builtin
(builtin_complex_type) @type.builtin
(const_declaration
(identifier) @constant)
[
"="
"|"
"&"
"->"
] @operator
(attribute
"@" @attribute
(identifier) @attribute)
(string_literal) @string
(numeric_literal) @number
[
(true)
(false)
] @boolean
(comment) @comment
[
"("
")"
"<"
">"
"{"
"}"
] @punctuation.bracket

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,5 @@
([
(comment)
(afx_comment)
] @injection.content
(#set! injection.language "comment"))

View File

@ -0,0 +1,142 @@
[
"render_mode"
"shader_type"
"group_uniforms"
"global"
"instance"
"const"
"varying"
"uniform"
] @keyword
"struct" @keyword.type
[
(precision_qualifier)
(interpolation_qualifier)
] @keyword.modifier
[
"in"
"out"
"inout"
] @keyword.modifier
[
"while"
"for"
] @keyword.repeat
[
"continue"
"break"
"return"
] @keyword.return
[
"if"
"else"
"switch"
"case"
"default"
] @keyword.conditional
[
"#"
"include"
] @keyword.directive
(string) @string
[
"="
"+="
"-="
"!"
"~"
"+"
"-"
"*"
"/"
"%"
"||"
"&&"
"|"
"^"
"&"
"=="
"!="
">"
">="
"<="
"<"
"<<"
">>"
"++"
"--"
] @operator
(boolean) @boolean
(integer) @number
(float) @number.float
[
"."
","
";"
] @punctuation.delimiter
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket
(builtin_type) @type.builtin
(ident_type) @type.definition
[
(shader_type)
(render_mode)
(hint_name)
] @attribute
(builtin_variable) @constant.builtin
(builtin_function) @function.builtin
(group_uniforms_declaration
group_name: (ident) @property
subgroup_name: (ident) @property)
(struct_declaration
name: (ident) @type)
(struct_member
name: (ident) @property)
(function_declaration
name: (ident) @function)
(parameter
name: (ident) @variable.parameter)
(member_expr
member: (ident) @property)
(call_expr
function: [
(ident)
(builtin_type)
] @function)
(call_expr
function: (builtin_type) @function.call)
(comment) @comment @spell

View File

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

View File

@ -0,0 +1,69 @@
((comment) @injection.content
(#set! injection.language "comment"))
((variable
(name) @_name
value: (string) @injection.content)
(#any-of? @_name "cmd" "command" "textconv" "sendmailCmd")
(#set! injection.language "bash"))
(section
(variable
(name) @_name
value: (string) @injection.content)
(#eq? @_name "tool")
(#set! injection.language "bash"))
(section
(section_header
(section_name) @_pager)
(variable
value: (string) @injection.content)
(#eq? @_pager "pager")
(#set! injection.language "bash"))
(section
(section_header
(section_name) @_interactive)
(variable
(name) @_name
value: (string) @injection.content)
(#eq? @_interactive "interactive")
(#eq? @_name "diffFilter")
(#set! injection.language "bash"))
; https://github.com/git-lfs/git-lfs
; git lfs install
(section
(section_header
(section_name) @_filter
(subsection_name) @_lfs)
(variable
(name) @_name
value: (string) @injection.content)
(#eq? @_filter "filter")
(#eq? @_lfs "lfs")
(#any-of? @_name "smudge" "process" "clean")
(#set! injection.language "bash"))
(section
(section_header
(section_name) @_alias)
(variable
value: (string) @injection.content)
(#eq? @_alias "alias")
(#lua-match? @injection.content "^!")
(#offset! @injection.content 0 1 0 0)
(#set! injection.language "bash"))
(section
(section_header
(section_name) @_alias)
(variable
value: (string
"\""
"\"") @injection.content)
(#eq? @_alias "alias")
(#lua-match? @injection.content "^\"!")
(#offset! @injection.content 0 2 0 -1)
(#set! injection.language "bash"))

View File

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

View File

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

View File

@ -0,0 +1,648 @@
; highlights.scm
(comment) @comment @spell
(identifier) @variable
[
"-"
"+"
"~"
"!"
"$"
"|"
"**"
"*"
"/"
"%"
"=="
"!="
"<"
"<="
">"
">="
"<<"
">>"
"&"
"^"
"&&"
"||"
"="
","
"."
] @operator
[
"eq"
"ne"
] @keyword.operator
(ternary_expression
[
"?"
":"
] @keyword.conditional.ternary)
"sum" @function.builtin
[
"for"
"in"
"do"
"while"
] @keyword.repeat
[
(c_break)
(c_cd)
(c_clear)
"evaluate"
"fit"
"help"
"load"
"lower"
"print"
(c_replot)
(c_reread)
"reset"
"splot"
"cmd"
"test"
"undefine"
"vfill"
] @keyword
(c_pause
"pause" @keyword
"mouse" @variable.member
_? @attribute
(","
_ @attribute)?)
(c_plot
"plot" @keyword)
(c_show
"show" @keyword
"plot"? @attribute)
(c_stats
"stats" @keyword
("name"
(_))? @variable.member)
[
"via"
"inverse"
"sample"
] @keyword.function
[
"if"
"else"
] @keyword.conditional
(plot_element
"axes"? @variable.member)
(cntrparam
"auto"? @variable.member)
(colorbox
"origin"? @attribute)
(contourfill
"auto"? @variable.member)
(format
_? @attribute
(_)
_? @attribute)
(key
"auto"? @variable.member)
(style ; TODO: complete
[
"arrow"
"boxplot"
("data"
[
(_)
"spiderplot" @attribute
])
"fs"
"function"
"line"
"circle"
"rectangle"
"ellipse"
"parallelaxis"
; (spiderplot) ; TODO: complete
"textbox"
("watchpoint"
"labels" @attribute
(_)?)
] @variable.member)
(terminal
"name" @variable.member)
; TODO: complete terminals in grammar and then simplify its options here
(t_cairolatex
[
"eps"
"pdf"
"png"
"standalone"
"input"
"blacktext"
"colortext"
"colourtext"
("header"
(_))
"mono"
"color"
"background"
"rounded"
"butt"
]* @attribute)
; (t_canvas)
; (t_cgm)
; (t_context)
; (t_domterm)
; (t_dumb)
; (t_dxf)
; (t_emf)
; (t_epscairo)
; (t_epslatex)
; (t_fig)
; (t_gif)
; (t_hpgl)
; (t_jpeg)
; (t_lua)
; (t_pc15)
; (t_pdfcairo)
; (t_png)
; (t_pngcairo)
; (t_postscript)
; (t_pslatex)
; (t_pstricks)
; (t_qt)
; (t_sixelgd)
; (t_svg [(font_spec)]* @attribute)
; (t_tek4xxx)
; (t_texdraw)
; (t_tikz)
; (t_tkcanvas)
(plot_style
[
"lines"
"points"
"lp"
"financebars"
"dots"
"impulses"
"labels"
"surface"
"steps"
"fsteps"
"histeps"
"arrows"
"vectors"
"sectors"
"contourfill"
"errorbar"
"errorlines"
"parallelaxes"
"boxes"
"boxerrorbars"
"boxxyerror"
"isosurface"
"boxplot"
"candlesticks"
"circles"
"zerrorfill"
"ellipses"
"filledcurves"
"fillsteps"
"histograms"
"image"
"spiderplot"
"pm3d"
"rgbalpha"
"rgbimage"
"polygons"
"table"
"mask"
] @attribute)
[
"tc"
"fc"
"fs"
"lc"
"ls"
"lw"
"lt"
"pt"
"ps"
"pi"
"pn"
"dt"
"as"
"start"
"cycles"
"saturation"
"interval"
"format"
"keywidth"
"samplen"
"columns"
"title"
"notitle"
"every"
"index"
"using"
"with"
"frac"
"cb"
"arg"
"prefix"
"output"
"primary"
"specular"
"spec2"
"firstlinetype"
"width"
"height"
"expand"
"array"
"dx"
"dy"
"dz"
"filetype"
"center"
"record"
] @variable.member
; Workaround because formatter cannot handle 300 list nodes
[
(angles)
(clip)
(colorsequence)
(contour)
(encoding)
(mapping)
(xdata)
(theta)
"wall"
"on"
"off"
"opaque"
"inside"
"outside"
"margin"
"cen"
"lef"
"rig"
"top"
"bot"
"lr"
"a"
"maxcols"
"maxrows"
"autojustify"
"overlap"
"spread"
"wrap"
"swarm"
"range"
"label"
"mixed"
"triangles"
"insidecolor"
"noinsidecolor"
"cycle"
"tics"
"ztics"
"cbtics"
"user"
"front"
"back"
"bdefault"
"time"
"palette"
"terminal"
"onecolor"
"invert"
"reverse"
"writeback"
"extend"
"restore"
"linear"
"cubicspline"
"bspline"
"points"
"order"
"levels"
"sorted"
"autofreq"
"add"
"inout"
"axis"
"mirror"
"type"
"rowsfirst"
"columnsfirst"
"downwards"
"upwards"
"prevnext"
"gray"
"color"
"gamma"
"defined"
"cubehelix"
"model"
"maxcolors"
"file"
"colormap"
"rgbformulae"
"viridis"
"positive"
"negative"
"nops_allcF"
"ps_allcF"
"quiet"
"full"
"trip"
"numbers"
"small"
"large"
"fullwidth"
"append"
"bind"
"errors"
"session"
"behind"
"polar"
"layerdefault"
"locale"
"axes"
"fix"
"keepfix"
"noextend"
"head"
"fixed"
"filled"
"nofilled"
"absolute"
"at"
"relative"
"enhanced"
"border"
"noborder"
"rgbcolor"
"empty"
"black"
"bgnd"
"nodraw"
"size"
"new"
"first"
"second"
"screen"
"graph"
"character"
"trianglepattern"
"undefined"
"noundefined"
"altdiagonal"
"bentover"
"vertical"
"horizontal"
"square"
"ratio"
"noratio"
"solid"
"transparent"
"pattern"
"from"
"to_rto"
"length"
"angle"
"columnheaders"
"fortran"
"nofpe_trap"
"missing"
"separator"
"commentschars"
"log"
"rangelimited"
"offset"
"nooffset"
"scale"
"font"
"point"
"nopoint"
"boxed"
"noboxed"
"hypertext"
"defaults"
"keyentry"
"splines"
"qnorm"
"gauss"
"cauchy"
"exp"
"box"
"hann"
"implicit"
"explicit"
"rotate"
"by"
"parallel"
"norotate"
"map"
"projection"
"equal"
"azimuth"
"nohidden3d"
"nocontours"
"nosurface"
"colornames"
"functions"
"variables"
"version"
"nologfile"
"logfile"
"fit_out"
"errorvariables"
"covariancevariables"
"errorscaling"
"prescale"
"maxiter"
"limit"
"limit_abs"
"start-lambda"
"lambda-factor"
"script"
"clip"
"fontscale"
"lighting"
"depthorder"
"interpolate"
"corners2color"
"flush"
"scanorder"
"hidden3d"
"clipcb"
"layout"
"margins"
"spacing"
"smooth"
"binary"
"skip"
"bins"
"binrange"
"binwidth"
"binvalue"
"mask"
"convexhull"
"concavehull"
"volatile"
"zsort"
"nonuniform"
"sparse"
"matrix"
] @attribute
[
"x1"
"x2"
"y1"
"y2"
"y"
"r"
"z"
"xy"
"xz"
"yz"
"xyz"
"x1y1"
"x2y2"
"x1y2"
"x2y1"
"columnheader"
"seconds"
"minutes"
"hours"
"days"
"weeks"
"months"
"years"
"cm"
"in"
"discrete"
"incremental"
"default"
"long"
"nogrid"
"unique"
"frequency"
"fnormal"
"cumulative"
"cnormal"
"csplines"
"acsplines"
"mcsplines"
"path"
"bezier"
"sbezier"
"unwrap"
"kdensity"
"closed"
"between"
"above"
"below"
"variable"
"pixels"
"RGB"
"CMY"
"HSV"
"base"
"begin"
"center"
"end"
"ftriangles"
"clip1in"
"clip4in"
"c2c"
"retrace"
"whitespace"
"tab"
"comma"
"push"
"pop"
"flipx"
"flipy"
"flipz"
] @variable.member
(colorspec
"palette" @attribute)
(datafile_modifiers
"origin"? @variable.member)
((datafile_modifiers
filetype: (identifier) @variable.member)
(#any-of? @variable.member
"avs" "bin" "edf" "ehf" "gif" "gpbin" "jpeg" "jpg" "png" "raw" "rgb" "auto"))
(macro) @function.macro
(datablock) @function.macro
(function
name: (identifier) @function)
((function
name: (identifier) @function.builtin)
(#any-of? @function.builtin
"abs" "acos" "acosh" "airy" "arg" "asin" "asinh" "atan" "atan2" "atanh" "besj0" "besj1" "besjn"
"besy0" "besy1" "besyn" "besi0" "besi1" "besin" "cbrt" "ceil" "conj" "cos" "cosh" "EllipticK"
"EllipticE" "EllipticPi" "erf" "erfc" "exp" "expint" "floor" "gamma" "ibeta" "inverf" "igamma"
"imag" "int" "invnorm" "invibeta" "invigamma" "LambertW" "lambertw" "lgamma" "lnGamma" "log"
"log10" "norm" "rand" "real" "round" "sgn" "sin" "sinh" "sqrt" "SynchrotronF" "tan" "tanh"
"uigamma" "voigt" "zeta" "cerf" "cdawson" "faddeva" "erfi" "FresnelC" "FresnelS" "VP" "VP_fwhm"
"Ai" "Bi" "BesselH1" "BesselH2" "BesselJ" "BesselY" "BesselI" "BesselK" "gprintf" "sprintf"
"strlen" "strstrt" "substr" "strptime" "srtftime" "system" "trim" "word" "words" "time"
"timecolumn" "tm_hour" "tm_mday" "tm_min" "tm_mon" "tm_sec" "tm_wday" "tm_week" "tm_yday"
"tm_year" "weekday_iso" "weekday_cdc" "column" "columnhead" "exists" "hsv2rgb" "index" "palette"
"rgbcolor" "stringcolumn" "valid" "value" "voxel"))
((identifier) @variable.builtin
(#match? @variable.builtin
"^\\w+_(records|headers|outofrange|invalid|blank|blocks|columns|column_header|index_(min|max)(_x|_y)?|(min|max)(_x|_y)?|mean(_err)?(_x|_y)?|stddev(_err)?(_x|_y)?)$"))
((identifier) @variable.builtin
(#match? @variable.builtin
"^\\w+_(sdd(_x|_y)?|(lo|up)_quartile(_x|_y)?|median(_x|_y)?|sum(sq)?(_x|_y)?|skewness(_err)?(_x|_y)?)$"))
((identifier) @variable.builtin
(#match? @variable.builtin
"^\\w+_(kurtosis(_err)?(_x|_y)?|adev(_x|_y)?|correlation|slope(_err)?|intercept(_err)?|sumxy|pos(_min|_max)_y|size(_x|_y))$"))
((identifier) @variable.builtin
(#match? @variable.builtin "^((GPVAL|MOUSE|FIT)_\\w+|GNUTERM|NaN|VoxelDistance|GridDistance|pi)$"))
(array_def
"array" @keyword.function)
(array
(identifier) @function)
(number) @number
(string_literal) @string

View File

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

View File

@ -0,0 +1,11 @@
[
(typeGroupSpec)
(typeSingleSpec)
(typeStruct)
(serviceSpec)
(serviceBody)
(importStatement)
(serviceServerSpec)
(infoStatement)
(structType)
] @fold

View File

@ -0,0 +1,79 @@
; Key Symbol
"=" @operator
[
"."
","
":"
";"
] @punctuation.delimiter
[
"("
")"
"{"
"}"
"["
"]"
] @punctuation.bracket
; Keywords
[
"syntax"
"info"
"service"
] @keyword
"import" @keyword.import
"returns" @keyword.return
[
"type"
"struct"
] @keyword.type
[
"@doc"
"@handler"
"@server"
] @attribute
; Service
(serviceName) @type
; Httpmethod
(HTTPMETHOD) @keyword.operator
; Field
(fieldType) @type.builtin
(fieldName) @variable.member
(anonymousField) @variable.member
; Functions
(handlerValue) @function.method
; Strings
(VALUE) @string
(tag) @string.documentation
(PATH) @string.special.path
; Comments
(comment) @comment @spell
(key) @variable.member
(identValue) @string
(DURATION) @number
(NUMBER) @number
; Struct
(structNameId) @type
(body) @type

View File

@ -0,0 +1,15 @@
[
(importGroup)
(typeGroupSpec)
(structType)
(infoStatement)
(serviceServerSpec)
(serviceSpec)
] @indent.begin
[
")"
"}"
] @indent.branch @indent.end
(comment) @indent.ignore

View File

@ -0,0 +1,3 @@
; Inject comment language for goctl
((comment) @injection.content
(#set! injection.language "comment"))

View File

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

View File

@ -0,0 +1,8 @@
[
(if_action)
(range_action)
(block_action)
(with_action)
(define_action)
(comment)
] @fold

View File

@ -0,0 +1,132 @@
; 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
(#set! priority 110))
; Function calls
(function_call
function: (identifier) @function
(#set! priority 110))
(method_call
method: (selector_expression
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))
([
"{{"
"}}"
"{{-"
"-}}"
")"
"("
] @punctuation.bracket
(#set! priority 110))
; Actions
(if_action
[
"if"
"else"
"else if"
"end"
] @keyword.conditional
(#set! priority 110))
(range_action
[
"range"
"else"
"end"
] @keyword.repeat
(#set! priority 110))
(template_action
"template" @function.builtin
(#set! priority 110))
(block_action
[
"block"
"end"
] @keyword.directive
(#set! priority 110))
(define_action
[
"define"
"end"
] @keyword.directive.define
(#set! priority 110))
(with_action
[
"with"
"else"
"end"
] @keyword.conditional
(#set! priority 110))
; Literals
([
(interpreted_string_literal)
(raw_string_literal)
] @string
(#set! priority 110))
((rune_literal) @string.special.symbol
(#set! priority 110))
((escape_sequence) @string.escape
(#set! priority 110))
([
(int_literal)
(imaginary_literal)
] @number
(#set! priority 110))
((float_literal) @number.float
(#set! priority 110))
([
(true)
(false)
] @boolean
(#set! priority 110))
((nil) @constant.builtin
(#set! priority 110))
((comment) @comment @spell
(#set! priority 110))

View File

@ -0,0 +1,31 @@
((comment) @injection.content
(#set! injection.language "comment"))
; {{"put" | printf "%s%s" "out" | printf "%q"}}
(function_call
function: (identifier) @_function
arguments: (argument_list
.
(interpreted_string_literal) @injection.content)
(#eq? @_function "printf")
(#set! injection.language "printf"))
; {{ js "var a = 1 + 1" }}
(function_call
function: (identifier) @_function
arguments: (argument_list
.
(interpreted_string_literal) @injection.content)
(#eq? @_function "js")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "javascript"))
; {{ html "<h1>hello</h1>" }}
(function_call
function: (identifier) @_function
arguments: (argument_list
.
(interpreted_string_literal) @injection.content)
(#eq? @_function "html")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "html"))

View File

@ -0,0 +1,12 @@
[
(if_action)
(range_action)
(block_action)
(with_action)
(define_action)
] @local.scope
(variable_definition
variable: (variable) @local.definition.var)
(variable) @local.reference

View File

@ -0,0 +1,35 @@
[
(closure)
(map)
(list)
(argument_list)
(parameter_list)
(for_parameters)
] @indent.begin
; (function_definition "(" @indent.begin)
(closure
"}" @indent.end)
(argument_list
")" @indent.end)
(for_parameters
")" @indent.end)
((for_loop
body: (_) @_body) @indent.begin
(#not-kind-eq? @_body "closure"))
; TODO: while, try
(list
"]" @indent.end)
(map
"]" @indent.end)
[
"}"
")"
"]"
] @indent.branch

View File

@ -0,0 +1,6 @@
(function_definition) @local.scope
(parameter
name: (identifier) @local.definition.parameter)
(identifier) @local.reference

View File

@ -0,0 +1,5 @@
([
(comment)
(heredoc)
] @injection.content
(#set! injection.language "comment"))

View File

@ -0,0 +1,9 @@
(signature
name: (variable)) @local.definition
(function
name: (variable)) @local.definition
(pattern/variable) @local.definition
(expression/variable) @local.reference

View File

@ -0,0 +1,50 @@
; 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"
"title" "untitle" "repeat" "substr" "nospace" "trunc" "abbrev" "abbrevboth" "initials"
"randAlphaNum" "randAlpha" "randNumeric" "randAscii" "wrap" "wrapWith" "contains" "hasPrefix"
"hasSuffix" "quote" "squote" "cat" "indent" "nindent" "replace" "plural" "snakecase" "camelcase"
"kebabcase" "swapcase" "shuffle" "toStrings" "toDecimal" "toJson" "mustToJson" "toPrettyJson"
"mustToPrettyJson" "toRawJson" "mustToRawJson" "fromYaml" "fromJson" "fromJsonArray"
"fromYamlArray" "toYaml" "regexMatch" "mustRegexMatch" "regexFindAll" "mustRegexFinDall"
"regexFind" "mustRegexFind" "regexReplaceAll" "mustRegexReplaceAll" "regexReplaceAllLiteral"
"mustRegexReplaceAllLiteral" "regexSplit" "mustRegexSplit" "sha1sum" "sha256sum" "adler32sum"
"htpasswd" "derivePassword" "genPrivateKey" "buildCustomCert" "genCA" "genSelfSignedCert"
"genSignedCert" "encryptAES" "decryptAES" "now" "ago" "date" "dateInZone" "duration"
"durationRound" "unixEpoch" "dateModify" "mustDateModify" "htmlDate" "htmlDateInZone" "toDate"
"mustToDate" "dict" "get" "set" "unset" "hasKey" "pluck" "dig" "merge" "mustMerge"
"mergeOverwrite" "mustMergeOverwrite" "keys" "pick" "omit" "values" "deepCopy" "mustDeepCopy"
"b64enc" "b64dec" "b32enc" "b32dec" "list" "first" "mustFirst" "rest" "mustRest" "last"
"mustLast" "initial" "mustInitial" "append" "mustAppend" "prepend" "mustPrepend" "concat"
"reverse" "mustReverse" "uniq" "mustUniq" "without" "mustWithout" "has" "mustHas" "compact"
"mustCompact" "index" "slice" "mustSlice" "until" "untilStep" "seq" "add" "add1" "sub" "div"
"mod" "mul" "max" "min" "len" "addf" "add1f" "subf" "divf" "mulf" "maxf" "minf" "floor" "ceil"
"round" "getHostByName" "base" "dir" "clean" "ext" "isAbs" "kindOf" "kindIs" "typeOf" "typeIs"
"typeIsLike" "deepequal" "semver" "semverCompare" "urlParse" "urlJoin" "urlquery" "lookup"
"include")
)
; {{ .Values.test }}
(selector_expression
operand: (field
name: (identifier) @constant.builtin
(#set! priority 110)
(#any-of? @constant.builtin
"Values" "Chart" "Release" "Capabilities" "Files" "Subcharts" "Template"))
(field_identifier))
; {{ $.Values.test }}
(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

@ -0,0 +1,36 @@
; inherits: gotmpl
((text) @injection.content
(#set! injection.language "yaml")
(#set! injection.combined))
; {{ regexFind "[a-zA-Z][1-9]" "abcd1234" }}
(function_call
function: (identifier) @_function
arguments: (argument_list
.
(interpreted_string_literal) @injection.content)
(#any-of? @_function
"regexMatch" "mustRegexMatch" "regexFindAll" "mustRegexFinDall" "regexFind" "mustRegexFind"
"regexReplaceAll" "mustRegexReplaceAll" "regexReplaceAllLiteral" "mustRegexReplaceAllLiteral"
"regexSplit" "mustRegexSplit")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "regex"))
(function_call
function: (identifier) @_function
arguments: (argument_list
.
(interpreted_string_literal) @injection.content)
(#any-of? @_function "fromYaml" "fromYamlArray")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "yaml"))
(function_call
function: (identifier) @_function
arguments: (argument_list
.
(interpreted_string_literal) @injection.content)
(#any-of? @_function "fromJson" "fromJsonArray")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "json"))

View File

@ -0,0 +1,41 @@
; Comments
(comment) @comment @spell
; General
(uri) @string.special.url
(tag_name) @keyword
(attribute_name) @attribute
[
(dec)
(hex)
(resolution)
(range)
] @number
(float) @number.float
(string) @string
[
(enum)
(date_time_msec)
] @string.special
(title) @markup.heading
; Literals
[
"="
"x"
"@"
] @operator
[
":"
","
] @punctuation.delimiter
"#" @punctuation.special

View File

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

View File

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

View File

@ -0,0 +1,58 @@
(comment) @comment @spell
[
"source"
"exec"
"exec-once"
] @keyword
(keyword
(name) @keyword)
(assignment
(name) @property)
(section
(name) @module)
(section
device: (device_name) @type)
(variable) @variable
"$" @punctuation.special
(boolean) @boolean
(mod) @constant
[
"rgb"
"rgba"
] @function.builtin
[
(number)
(legacy_hex)
(angle)
(hex)
(display)
(position)
] @number
"deg" @type
"," @punctuation.delimiter
[
"("
")"
"{"
"}"
] @punctuation.bracket
[
"="
"-"
"+"
] @operator

View File

@ -0,0 +1,6 @@
(section) @indent.begin
(section
"}" @indent.end)
"}" @indent.branch

View File

@ -0,0 +1,6 @@
((comment) @injection.content
(#set! injection.language "comment"))
(exec
(string) @injection.content
(#set! injection.language "bash"))

View File

@ -0,0 +1,379 @@
; https://neovim.io/doc/user/treesitter.html#treesitter-highlight-groups
(comment) @comment @spell
[
"enum"
"struct"
"union"
"bitmask"
"bitset"
"@annotation"
"exception"
"typedef"
"home"
"typeid"
"typeprefix"
(interface_kind)
(value_kind)
"component"
"porttype"
"connector"
"eventtype"
"valuetype"
] @keyword.type
(import_dcl
"import" @keyword.directive)
[
"module"
"attribute"
"factory"
"manages"
] @keyword
[
"const"
"readonly"
"abstract"
"custom"
"supports"
"provides"
"uses"
"port"
"mirrorport"
"emits"
"publishes"
"consumes"
"primarykey"
"finder"
] @keyword.modifier
[
"switch"
"case"
"default"
] @keyword.conditional
[
"void"
(signed_short_int)
(signed_long_int)
(signed_longlong_int)
(unsigned_tiny_int)
(boolean_type)
(fixed_pt_const_type)
(octet_type)
(signed_tiny_int)
(unsigned_short_int)
(unsigned_long_int)
(unsigned_longlong_int)
(floating_pt_type)
(char_type)
(string_type)
(any_type)
(fixed_pt_type)
(sequence_type)
(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
(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
[
"("
")"
"["
"]"
"<"
">"
"{"
"}"
] @punctuation.bracket
[
"-"
"*"
"+"
"="
"<<"
">>"
"%"
"~"
"|"
"^"
"&"
] @operator
[
"::"
";"
":"
","
] @punctuation.delimiter
(readonly_attr_declarator
(simple_declarator) @variable.member)
(attr_declarator
(simple_declarator) @variable.member)
(annotation_appl
"@" @attribute)
(annotation_appl_custom_body
(scoped_name) @attribute)
(op_dcl
(identifier) @function.method)
(type_declarator
(simple_type_spec) @type)
(type_declarator
(any_declarators) @variable.member)
(param_dcl
(simple_declarator) @variable.parameter)
(raises_expr
"raises" @keyword.exception
(scoped_name
(identifier) @type))
(param_dcl
(param_attribute) @keyword.modifier)
(preproc_call
directive: (preproc_directive) @keyword.directive
argument: (_) @constant)
(module_dcl
(identifier) @module)
(struct_def
(identifier) @type
parent: (scoped_name)? @type)
(enum_dcl
(enumerator
(identifier) @constant))
(annotation_dcl
(identifier) @type)
(struct_forward_dcl
(identifier) @type)
(bitmask_dcl
(identifier) @type)
(bitset_dcl
(identifier) @type
(scoped_name)* @type)
(enum_dcl
(identifier) @type)
(union_forward_dcl
(identifier) @type)
(interface_forward_dcl
(identifier) @type)
(interface_header
(identifier) @type)
(interface_inheritance_spec
(interface_name) @type)
(union_def
(identifier) @type
(switch_type_spec) @type)
(except_dcl
(identifier) @type)
(annotation_member_type) @type
(bitfield
(bitfield_spec
"bitfield" @keyword.modifier
(positive_int_const) @number
(destination_type)? @type)
(identifier)* @variable.member)
(bit_value) @constant
(annotation_member
(annotation_member_type) @type
(simple_declarator) @property)
(const_dcl
(const_type) @type
(identifier) @constant)
(case_label
(const_expr) @constant)
(simple_type_spec
(scoped_name
(identifier) @type))
(annotation_appl_param
(identifier) @attribute)
(home_header
(identifier) @type)
(factory_dcl
(identifier) @type)
(factory_param_dcl
"in" @keyword.modifier)
(op_oneway_dcl
"oneway" @keyword.modifier
(identifier) @function.method)
(in_param_dcl
"in" @keyword.modifier)
(context_expr
"context" @keyword.modifier)
(get_excep_expr
"getraises" @keyword.exception)
(set_excep_expr
"setraises" @keyword.exception)
(value_header
(identifier) @type)
(value_abs_def
(identifier) @type)
(value_forward_dcl
(identifier) @type)
(value_box_def
(identifier) @type)
(provides_dcl
(interface_type) @type
(identifier) @variable.member)
(uses_dcl
(identifier) @variable.member)
(component_forward_dcl
(identifier) @type)
(component_header
(identifier) @type)
(porttype_forward_dcl
(identifier) @type)
(porttype_def
(identifier) @type)
(port_dcl
(identifier) @variable.member)
(connector_header
(identifier) @type)
(emits_dcl
(identifier) @variable.member)
(publishes_dcl
(identifier) @variable.member)
(consumes_dcl
(identifier) @variable.member)
(event_forward_dcl
(identifier) @type)
(event_header
(identifier) @type)
(event_abs_def
(identifier) @type)
(template_module_dcl
(identifier) @type)
(formal_parameter
(formal_parameter_type) @type
(identifier) @variable.member)
(init_param_dcl
"in" @keyword.modifier
(simple_declarator) @variable.parameter)
(finder_dcl
(identifier) @function.method)
(member
identifier: (declarators) @variable.member)
(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

@ -0,0 +1,10 @@
";" @indent.end
"}" @indent.branch
(definition) @indent.begin
[
(preproc_define)
(preproc_include)
] @indent.ignore

View File

@ -0,0 +1,8 @@
((comment) @injection.content
(#lua-match? @injection.content "/[*\/][!*\/]<?[^a-zA-Z]")
(#set! injection.language "doxygen"))
((comment) @injection.content
(#not-lua-match? @injection.content "/[*\/][!*\/]<?[^a-zA-Z]")
(#not-lua-match? @injection.content "//@[a-zA-Z]")
(#set! injection.language "comment"))

View File

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

View File

@ -0,0 +1,17 @@
[
(call)
(class)
(closure)
(define_case)
(define_constant)
(define_field)
(define_variable)
(external_function)
(if)
(import)+
(loop)
(match)
(method)
(trait)
(while)
] @fold

View File

@ -0,0 +1,198 @@
; Brackets and operators
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket
[
","
"->"
"."
":"
] @punctuation.delimiter
[
"!="
"%"
"%="
"&"
"&="
"*"
"**"
"**="
"*="
"+"
"+="
"-"
"-="
"/"
"/="
"<"
"<<"
"<<="
"<="
"<="
"=="
">"
">="
">="
">>"
">>="
">>>"
">>>="
"^"
"^="
"|"
"|="
] @operator
; Keywords
[
"as"
"for"
"impl"
"let"
"mut"
"ref"
"uni"
"move"
"recover"
] @keyword
"fn" @keyword.function
"import" @keyword.import
[
"and"
"or"
] @keyword.operator
[
"class"
"trait"
] @keyword.type
[
"extern"
(modifier)
(visibility)
] @keyword.modifier
[
"loop"
"while"
(break)
(next)
] @keyword.repeat
"return" @keyword.return
[
"throw"
"try"
] @keyword.exception
[
"case"
"else"
"if"
"match"
] @keyword.conditional
; Identifiers/variable references
(identifier) @variable
; Comments
(line_comment) @comment @spell
; Literals
(self) @variable.builtin
(nil) @constant.builtin
[
(true)
(false)
] @boolean
(integer) @number
(float) @number.float
(string) @string
(escape_sequence) @string.escape
(interpolation
"${" @punctuation.special
"}" @punctuation.special) @none
(constant) @constant
; Patterns
(integer_pattern) @number
(string_pattern) @string
(constant_pattern) @constant
; Types
(generic_type
name: _ @type)
(type) @type
; Imports
(extern_import
path: _ @string)
(import
(path
(identifier) @module))
; Classes
(class
name: _ @type)
(define_field
name: _ @variable.member)
; Traits
(trait
name: _ @type)
; Implementations
(implement_trait
class: _ @type)
(reopen_class
name: _ @type)
(bound
name: _ @type)
; Methods
(method
name: _ @function)
(external_function
name: _ @function)
(argument
name: _ @variable.parameter)
(named_argument
name: _ @variable.parameter)
(call
name: [
(name)
(constant)
] @function)
(field) @variable.member

View File

@ -0,0 +1,41 @@
[
(arguments)
(array)
(assign_field)
(assign_local)
(assign_receiver_field)
(binary)
(block)
(bounds)
(call)
(cast)
(class)
(class_pattern)
(compound_assign_field)
(compound_assign_local)
(compound_assign_receiver_field)
(define_constant)
(define_variable)
(grouped_expression)
(implement_trait)
(match)
(or_pattern)
(reopen_class)
(replace_field)
(replace_local)
(symbols)
(trait)
(tuple)
(tuple_pattern)
(type_arguments)
] @indent.begin
[
")"
"]"
"}"
] @indent.end @indent.branch
(line_comment) @indent.auto
(string) @indent.auto

View File

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

View File

@ -0,0 +1,57 @@
[
(method)
(block)
] @local.scope
(method
name: _ @local.definition.method)
(external_function
name: _ @local.definition.function)
(argument
name: _ @local.definition.parameter)
(define_variable
name: _ @local.definition.var)
(define_constant
name: _ @local.definition.constant)
(define_field
name: _ @local.definition.field)
(named_argument
name: _ @local.definition.parameter)
(class
modifier: (modifier
"enum")
name: _ @local.definition.enum)
(class
modifier: (modifier
"enum")
body: (class_body
(define_case
name: _ @local.definition.field)))
(class
name: _ @local.definition.type)
(trait
name: _ @local.definition.type)
(import
(symbols
[
(identifier)
(constant)
(self)
] @local.definition.import))
(identifier) @local.reference
(field) @local.reference
(constant) @local.reference

View File

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

View File

@ -0,0 +1,6 @@
([
(recipe)
(string)
(external_command)
] @fold
(#trim! @fold))

View File

@ -0,0 +1,133 @@
[
"true"
"false"
] @boolean
[
"if"
"else"
] @keyword.conditional
[
"alias"
"set"
"shell"
"mod"
] @keyword
[
"import"
"export"
] @keyword.import
[
":="
"?"
"=="
"!="
"=~"
"@"
"="
"$"
"*"
"+"
"&&"
"@-"
"-@"
"-"
"/"
":"
] @operator
[
"("
")"
"["
"]"
"{{"
"}}"
"{"
"}"
] @punctuation.bracket
[
"`"
"```"
] @punctuation.special
"," @punctuation.delimiter
(shebang) @keyword.directive
(comment) @comment @spell
[
(string)
(external_command)
] @string
(escape_sequence) @string.escape
(module
(identifier) @module)
(assignment
(identifier) @variable)
(alias
(identifier) @variable)
(value
(identifier) @variable)
; Recipe definitions
(recipe_header
(identifier) @function)
(dependency
(identifier) @function.call)
(dependency_expression
(identifier) @function.call)
(parameter
(identifier) @variable.parameter)
(dependency_expression
(expression
(value
(identifier) @variable.parameter)))
; Fallback highlighting for recipe bodies
(recipe
(recipe_body) @string
(#set! "priority" 90))
; Ref: https://just.systems/man/en/chapter_26.html
;(setting (identifier) @error)
(setting
(identifier) @constant.builtin
(#any-of? @constant.builtin
"allow-duplicate-recipes" "dotenv-filename" "dotenv-load" "dotenv-path" "export" "fallback"
"ignore-comments" "positional-arguments" "tempdir" "windows-powershell" "windows-shell"))
; Ref: https://just.systems/man/en/chapter_32.html
;(recipe (attribute (identifier) @error))
(recipe
(attribute
(identifier) @attribute)
(#any-of? @attribute
"confirm" "linux" "macos" "no-cd" "no-exit-message" "no-quiet" "private" "unix" "windows"))
; Ref: https://just.systems/man/en/chapter_31.html
;(function_call (identifier) @error)
(function_call
(identifier) @function.call
(#any-of? @function.call
"arch" "num_cpus" "os" "os_family" "env_var" "env_var_or_default" "env" "invocation_directory"
"invocation_directory_native" "justfile" "justfile_directory" "just_executable" "quote"
"replace" "replace_regex" "trim" "trim_end" "trim_end_match" "trim_end_matches" "trim_start"
"trim_start_match" "trim_start_matches" "capitalize" "kebabcase" "lowercamelcase" "lowercase"
"shoutykebabcase" "shoutysnakecase" "snakecase" "titlecase" "uppercamelcase" "uppercase"
"absolute_path" "extension" "file_name" "file_stem" "parent_directory" "without_extension"
"clean" "join" "path_exists" "error" "sha256" "sha256_file" "uuid" "semver_matches"))

View File

@ -0,0 +1,14 @@
; Source: https://github.com/IndianBoy42/tree-sitter-just/blob/main/queries/just/indents.scm
[
(recipe)
(string)
(external_command)
] @indent.begin
(string
[
"'''"
"\"\"\""
] @indent.branch @indent.end)
(comment) @indent.auto

View File

@ -0,0 +1,44 @@
((comment) @injection.content
(#set! injection.language "comment"))
; The right side of =~ literals
(regex_literal
(_) @injection.content
(#set! injection.language "regex"))
; Default to bash highlighting for non-shebang recipes and commands
(recipe
(recipe_body
!shebang) @injection.content
(#set! injection.include-children)
(#set! injection.language "bash"))
(external_command
(command_body) @injection.content
(#set! injection.language "bash"))
; For shebang recipes, use the shebang executable name as the language by default
(recipe
(recipe_body
(shebang
(language) @injection.language)) @injection.content
(#not-any-of? @injection.language "python3" "nodejs" "node")
(#set! injection.include-children))
; python3 -> python
(recipe
(recipe_body
(shebang
(language) @_lang)) @injection.content
(#eq? @_lang "python3")
(#set! injection.language "python")
(#set! injection.include-children))
; node/nodejs -> javascript
(recipe
(recipe_body
(shebang
(language) @_lang)) @injection.content
(#any-of? @_lang "node" "nodejs")
(#set! injection.language "javascript")
(#set! injection.include-children))

View File

@ -0,0 +1,35 @@
; Source: https://github.com/IndianBoy42/tree-sitter-just/blob/main/queries/just/locals.scm
; Scope
(recipe) @local.scope
; Definitions
(alias
left: (identifier) @local.definition.var)
(assignment
left: (identifier) @local.definition.var)
(module
name: (identifier) @local.definition.namespace)
(parameter
name: (identifier) @local.definition.var)
(recipe_header
name: (identifier) @local.definition.function)
; References
(alias
right: (identifier) @local.reference)
(function_call
name: (identifier) @local.reference)
(dependency
name: (identifier) @local.reference)
(dependency_expression
name: (identifier) @local.reference)
(value
(identifier) @local.reference)

View File

@ -0,0 +1,9 @@
[
(assign)
(comment)
(function)
(list)
(map)
(tuple)
(string)
] @fold

View File

@ -0,0 +1,131 @@
[
"="
"+"
"-"
"*"
"/"
"%"
"+="
"-="
"*="
"/="
"%="
"=="
"!="
"<"
">"
"<="
">="
".."
"..="
] @operator
[
"and"
"not"
"or"
] @keyword.operator
[
"return"
"yield"
] @keyword.return
[
"if"
"then"
"else"
"else if"
"match"
"switch"
] @keyword.conditional
[
(break)
(continue)
"for"
"in"
"loop"
"until"
"while"
] @keyword.repeat
[
"throw"
"try"
"catch"
"finally"
] @keyword.exception
[
"export"
"from"
"import"
"as"
] @keyword.import
[
"("
")"
"["
"]"
"{"
"}"
"|"
] @punctuation.bracket
(identifier) @variable
(import_module
(identifier) @module)
(import_item
(identifier) @module)
(export
(identifier) @module)
(chain
lookup: (identifier) @variable.member)
(chain
start: (identifier) @function.call)
[
(true)
(false)
] @boolean
(comment) @comment @spell
(debug) @keyword.debug
(string) @string
(fill_char) @punctuation.delimiter
(alignment) @operator
(escape) @string.escape
(null) @constant.builtin
(number) @number
(meta) @keyword.directive
(meta
name: (identifier) @variable.member)
(entry_inline
key: (identifier) @variable.member)
(entry_block
key: (identifier) @variable.member)
(self) @variable.builtin
(arg
(identifier) @variable.parameter)
(ellipsis) @variable.parameter

View File

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

View File

@ -0,0 +1,28 @@
; Scopes
(function
body: (_) @local.scope)
; Definitions
(arg
(variable) @local.definition.parameter)
(assign
(identifier) @local.definition.var)
(for_args
(variable) @local.definition.var)
(match_patterns
(variable) @local.definition.var)
(import_item
(identifier) @local.definition.import)
(entry_block
(identifier) @local.definition.field)
(entry_inline
(identifier) @local.definition.field)
; References
(identifier) @local.reference

Some files were not shown because too many files have changed in this diff Show More