mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-06 21:40:03 -04:00
Java locals: use has-ancestor? to match imports
This commit is contained in:
parent
4a77ac78d0
commit
4f4c4ff6ef
1 changed files with 3 additions and 9 deletions
|
|
@ -58,15 +58,9 @@
|
|||
(lambda_expression
|
||||
parameters: (identifier) @definition.var) ; x -> ...
|
||||
|
||||
; we need submatch!
|
||||
; TODO: capture nested imports
|
||||
;(import_declaration
|
||||
;(scoped_identifier
|
||||
;((identifier) @definition.import)))
|
||||
;(import_declaration
|
||||
;(scoped_identifier
|
||||
;(scoped_identifier
|
||||
;((identifier) @definition.import))))
|
||||
((scoped_identifier
|
||||
(identifier) @definition.import)
|
||||
(has-ancestor? @definition.import import_declaration))
|
||||
|
||||
(field_declaration
|
||||
declarator: (variable_declarator
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue