Skip to content
Draft
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
9 changes: 6 additions & 3 deletions queries/scala/locals.scm
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
(template_body) @local.scope
(lambda_expression) @local.scope

(block) @local.scope

(function_declaration
name: (identifier) @local.definition) @local.scope
name: (identifier) @local.definition)

(function_definition
name: (identifier) @local.definition)
name: (identifier) @local.definition) @local.scope

(parameter
name: (identifier) @local.definition)

(class_parameter
name: (identifier) @local.definition)

(binding
name: (identifier) @local.definition)

Expand Down
9 changes: 9 additions & 0 deletions test/highlight/parameter_scope.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def meth_with_params(localParam: Int) {
var ref_param = c"$localParam $meth_with_params"
// ^parameter
// ^method
}
var okay1 = s"hello"
var okay = c"$localParam $okay1"
// ^none
// ^variable