mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-21 12:50:09 -04:00
java locals.scm - add some more
This commit is contained in:
parent
6bdbca9d33
commit
1221c1bf53
1 changed files with 14 additions and 2 deletions
|
|
@ -9,14 +9,26 @@
|
||||||
;(method_invocation
|
;(method_invocation
|
||||||
; name: (identifier) @name) @call
|
; name: (identifier) @name) @call
|
||||||
|
|
||||||
|
; SCOPES
|
||||||
(class_declaration) @scope
|
(class_declaration) @scope
|
||||||
(method_declaration) @scope
|
(method_declaration) @scope
|
||||||
(if_statement) @scope
|
; 3 captures for `if` - if+else, if only, else only
|
||||||
(for_statement) @scope
|
(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
|
(try_statement
|
||||||
body: (_) @scope)
|
body: (_) @scope)
|
||||||
(catch_clause) @scope
|
(catch_clause) @scope
|
||||||
|
|
||||||
|
(for_statement) @scope
|
||||||
|
(do_statement) @scope
|
||||||
|
(while_statement) @scope
|
||||||
|
|
||||||
|
; DEFINITIONS
|
||||||
(class_declaration
|
(class_declaration
|
||||||
name: (identifier) @definition.type)
|
name: (identifier) @definition.type)
|
||||||
(method_declaration
|
(method_declaration
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue