diff options
| author | Steven Sojka <steelsojka@gmail.com> | 2020-08-12 10:41:31 -0500 |
|---|---|---|
| committer | Thomas Vigouroux <39092278+vigoux@users.noreply.github.com> | 2020-08-12 21:20:54 +0200 |
| commit | 7806b16cc2810e3f1d3ee4281d0c4e95f48be2ad (patch) | |
| tree | 22a893d79ce5a6db22b6f5d654ccab22ee76490b | |
| parent | perf: cache parser file list for performance (diff) | |
| download | nvim-treesitter-7806b16cc2810e3f1d3ee4281d0c4e95f48be2ad.tar nvim-treesitter-7806b16cc2810e3f1d3ee4281d0c4e95f48be2ad.tar.gz nvim-treesitter-7806b16cc2810e3f1d3ee4281d0c4e95f48be2ad.tar.bz2 nvim-treesitter-7806b16cc2810e3f1d3ee4281d0c4e95f48be2ad.tar.lz nvim-treesitter-7806b16cc2810e3f1d3ee4281d0c4e95f48be2ad.tar.xz nvim-treesitter-7806b16cc2810e3f1d3ee4281d0c4e95f48be2ad.tar.zst nvim-treesitter-7806b16cc2810e3f1d3ee4281d0c4e95f48be2ad.zip | |
fix(java): add lambdas as a scope
| -rw-r--r-- | queries/java/locals.scm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/queries/java/locals.scm b/queries/java/locals.scm index b52de8152..6290334b7 100644 --- a/queries/java/locals.scm +++ b/queries/java/locals.scm @@ -6,6 +6,8 @@ (enum_declaration body: (_) @scope) (method_declaration) @scope ; whole method_declaration because arguments +(lambda_expression) @scope +(enhanced_for_statement) @scope ; block (block) @scope @@ -38,8 +40,8 @@ ; DEFINITIONS - (package_declaration - (identifier) @definition.namespace) +(package_declaration + (identifier) @definition.namespace) (class_declaration name: (identifier) @definition.class) (enum_declaration @@ -57,6 +59,8 @@ (inferred_parameters (identifier) @definition.var) ; (x,y) -> ... (lambda_expression parameters: (identifier) @definition.var) ; x -> ... +(enhanced_for_statement ; for (var item : items) { + name: (identifier) @definition.var) ((scoped_identifier (identifier) @definition.import) |
