Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update scala tree-sitter grammar #7147

Merged
merged 2 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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