Compare commits

...

2 commits

Author SHA1 Message Date
Bruno BELANYI b04cd92189 Add locals queries
All checks were successful
ci/woodpecker/push/check Pipeline was successful
Once again, treating module as function calls, since that's basically
what they are...
2024-04-14 13:00:17 +01:00
Bruno BELANYI 6d6d9fc03b Add test for multiple arguments in selection type 2024-04-14 13:00:17 +01:00
2 changed files with 43 additions and 0 deletions

14
queries/locals.scm Normal file
View file

@ -0,0 +1,14 @@
(module
(property
field: (identifier) @local.definition.parameter))
(map_expression
(property
field: (identifier) @local.definition.field))
(assignment
left: (identifier) @local.definition.var)
(identifier) @local.reference
; vim: sw=2 foldmethod=marker

View file

@ -197,6 +197,35 @@ foo = select(some_unknown_type("CONDITION"), {
(interpreted_string_literal))
(ERROR))
================================================================================
Select (multiple type arguments)
================================================================================
foo = select(release_variable("ONE", "TWO"), {
"d": "d2",
default: "f2",
})
--------------------------------------------------------------------------------
(source_file
(assignment
(identifier)
(operator)
(select_expression
(select_value
(selection_type)
(ERROR
(interpreted_string_literal))
(interpreted_string_literal))
(select_cases
(select_case
(interpreted_string_literal)
(interpreted_string_literal))
(select_case
(default)
(interpreted_string_literal))))))
================================================================================
Select as an identifier
================================================================================