From 6d6d9fc03b0c1440eb032a0e2a7924928a58de56 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 13 Apr 2024 18:44:14 +0100 Subject: [PATCH 1/2] Add test for multiple arguments in selection type --- test/corpus/select.txt | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/corpus/select.txt b/test/corpus/select.txt index ce291fd..166463a 100644 --- a/test/corpus/select.txt +++ b/test/corpus/select.txt @@ -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 ================================================================================ From b04cd92189b6bc7b17edd9528a9a219521801bed Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 13 Apr 2024 18:59:21 +0100 Subject: [PATCH 2/2] Add locals queries Once again, treating module as function calls, since that's basically what they are... --- queries/locals.scm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 queries/locals.scm diff --git a/queries/locals.scm b/queries/locals.scm new file mode 100644 index 0000000..7efe573 --- /dev/null +++ b/queries/locals.scm @@ -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