aboutsummaryrefslogtreecommitdiff
path: root/runtime/queries/gleam
diff options
context:
space:
mode:
authorMichael Davis2022-05-17 19:31:39 +0000
committerBlaž Hrastnik2022-05-25 12:26:26 +0000
commit45dd54082e4dde74b7d344c6bb8a4ff2a09e627e (patch)
tree8916cd51427344aef34dcd30d16b048af42b680c /runtime/queries/gleam
parent10463fe32c789f49c65d53c9d22621e415a854ea (diff)
update Gleam grammar and queries
With respect to the queries: The locals scope for functions was not large enough, so a function's parameter could outlive the function body. To fix it, we just widen the scope to the `function` node. See also https://github.com/gleam-lang/tree-sitter-gleam/issues/25 With respect to the parser: An external scanner has been added that fixes the parsing of strings. Previously, a comment inside a string would act like a comment rather than string contents. See also https://github.com/gleam-lang/tree-sitter-gleam/issues/14#issuecomment-1129263640 A new constructor node has been added as well which makes type highlighting more fine grained. See also https://github.com/gleam-lang/tree-sitter-gleam/pull/29
Diffstat (limited to 'runtime/queries/gleam')
-rw-r--r--runtime/queries/gleam/highlights.scm5
-rw-r--r--runtime/queries/gleam/locals.scm2
2 files changed, 6 insertions, 1 deletions
diff --git a/runtime/queries/gleam/highlights.scm b/runtime/queries/gleam/highlights.scm
index ed3fceca..8cff6b51 100644
--- a/runtime/queries/gleam/highlights.scm
+++ b/runtime/queries/gleam/highlights.scm
@@ -12,6 +12,8 @@
(import alias: (identifier) @namespace)
(remote_type_identifier
module: (identifier) @namespace)
+(remote_constructor_name
+ module: (identifier) @namespace)
((field_access
record: (identifier) @namespace
field: (label) @function)
@@ -45,6 +47,9 @@
(remote_type_identifier) @type
(type_identifier) @type
+; Data constructors
+(constructor_name) @constructor
+
; Literals
(string) @string
(bit_string_segment_option) @function.builtin
diff --git a/runtime/queries/gleam/locals.scm b/runtime/queries/gleam/locals.scm
index bd5903e5..49300573 100644
--- a/runtime/queries/gleam/locals.scm
+++ b/runtime/queries/gleam/locals.scm
@@ -1,5 +1,5 @@
; Scopes
-(function_body) @local.scope
+(function) @local.scope
(case_clause) @local.scope