mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
queries: update more grammars
This commit is contained in:
parent
b7656e0079
commit
b13999952f
@ -109,14 +109,15 @@
|
|||||||
(number) @constant.numeric
|
(number) @constant.numeric
|
||||||
(string) @string
|
(string) @string
|
||||||
|
|
||||||
(func_call name: (identifier) @function)
|
|
||||||
(func_def name: (identifier) @function)
|
|
||||||
|
|
||||||
(field_ref (_) @variable)
|
|
||||||
[
|
[
|
||||||
(identifier)
|
(identifier)
|
||||||
(field_ref)
|
(field_ref)
|
||||||
] @variable
|
] @variable
|
||||||
|
|
||||||
|
(func_call name: (identifier) @function)
|
||||||
|
(func_def name: (identifier) @function)
|
||||||
|
|
||||||
|
(field_ref (_) @variable)
|
||||||
|
|
||||||
(ns_qualified_name "::" @operator)
|
(ns_qualified_name "::" @operator)
|
||||||
(ns_qualified_name (namespace) @namespace)
|
(ns_qualified_name (namespace) @namespace)
|
||||||
|
@ -46,6 +46,9 @@
|
|||||||
|
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
|
|
||||||
|
((word) @constant.builtin.boolean
|
||||||
|
(#any-of? @constant.builtin.boolean "true" "false"))
|
||||||
|
|
||||||
(function_definition name: (word) @function)
|
(function_definition name: (word) @function)
|
||||||
|
|
||||||
(file_descriptor) @constant.numeric.integer
|
(file_descriptor) @constant.numeric.integer
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
|
||||||
|
(identifier) @variable
|
||||||
|
|
||||||
|
((identifier) @constant
|
||||||
|
(#match? @constant "^[A-Z][A-Z\\d_]*$"))
|
||||||
|
|
||||||
"sizeof" @keyword
|
"sizeof" @keyword
|
||||||
|
|
||||||
[
|
[
|
||||||
@ -109,6 +115,12 @@
|
|||||||
(char_literal) @constant.character
|
(char_literal) @constant.character
|
||||||
(escape_sequence) @constant.character.escape
|
(escape_sequence) @constant.character.escape
|
||||||
|
|
||||||
|
(field_identifier) @variable.other.member
|
||||||
|
(statement_identifier) @label
|
||||||
|
(type_identifier) @type
|
||||||
|
(primitive_type) @type.builtin
|
||||||
|
(sized_type_specifier) @type.builtin
|
||||||
|
|
||||||
(call_expression
|
(call_expression
|
||||||
function: (identifier) @function)
|
function: (identifier) @function)
|
||||||
(call_expression
|
(call_expression
|
||||||
@ -128,15 +140,4 @@
|
|||||||
(attribute
|
(attribute
|
||||||
name: (identifier) @attribute)
|
name: (identifier) @attribute)
|
||||||
|
|
||||||
(field_identifier) @variable.other.member
|
|
||||||
(statement_identifier) @label
|
|
||||||
(type_identifier) @type
|
|
||||||
(primitive_type) @type.builtin
|
|
||||||
(sized_type_specifier) @type.builtin
|
|
||||||
|
|
||||||
((identifier) @constant
|
|
||||||
(#match? @constant "^[A-Z][A-Z\\d_]*$"))
|
|
||||||
|
|
||||||
(identifier) @variable
|
|
||||||
|
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
|
@ -10,6 +10,14 @@
|
|||||||
|
|
||||||
(comment) @comment
|
(comment) @comment
|
||||||
|
|
||||||
|
;; other symbols
|
||||||
|
(sym_lit) @variable
|
||||||
|
|
||||||
|
;; other calls
|
||||||
|
(list_lit
|
||||||
|
.
|
||||||
|
(sym_lit) @function)
|
||||||
|
|
||||||
;; metadata experiment
|
;; metadata experiment
|
||||||
(meta_lit
|
(meta_lit
|
||||||
marker: "^" @punctuation)
|
marker: "^" @punctuation)
|
||||||
@ -61,20 +69,12 @@
|
|||||||
((sym_lit) @operator
|
((sym_lit) @operator
|
||||||
(#match? @operator "^%"))
|
(#match? @operator "^%"))
|
||||||
|
|
||||||
;; other calls
|
|
||||||
(list_lit
|
|
||||||
.
|
|
||||||
(sym_lit) @function)
|
|
||||||
|
|
||||||
;; interop-ish
|
;; interop-ish
|
||||||
(list_lit
|
(list_lit
|
||||||
.
|
.
|
||||||
(sym_lit) @function.method
|
(sym_lit) @function.method
|
||||||
(#match? @function.method "^\\."))
|
(#match? @function.method "^\\."))
|
||||||
|
|
||||||
;; other symbols
|
|
||||||
(sym_lit) @variable
|
|
||||||
|
|
||||||
;; quote
|
;; quote
|
||||||
(quoting_lit) @constant.character.escape
|
(quoting_lit) @constant.character.escape
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
; inherits: c
|
||||||
|
|
||||||
; Functions
|
; Functions
|
||||||
|
|
||||||
; These casts are parsed as function calls, but are not.
|
; These casts are parsed as function calls, but are not.
|
||||||
@ -132,5 +134,3 @@
|
|||||||
; Strings
|
; Strings
|
||||||
|
|
||||||
(raw_string_literal) @string
|
(raw_string_literal) @string
|
||||||
|
|
||||||
; inherits: c
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
(identifier) @variable
|
||||||
|
|
||||||
; Methods
|
; Methods
|
||||||
|
|
||||||
(method_declaration
|
(method_declaration
|
||||||
@ -54,8 +56,6 @@
|
|||||||
((identifier) @constant
|
((identifier) @constant
|
||||||
(#match? @constant "^_*[A-Z][A-Z\\d_]+$"))
|
(#match? @constant "^_*[A-Z][A-Z\\d_]+$"))
|
||||||
|
|
||||||
(identifier) @variable
|
|
||||||
|
|
||||||
(this) @variable.builtin
|
(this) @variable.builtin
|
||||||
|
|
||||||
; Literals
|
; Literals
|
||||||
|
@ -23,12 +23,16 @@
|
|||||||
(borrow_expression "&" @keyword.storage.modifier.ref)
|
(borrow_expression "&" @keyword.storage.modifier.ref)
|
||||||
(borrow_expression "&mut" @keyword.storage.modifier.mut)
|
(borrow_expression "&mut" @keyword.storage.modifier.mut)
|
||||||
|
|
||||||
|
(identifier) @variable
|
||||||
|
|
||||||
(constant_identifier) @constant
|
(constant_identifier) @constant
|
||||||
((identifier) @constant
|
((identifier) @constant
|
||||||
(#match? @constant "^[A-Z][A-Z\\d_]*$"))
|
(#match? @constant "^[A-Z][A-Z\\d_]*$"))
|
||||||
|
|
||||||
(function_identifier) @function
|
(function_identifier) @function
|
||||||
|
|
||||||
|
(primitive_type) @type.builtin
|
||||||
|
|
||||||
(struct_identifier) @type
|
(struct_identifier) @type
|
||||||
(pack_expression
|
(pack_expression
|
||||||
access: (module_access
|
access: (module_access
|
||||||
@ -152,6 +156,3 @@
|
|||||||
"with"
|
"with"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
(primitive_type) @type.buildin
|
|
||||||
|
|
||||||
(identifier) @variable
|
|
||||||
|
@ -3,13 +3,14 @@
|
|||||||
(boolean) @constant.builtin.boolean
|
(boolean) @constant.builtin.boolean
|
||||||
(include_path) @string.special.path
|
(include_path) @string.special.path
|
||||||
|
|
||||||
|
(identifier) @variable
|
||||||
|
|
||||||
(parameters_declaration (identifier) @variable.parameter)
|
(parameters_declaration (identifier) @variable.parameter)
|
||||||
(function_declaration name: (identifier) @function)
|
(function_declaration name: (identifier) @function)
|
||||||
|
|
||||||
(function_call function: (identifier) @function)
|
(function_call function: (identifier) @function)
|
||||||
(module_call name: (identifier) @function)
|
(module_call name: (identifier) @function)
|
||||||
|
|
||||||
(identifier) @variable
|
|
||||||
(special_variable) @variable.builtin
|
(special_variable) @variable.builtin
|
||||||
|
|
||||||
[
|
[
|
||||||
|
Loading…
Reference in New Issue
Block a user