nvim-treesitter/queries/java/locals.scm

41 lines
938 B
Scheme
Raw Normal View History

2020-06-17 18:01:53 +05:30
; CREDITS @maxbrunsfeld (maxbrunsfeld@gmail.com)
2020-07-19 17:41:24 +00:00
;(class_declaration
; name: (identifier) @name) @definticlass
2020-07-19 17:41:24 +00:00
;
;(method_declaration
; name: (identifier) @name) @method
;
;(method_invocation
; name: (identifier) @name) @call
2020-06-11 22:31:45 +05:30
2020-07-20 01:05:23 +05:30
; SCOPES
(class_declaration
body: (_)) @scope
2020-07-19 17:41:24 +00:00
(method_declaration) @scope
2020-07-20 01:15:09 +05:30
(block) @scope
2020-07-20 01:05:23 +05:30
; 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
2020-07-19 17:41:24 +00:00
(try_statement
body: (_) @scope)
(catch_clause) @scope
2020-06-11 22:31:45 +05:30
2020-07-20 01:05:23 +05:30
(for_statement) @scope
(do_statement) @scope
(while_statement) @scope
; DEFINITIONS
2020-07-19 17:41:24 +00:00
(class_declaration
name: (identifier) @definition.class)
2020-07-19 17:41:24 +00:00
(method_declaration
name: (identifier) @definition.method)
(local_variable_declaration) @definition.var
(field_declaration) @definition.field
(import_declaration) @definition.import