mirror of
https://github.com/helix-editor/helix.git
synced 2025-10-06 00:13:28 +02:00
queries: Add locals.scm for C. Improve C parameter highlights (#13876)
This commit is contained in:
@@ -128,11 +128,36 @@
|
||||
(call_expression (argument_list (identifier) @variable))
|
||||
(function_declarator
|
||||
declarator: [(identifier) (field_identifier)] @function)
|
||||
|
||||
; Up to 6 layers of declarators
|
||||
(parameter_declaration
|
||||
declarator: (identifier) @variable.parameter)
|
||||
(parameter_declaration
|
||||
(pointer_declarator
|
||||
declarator: (identifier) @variable.parameter))
|
||||
(_
|
||||
(identifier) @variable.parameter))
|
||||
(parameter_declaration
|
||||
(_
|
||||
(_
|
||||
(identifier) @variable.parameter)))
|
||||
(parameter_declaration
|
||||
(_
|
||||
(_
|
||||
(_
|
||||
(identifier) @variable.parameter))))
|
||||
(parameter_declaration
|
||||
(_
|
||||
(_
|
||||
(_
|
||||
(_
|
||||
(identifier) @variable.parameter)))))
|
||||
(parameter_declaration
|
||||
(_
|
||||
(_
|
||||
(_
|
||||
(_
|
||||
(_
|
||||
(identifier) @variable.parameter))))))
|
||||
|
||||
(preproc_function_def
|
||||
name: (identifier) @function.special)
|
||||
|
||||
|
38
runtime/queries/c/locals.scm
Normal file
38
runtime/queries/c/locals.scm
Normal file
@@ -0,0 +1,38 @@
|
||||
;; Scopes
|
||||
(function_definition) @local.scope
|
||||
|
||||
;; Definitions
|
||||
|
||||
; Parameters
|
||||
; Up to 6 layers of declarators
|
||||
(parameter_declaration
|
||||
(identifier) @local.definition.variable.parameter)
|
||||
(parameter_declaration
|
||||
(_
|
||||
(identifier) @local.definition.variable.parameter))
|
||||
(parameter_declaration
|
||||
(_
|
||||
(_
|
||||
(identifier) @local.definition.variable.parameter)))
|
||||
(parameter_declaration
|
||||
(_
|
||||
(_
|
||||
(_
|
||||
(identifier) @local.definition.variable.parameter))))
|
||||
(parameter_declaration
|
||||
(_
|
||||
(_
|
||||
(_
|
||||
(_
|
||||
(identifier) @local.definition.variable.parameter)))))
|
||||
(parameter_declaration
|
||||
(_
|
||||
(_
|
||||
(_
|
||||
(_
|
||||
(_
|
||||
(identifier) @local.definition.variable.parameter))))))
|
||||
|
||||
;; References
|
||||
|
||||
(identifier) @local.reference
|
Reference in New Issue
Block a user