Update generated neovim config
This commit is contained in:
@ -1,177 +1,5 @@
|
||||
; Methods
|
||||
; --------------------
|
||||
|
||||
; NOTE: This query is a bit of a work around for the fact that the dart grammar doesn't
|
||||
; specifically identify a node as a function call
|
||||
(((identifier) @function (#match? @function "^_?[a-z]"))
|
||||
. (selector . (argument_part))) @function
|
||||
|
||||
; Annotations
|
||||
; --------------------
|
||||
(annotation
|
||||
name: (identifier) @attribute)
|
||||
|
||||
; Operators and Tokens
|
||||
; --------------------
|
||||
(template_substitution
|
||||
"$" @punctuation.special
|
||||
"{" @punctuation.special
|
||||
"}" @punctuation.special
|
||||
) @none
|
||||
|
||||
(template_substitution
|
||||
"$" @punctuation.special
|
||||
(identifier_dollar_escaped) @variable
|
||||
) @none
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
(type_arguments
|
||||
"<" @punctuation.bracket
|
||||
">" @punctuation.bracket)
|
||||
|
||||
(type_parameters
|
||||
"<" @punctuation.bracket
|
||||
">" @punctuation.bracket)
|
||||
|
||||
[
|
||||
"@"
|
||||
"=>"
|
||||
".."
|
||||
"??"
|
||||
"=="
|
||||
"?"
|
||||
":"
|
||||
"&&"
|
||||
"%"
|
||||
"<"
|
||||
">"
|
||||
"="
|
||||
">="
|
||||
"<="
|
||||
"||"
|
||||
"~/"
|
||||
(increment_operator)
|
||||
(is_operator)
|
||||
(prefix_operator)
|
||||
(equality_operator)
|
||||
(additive_operator)
|
||||
] @operator
|
||||
|
||||
; Delimiters
|
||||
; --------------------
|
||||
[
|
||||
";"
|
||||
"."
|
||||
","
|
||||
] @punctuation.delimiter
|
||||
|
||||
; Types
|
||||
; --------------------
|
||||
((type_identifier) @type.builtin
|
||||
(#match? @type.builtin "^(int|double|String|bool|List|Set|Map|Runes|Symbol)$"))
|
||||
(type_identifier) @type
|
||||
(class_definition
|
||||
name: (identifier) @type)
|
||||
(constructor_signature
|
||||
name: (identifier) @type)
|
||||
(scoped_identifier
|
||||
scope: (identifier) @type)
|
||||
(function_signature
|
||||
name: (identifier) @function)
|
||||
(getter_signature
|
||||
(identifier) @function)
|
||||
(setter_signature
|
||||
name: (identifier) @function)
|
||||
(type_identifier) @type
|
||||
|
||||
((scoped_identifier
|
||||
scope: (identifier) @type
|
||||
name: (identifier) @type)
|
||||
(#match? @type "^[a-zA-Z]"))
|
||||
|
||||
; Enums
|
||||
; -------------------
|
||||
(enum_declaration
|
||||
name: (identifier) @type)
|
||||
(enum_constant
|
||||
name: (identifier) @identifier.constant)
|
||||
|
||||
; Variables
|
||||
; --------------------
|
||||
; var keyword
|
||||
(inferred_type) @keyword
|
||||
|
||||
((identifier) @type
|
||||
(#match? @type "^_?[A-Z].*[a-z]"))
|
||||
|
||||
("Function" @type)
|
||||
|
||||
(this) @variable.builtin
|
||||
|
||||
; properties
|
||||
((selector
|
||||
(unconditional_assignable_selector (identifier) @function))
|
||||
(selector (argument_part (arguments)))
|
||||
)
|
||||
|
||||
(cascade_section
|
||||
(cascade_selector (identifier) @function)
|
||||
(argument_part (arguments))
|
||||
)
|
||||
|
||||
(unconditional_assignable_selector
|
||||
(identifier) @property)
|
||||
|
||||
(conditional_assignable_selector
|
||||
(identifier) @property)
|
||||
|
||||
(cascade_section
|
||||
(cascade_selector
|
||||
(identifier) @property))
|
||||
|
||||
; assignments
|
||||
(assignment_expression
|
||||
left: (assignable_expression) @variable)
|
||||
|
||||
(this) @variable.builtin
|
||||
|
||||
; Parameters
|
||||
; --------------------
|
||||
(formal_parameter
|
||||
name: (identifier) @identifier.parameter)
|
||||
|
||||
(named_argument
|
||||
(label (identifier) @identifier.parameter))
|
||||
|
||||
; Literals
|
||||
; --------------------
|
||||
[
|
||||
(hex_integer_literal)
|
||||
(decimal_integer_literal)
|
||||
(decimal_floating_point_literal)
|
||||
; TODO: inaccessbile nodes
|
||||
; (octal_integer_literal)
|
||||
; (hex_floating_point_literal)
|
||||
] @number
|
||||
|
||||
(string_literal) @string
|
||||
(symbol_literal (identifier) @constant) @constant
|
||||
(true) @boolean
|
||||
(false) @boolean
|
||||
(null_literal) @constant.null
|
||||
|
||||
(documentation_comment) @comment
|
||||
(comment) @comment
|
||||
; Variable
|
||||
(identifier) @variable
|
||||
|
||||
; Keywords
|
||||
; --------------------
|
||||
@ -242,5 +70,177 @@
|
||||
"yield"
|
||||
] @keyword
|
||||
|
||||
; Variable
|
||||
(identifier) @variable
|
||||
; Methods
|
||||
; --------------------
|
||||
|
||||
; NOTE: This query is a bit of a work around for the fact that the dart grammar doesn't
|
||||
; specifically identify a node as a function call
|
||||
(((identifier) @function (#match? @function "^_?[a-z]"))
|
||||
. (selector . (argument_part))) @function
|
||||
|
||||
; Annotations
|
||||
; --------------------
|
||||
(annotation
|
||||
name: (identifier) @attribute)
|
||||
|
||||
; Operators and Tokens
|
||||
; --------------------
|
||||
(template_substitution
|
||||
"$" @punctuation.special
|
||||
"{" @punctuation.special
|
||||
"}" @punctuation.special
|
||||
) @none
|
||||
|
||||
(template_substitution
|
||||
"$" @punctuation.special
|
||||
(identifier_dollar_escaped) @variable
|
||||
) @none
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
[
|
||||
"@"
|
||||
"=>"
|
||||
".."
|
||||
"??"
|
||||
"=="
|
||||
"?"
|
||||
":"
|
||||
"&&"
|
||||
"%"
|
||||
"<"
|
||||
">"
|
||||
"="
|
||||
">="
|
||||
"<="
|
||||
"||"
|
||||
"~/"
|
||||
(increment_operator)
|
||||
(is_operator)
|
||||
(prefix_operator)
|
||||
(equality_operator)
|
||||
(additive_operator)
|
||||
] @operator
|
||||
|
||||
(type_arguments
|
||||
"<" @punctuation.bracket
|
||||
">" @punctuation.bracket)
|
||||
|
||||
(type_parameters
|
||||
"<" @punctuation.bracket
|
||||
">" @punctuation.bracket)
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
; Delimiters
|
||||
; --------------------
|
||||
[
|
||||
";"
|
||||
"."
|
||||
","
|
||||
] @punctuation.delimiter
|
||||
|
||||
; Types
|
||||
; --------------------
|
||||
(type_identifier) @type
|
||||
((type_identifier) @type.builtin
|
||||
(#match? @type.builtin "^(int|double|String|bool|List|Set|Map|Runes|Symbol)$"))
|
||||
(class_definition
|
||||
name: (identifier) @type)
|
||||
(constructor_signature
|
||||
name: (identifier) @type)
|
||||
(scoped_identifier
|
||||
scope: (identifier) @type)
|
||||
(function_signature
|
||||
name: (identifier) @function)
|
||||
(getter_signature
|
||||
(identifier) @function)
|
||||
(setter_signature
|
||||
name: (identifier) @function)
|
||||
|
||||
((scoped_identifier
|
||||
scope: (identifier) @type
|
||||
name: (identifier) @type)
|
||||
(#match? @type "^[a-zA-Z]"))
|
||||
|
||||
; Enums
|
||||
; -------------------
|
||||
(enum_declaration
|
||||
name: (identifier) @type)
|
||||
(enum_constant
|
||||
name: (identifier) @identifier.constant)
|
||||
|
||||
; Variables
|
||||
; --------------------
|
||||
; var keyword
|
||||
(inferred_type) @keyword
|
||||
|
||||
((identifier) @type
|
||||
(#match? @type "^_?[A-Z].*[a-z]"))
|
||||
|
||||
("Function" @type)
|
||||
|
||||
(this) @variable.builtin
|
||||
|
||||
; properties
|
||||
|
||||
(unconditional_assignable_selector
|
||||
(identifier) @property)
|
||||
|
||||
(conditional_assignable_selector
|
||||
(identifier) @property)
|
||||
|
||||
(cascade_section
|
||||
(cascade_selector
|
||||
(identifier) @property))
|
||||
|
||||
((selector
|
||||
(unconditional_assignable_selector (identifier) @function))
|
||||
(selector (argument_part (arguments)))
|
||||
)
|
||||
|
||||
(cascade_section
|
||||
(cascade_selector (identifier) @function)
|
||||
(argument_part (arguments))
|
||||
)
|
||||
|
||||
; assignments
|
||||
(assignment_expression
|
||||
left: (assignable_expression) @variable)
|
||||
|
||||
(this) @variable.builtin
|
||||
|
||||
; Parameters
|
||||
; --------------------
|
||||
(formal_parameter
|
||||
name: (identifier) @identifier.parameter)
|
||||
|
||||
(named_argument
|
||||
(label (identifier) @identifier.parameter))
|
||||
|
||||
; Literals
|
||||
; --------------------
|
||||
[
|
||||
(hex_integer_literal)
|
||||
(decimal_integer_literal)
|
||||
(decimal_floating_point_literal)
|
||||
; TODO: inaccessbile nodes
|
||||
; (octal_integer_literal)
|
||||
; (hex_floating_point_literal)
|
||||
] @number
|
||||
|
||||
(string_literal) @string
|
||||
(symbol_literal (identifier) @constant) @constant
|
||||
(true) @boolean
|
||||
(false) @boolean
|
||||
(null_literal) @constant.null
|
||||
|
||||
(documentation_comment) @comment
|
||||
(comment) @comment
|
||||
|
||||
Reference in New Issue
Block a user