nvim-treesitter/runtime/queries/apex/locals.scm

68 lines
1.4 KiB
Scheme
Raw Normal View History

; declarations
(class_declaration) @local.scope
2024-01-06 15:05:50 +09:00
(method_declaration) @local.scope
2024-01-06 15:05:50 +09:00
(constructor_declaration) @local.scope
2024-01-06 15:05:50 +09:00
(enum_declaration) @local.scope
2024-01-06 15:05:50 +09:00
(enhanced_for_statement) @local.scope
; if/else
(if_statement) @local.scope
2024-01-06 15:05:50 +09:00
(if_statement
consequence: (_) @local.scope) ; if body in case there are no braces
2024-01-06 15:05:50 +09:00
(if_statement
alternative: (_) @local.scope) ; else body in case there are no braces
; try/catch
(try_statement) @local.scope ; covers try+catch, individual try and catch are covered by (block)
2024-01-06 15:05:50 +09:00
(catch_clause) @local.scope ; needed because `Exception` variable
; loops
(for_statement) @local.scope
2024-01-06 15:05:50 +09:00
(for_statement ; "for" body in case there are no braces
body: (_) @local.scope)
2024-01-06 15:05:50 +09:00
(do_statement
body: (_) @local.scope)
2024-01-06 15:05:50 +09:00
(while_statement
body: (_) @local.scope)
; Functions
(constructor_declaration) @local.scope
2024-01-06 15:05:50 +09:00
(method_declaration) @local.scope
2024-01-06 15:05:50 +09:00
; definitions
(enum_declaration
name: (identifier) @local.definition.enum)
(method_declaration
name: (identifier) @local.definition.method)
(local_variable_declaration
declarator: (variable_declarator
name: (identifier) @local.definition.var))
2024-01-06 15:05:50 +09:00
(enhanced_for_statement
name: (identifier) @local.definition.var)
(formal_parameter
name: (identifier) @local.definition.parameter)
(field_declaration
declarator: (variable_declarator
name: (identifier) @local.definition.field))
2024-01-06 15:05:50 +09:00
; REFERENCES
(identifier) @local.reference
(type_identifier) @local.reference