nvim-treesitter/queries/java/locals.scm
Chinmay Dalal c2a529fb80
java locals.scm - add
def.var, def.field, def.import
2020-07-20 01:31:29 +05:30

40 lines
938 B
Scheme

; CREDITS @maxbrunsfeld (maxbrunsfeld@gmail.com)
;(class_declaration
; name: (identifier) @name) @definticlass
;
;(method_declaration
; name: (identifier) @name) @method
;
;(method_invocation
; name: (identifier) @name) @call
; SCOPES
(class_declaration
body: (_)) @scope
(method_declaration) @scope
(block) @scope
; 3 captures for `if` - if+else, if only, else only
(if_statement) @scope
(if_statement
body: (_)) @scope
(if_statement
alternative: (_)) @scope
; 3 captures for`try` - try+catch, try only, catch only
(try_statement) @scope
(try_statement
body: (_) @scope)
(catch_clause) @scope
(for_statement) @scope
(do_statement) @scope
(while_statement) @scope
; DEFINITIONS
(class_declaration
name: (identifier) @definition.class)
(method_declaration
name: (identifier) @definition.method)
(local_variable_declaration) @definition.var
(field_declaration) @definition.field
(import_declaration) @definition.import