mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 09:50:04 -04:00
fix(java): add lambdas as a scope
This commit is contained in:
parent
ba3167a1a4
commit
7806b16cc2
1 changed files with 6 additions and 2 deletions
|
|
@ -6,6 +6,8 @@
|
||||||
(enum_declaration
|
(enum_declaration
|
||||||
body: (_) @scope)
|
body: (_) @scope)
|
||||||
(method_declaration) @scope ; whole method_declaration because arguments
|
(method_declaration) @scope ; whole method_declaration because arguments
|
||||||
|
(lambda_expression) @scope
|
||||||
|
(enhanced_for_statement) @scope
|
||||||
|
|
||||||
; block
|
; block
|
||||||
(block) @scope
|
(block) @scope
|
||||||
|
|
@ -38,8 +40,8 @@
|
||||||
|
|
||||||
|
|
||||||
; DEFINITIONS
|
; DEFINITIONS
|
||||||
(package_declaration
|
(package_declaration
|
||||||
(identifier) @definition.namespace)
|
(identifier) @definition.namespace)
|
||||||
(class_declaration
|
(class_declaration
|
||||||
name: (identifier) @definition.class)
|
name: (identifier) @definition.class)
|
||||||
(enum_declaration
|
(enum_declaration
|
||||||
|
|
@ -57,6 +59,8 @@
|
||||||
(inferred_parameters (identifier) @definition.var) ; (x,y) -> ...
|
(inferred_parameters (identifier) @definition.var) ; (x,y) -> ...
|
||||||
(lambda_expression
|
(lambda_expression
|
||||||
parameters: (identifier) @definition.var) ; x -> ...
|
parameters: (identifier) @definition.var) ; x -> ...
|
||||||
|
(enhanced_for_statement ; for (var item : items) {
|
||||||
|
name: (identifier) @definition.var)
|
||||||
|
|
||||||
((scoped_identifier
|
((scoped_identifier
|
||||||
(identifier) @definition.import)
|
(identifier) @definition.import)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue