aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzetashift2023-05-30 11:29:43 +0000
committerGitHub2023-05-30 11:29:43 +0000
commit92380540b858b66f247789e5270d61c9d1305033 (patch)
treee91a92bd648c9137fe4fb5ac50f0a4cbb9204318
parenta726799a4e2df9b5c050224d57cb7bcbc1141fa7 (diff)
chore: update scala tree-sitter grammar (#7147)
* chore: update scala tree-sitter grammar * Add locals.scm for Scala
-rw-r--r--languages.toml2
-rw-r--r--runtime/queries/scala/locals.scm29
2 files changed, 30 insertions, 1 deletions
diff --git a/languages.toml b/languages.toml
index 899cd43f..9e74bf7f 100644
--- a/languages.toml
+++ b/languages.toml
@@ -1229,7 +1229,7 @@ language-servers = [ "metals" ]
[[grammar]]
name = "scala"
-source = { git = "https://github.com/tree-sitter/tree-sitter-scala", rev = "f6bbf35de41653b409ca9a3537a154f2b095ef64" }
+source = { git = "https://github.com/tree-sitter/tree-sitter-scala", rev = "23d21310fe4ab4b3273e7a6810e781224a3e7fe1" }
[[language]]
name = "dockerfile"
diff --git a/runtime/queries/scala/locals.scm b/runtime/queries/scala/locals.scm
new file mode 100644
index 00000000..8eaa75ec
--- /dev/null
+++ b/runtime/queries/scala/locals.scm
@@ -0,0 +1,29 @@
+(template_body) @local.scope
+(lambda_expression) @local.scope
+
+
+(function_declaration
+ name: (identifier) @local.definition) @local.scope
+
+(function_definition
+ name: (identifier) @local.definition)
+
+(parameter
+ name: (identifier) @local.definition)
+
+(binding
+ name: (identifier) @local.definition)
+
+(val_definition
+ pattern: (identifier) @local.definition)
+
+(var_definition
+ pattern: (identifier) @local.definition)
+
+(val_declaration
+ name: (identifier) @local.definition)
+
+(var_declaration
+ name: (identifier) @local.definition)
+
+(identifier) @local.reference