2020-07-20 01:05:23 +05:30
|
|
|
; SCOPES
|
2020-07-20 01:25:29 +05:30
|
|
|
(class_declaration
|
2020-07-20 18:31:31 +05:30
|
|
|
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
|
2020-07-20 17:07:12 +05:30
|
|
|
(if_statement) @scope
|
2020-07-20 01:05:23 +05:30
|
|
|
(if_statement
|
2020-07-20 18:31:44 +05:30
|
|
|
body: (_) @scope)
|
2020-07-20 01:05:23 +05:30
|
|
|
(if_statement
|
2020-07-20 18:31:54 +05:30
|
|
|
alternative: (_) @scope)
|
2020-07-20 01:05:23 +05:30
|
|
|
; 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
|
2020-07-20 01:25:29 +05:30
|
|
|
name: (identifier) @definition.class)
|
2020-07-19 17:41:24 +00:00
|
|
|
(method_declaration
|
|
|
|
|
name: (identifier) @definition.method)
|
2020-07-20 17:07:12 +05:30
|
|
|
(local_variable_declaration
|
|
|
|
|
declarator: (variable_declarator
|
|
|
|
|
name: (identifier) @definition.var))
|
|
|
|
|
(field_declaration
|
|
|
|
|
declarator: (variable_declarator
|
|
|
|
|
name: (identifier) @definition.field))
|
2020-07-20 01:31:29 +05:30
|
|
|
(import_declaration) @definition.import
|
2020-07-20 12:34:33 +05:30
|
|
|
|
2020-07-20 17:07:12 +05:30
|
|
|
; REFERENCES
|
2020-07-20 12:34:33 +05:30
|
|
|
(identifier) @reference
|
|
|
|
|
(type_identifier) @reference
|