use `function` node as a scope rather than `function_body` (#26)

pull/315/head
Michael Davis 2022-05-17 15:43:45 +07:00 committed by GitHub
parent 6e2e92b4ad
commit ec0286fd84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

@ -1,5 +1,5 @@
; Scopes
(function_body) @local.scope
(function) @local.scope
(case_clause) @local.scope

@ -68,6 +68,13 @@ fn trial(uri) {
}
}
fn my_uri_to_string(my_uri) -> String {
uri.to_string(my_uri)
// <- module
// ^ function
// ^ variable.parameter
}
fn myfun(argument) {
let local_fun = fn(x) { x + 1 }
// ^ variable