mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-19 20:00:07 -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
|
(lambda_expression
|
||||||
parameters: (identifier) @definition.var) ; x -> ...
|
parameters: (identifier) @definition.var) ; x -> ...
|
||||||
|
|
||||||
; we need submatch!
|
((scoped_identifier
|
||||||
; TODO: capture nested imports
|
(identifier) @definition.import)
|
||||||
;(import_declaration
|
(has-ancestor? @definition.import import_declaration))
|
||||||
;(scoped_identifier
|
|
||||||
;((identifier) @definition.import)))
|
|
||||||
;(import_declaration
|
|
||||||
;(scoped_identifier
|
|
||||||
;(scoped_identifier
|
|
||||||
;((identifier) @definition.import))))
|
|
||||||
|
|
||||||
(field_declaration
|
(field_declaration
|
||||||
declarator: (variable_declarator
|
declarator: (variable_declarator
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue