aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Kipp <ckipp@pm.me>2023-03-27 06:54:26 +0200
committerAmaan Qureshi <amaanq12@gmail.com>2023-03-27 06:48:21 -0400
commit25dd24ed0e3b4456b1987cdd744e261be5dc6c7c (patch)
tree26698abc58868c748491d8ac8dddac6bd7087685
parentfeat(kotlin): update queries from upstream changes (diff)
downloadnvim-treesitter-25dd24ed0e3b4456b1987cdd744e261be5dc6c7c.tar
nvim-treesitter-25dd24ed0e3b4456b1987cdd744e261be5dc6c7c.tar.gz
nvim-treesitter-25dd24ed0e3b4456b1987cdd744e261be5dc6c7c.tar.bz2
nvim-treesitter-25dd24ed0e3b4456b1987cdd744e261be5dc6c7c.tar.lz
nvim-treesitter-25dd24ed0e3b4456b1987cdd744e261be5dc6c7c.tar.xz
nvim-treesitter-25dd24ed0e3b4456b1987cdd744e261be5dc6c7c.tar.zst
nvim-treesitter-25dd24ed0e3b4456b1987cdd744e261be5dc6c7c.zip
feat(scala): add in local variables queries
This syncs the queries that were updated in https://github.com/tree-sitter/tree-sitter-scala/pull/196. Co-authored-by: ghostbuster91 <ghostbuster91@users.noreply.github.com>
-rw-r--r--queries/scala/locals.scm38
1 files changed, 38 insertions, 0 deletions
diff --git a/queries/scala/locals.scm b/queries/scala/locals.scm
new file mode 100644
index 000000000..70b4b7990
--- /dev/null
+++ b/queries/scala/locals.scm
@@ -0,0 +1,38 @@
+; Scopes
+
+[
+ (template_body)
+ (lambda_expression)
+ (function_declaration)
+] @scope
+
+; References
+
+(identifier) @reference
+
+; Definitions
+
+(function_declaration
+ name: (identifier) @definition.function)
+
+(function_definition
+ name: (identifier) @definition.function)
+
+(parameter
+ name: (identifier) @definition.parameter)
+
+(binding
+ name: (identifier) @definition.var)
+
+(val_definition
+ pattern: (identifier) @definition.var)
+
+(var_definition
+ pattern: (identifier) @definition.var)
+
+(val_declaration
+ name: (identifier) @definition.var)
+
+(var_declaration
+ name: (identifier) @definition.var)
+