1

Update generated neovim config

This commit is contained in:
2024-09-22 20:41:25 +02:00
parent 1743764e48
commit aa1271c42c
1247 changed files with 26512 additions and 15067 deletions

View File

@ -1,16 +1,23 @@
[
(Block)
(ContainerDecl)
(SwitchExpr)
(InitList)
(AsmExpr)
(ErrorSetDecl)
(LINESTRING)
(
[
(IfPrefix)
(WhilePrefix)
(ForPrefix)
]
)
(block)
(switch_expression)
(initializer_list)
(asm_expression)
(multiline_string)
(if_statement)
(while_statement)
(for_statement)
(if_expression)
(else_clause)
(for_expression)
(while_expression)
(if_type_expression)
(function_signature)
(parameters)
(struct_declaration)
(opaque_declaration)
(enum_declaration)
(union_declaration)
(error_set_declaration)
] @fold

View File

@ -1,112 +1,132 @@
[
(container_doc_comment)
(doc_comment)
(line_comment)
] @comment @spell
; Variables
[
variable: (IDENTIFIER)
variable_type_function: (IDENTIFIER)
] @variable
(identifier) @variable
parameter: (IDENTIFIER) @parameter
; Parameters
[
field_member: (IDENTIFIER)
field_access: (IDENTIFIER)
] @field
(parameter
name: (identifier) @variable.parameter)
;; assume TitleCase is a type
(
; Types
(parameter
type: (identifier) @type)
((identifier) @type
(#lua-match? @type "^[A-Z_][a-zA-Z0-9_]*"))
(variable_declaration
(identifier) @type
"="
[
variable_type_function: (IDENTIFIER)
field_access: (IDENTIFIER)
parameter: (IDENTIFIER)
] @type
(#match? @type "^[A-Z]([a-z]+[A-Za-z0-9]*)*$")
)
;; assume camelCase is a function
(
[
variable_type_function: (IDENTIFIER)
field_access: (IDENTIFIER)
parameter: (IDENTIFIER)
] @function
(#match? @function "^[a-z]+([A-Z][a-z0-9]*)+$")
)
;; assume all CAPS_1 is a constant
(
[
variable_type_function: (IDENTIFIER)
field_access: (IDENTIFIER)
] @constant
(#match? @constant "^[A-Z][A-Z_0-9]+$")
)
(struct_declaration)
(enum_declaration)
(union_declaration)
(opaque_declaration)
])
[
function_call: (IDENTIFIER)
function: (IDENTIFIER)
] @function
(builtin_type)
"anyframe"
] @type.builtin
exception: "!" @exception
; Constants
(
(IDENTIFIER) @variable.builtin
(#eq? @variable.builtin "_")
)
(PtrTypeStart "c" @variable.builtin)
(
(ContainerDeclType
[
(ErrorUnionExpr)
"enum"
]
)
(ContainerField (IDENTIFIER) @constant)
)
field_constant: (IDENTIFIER) @constant
(BUILTINIDENTIFIER) @function.builtin
((BUILTINIDENTIFIER) @include
(#any-of? @include "@import" "@cImport"))
(INTEGER) @number
(FLOAT) @float
((identifier) @constant
(#lua-match? @constant "^[A-Z][A-Z_0-9]+$"))
[
"true"
"false"
] @boolean
"null"
"unreachable"
"undefined"
] @constant.builtin
(field_expression
.
member: (identifier) @constant)
(enum_declaration
(container_field
type: (identifier) @constant))
; Labels
(block_label (identifier) @label)
(break_label (identifier) @label)
; Fields
(field_initializer
.
(identifier) @variable.member)
(field_expression
(_)
member: (identifier) @variable.member)
(container_field
name: (identifier) @variable.member)
(initializer_list
(assignment_expression
left: (field_expression
.
member: (identifier) @variable.member)))
; Functions
(builtin_identifier) @function.builtin
(call_expression
function: (identifier) @function.call)
(call_expression
function: (field_expression
member: (identifier) @function.call))
(function_declaration
name: (identifier) @function)
; Modules
(variable_declaration
(identifier) @module
(builtin_function
(builtin_identifier) @keyword.import
(#any-of? @keyword.import "@import" "@cImport")))
; Builtins
[
(LINESTRING)
(STRINGLITERALSINGLE)
] @string @spell
"c"
"..."
] @variable.builtin
(CHAR_LITERAL) @character
(EscapeSequence) @string.escape
(FormatSequence) @string.special
((identifier) @variable.builtin
(#eq? @variable.builtin "_"))
(BreakLabel (IDENTIFIER) @label)
(BlockLabel (IDENTIFIER) @label)
(calling_convention
(identifier) @variable.builtin)
; Keywords
[
"asm"
"defer"
"errdefer"
"test"
"error"
"const"
"var"
] @keyword
[
"struct"
"union"
"enum"
"opaque"
"error"
] @keyword
] @keyword.type
[
"async"
@ -116,9 +136,7 @@ field_constant: (IDENTIFIER) @constant
"resume"
] @keyword.coroutine
[
"fn"
] @keyword.function
"fn" @keyword.function
[
"and"
@ -126,96 +144,124 @@ field_constant: (IDENTIFIER) @constant
"orelse"
] @keyword.operator
[
"return"
] @keyword.return
"return" @keyword.return
[
"if"
"else"
"switch"
] @conditional
] @keyword.conditional
[
"for"
"while"
"break"
"continue"
] @repeat
] @keyword.repeat
[
"usingnamespace"
] @include
"export"
] @keyword.import
[
"try"
"catch"
] @exception
] @keyword.exception
[
"anytype"
(BuildinTypeExpr)
] @type.builtin
[
"const"
"var"
"volatile"
"allowzero"
"noalias"
] @type.qualifier
[
"addrspace"
"align"
"callconv"
"linksection"
] @storageclass
[
"comptime"
"export"
"extern"
"pub"
"inline"
"noinline"
"extern"
"comptime"
"packed"
"pub"
"threadlocal"
] @attribute
] @keyword.modifier
; Operator
[
"null"
"unreachable"
"undefined"
] @constant.builtin
[
(CompareOp)
(BitwiseOp)
(BitShiftOp)
(AdditionOp)
(AssignOp)
(MultiplyOp)
(PrefixOp)
"="
"*="
"*%="
"*|="
"/="
"%="
"+="
"+%="
"+|="
"-="
"-%="
"-|="
"<<="
"<<|="
">>="
"&="
"^="
"|="
"!"
"~"
"-"
"-%"
"&"
"=="
"!="
">"
">="
"<="
"<"
"&"
"^"
"|"
"<<"
">>"
"<<|"
"+"
"++"
"+%"
"-%"
"+|"
"-|"
"*"
"/"
"%"
"**"
"->"
".?"
"*%"
"*|"
"||"
".*"
".?"
"?"
".."
] @operator
[
";"
"."
","
":"
] @punctuation.delimiter
; Literals
[
".."
"..."
] @punctuation.special
(character) @character
([
(string)
(multiline_string)
] @string
(#set! "priority" 95))
(integer) @number
(float) @number.float
(boolean) @boolean
(escape_sequence) @string.escape
; Punctuation
[
"["
@ -224,10 +270,22 @@ field_constant: (IDENTIFIER) @constant
")"
"{"
"}"
(Payload "|")
(PtrPayload "|")
(PtrIndexPayload "|")
] @punctuation.bracket
; Error
(ERROR) @error
[
";"
"."
","
":"
"=>"
"->"
] @punctuation.delimiter
(payload "|" @punctuation.bracket)
; Comments
(comment) @comment @spell
((comment) @comment.documentation
(#lua-match? @comment.documentation "^//!"))

View File

@ -1,9 +1,11 @@
[
(Block)
(ContainerDecl)
(SwitchExpr)
(InitList)
] @indent
(block)
(switch_expression)
(initializer_list)
] @indent.begin
(block
"}" @indent.end)
[
"("
@ -12,11 +14,9 @@
"]"
"{"
"}"
] @branch
] @indent.branch
[
(line_comment)
(container_doc_comment)
(doc_comment)
(LINESTRING)
] @ignore
(comment)
(multiline_string)
] @indent.ignore

View File

@ -1,5 +1,10 @@
[
(container_doc_comment)
(doc_comment)
(line_comment)
] @comment
((comment) @injection.content
(#set! injection.language "comment"))
; TODO: add when asm is added
; (asm_output_item (string) @injection.content
; (#set! injection.language "asm"))
; (asm_input_item (string) @injection.content
; (#set! injection.language "asm"))
; (asm_clobbers (string) @injection.content
; (#set! injection.language "asm"))