Skip to content

Commit

Permalink
chore: update scala tree-sitter grammar (helix-editor#7147)
Browse files Browse the repository at this point in the history
* chore: update scala tree-sitter grammar

* Add locals.scm for Scala
  • Loading branch information
zetashift authored and mtoohey31 committed Jun 2, 2024
1 parent 39ed913 commit aac26b4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
29 changes: 29 additions & 0 deletions runtime/queries/scala/locals.scm
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit aac26b4

Please sign in to comment.