aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--queries/wit/folds.scm12
-rw-r--r--queries/wit/highlights.scm22
2 files changed, 30 insertions, 4 deletions
diff --git a/queries/wit/folds.scm b/queries/wit/folds.scm
new file mode 100644
index 000000000..7f84ddd2e
--- /dev/null
+++ b/queries/wit/folds.scm
@@ -0,0 +1,12 @@
+[
+ (world_items)
+ (world_body)
+ (interface_items)
+ (interface_body)
+] @fold
+
+(world_items
+ [
+ (use_item)
+ (import_item)
+ ])+ @fold
diff --git a/queries/wit/highlights.scm b/queries/wit/highlights.scm
index bc9b59bb0..1f4b01cce 100644
--- a/queries/wit/highlights.scm
+++ b/queries/wit/highlights.scm
@@ -4,7 +4,7 @@
(id)) @type
(package_decl
- (id)) @module
+ (id) @module)
(valid_semver) @string.special
@@ -38,7 +38,7 @@
alias: (id) @type.definition)
(func_item
- name: (id) @function)
+ name: (id) @function.method)
(handle
(id) @type)
@@ -62,7 +62,7 @@
name: (id) @type)
(variant_case
- name: (id) @type)
+ name: (id) @constant)
(enum_items
name: (id) @type)
@@ -74,17 +74,26 @@
name: (id) @type)
(resource_method
+ (id) @function.method)
+
+(resource_method
"constructor" @constructor)
(toplevel_use_item
"use" @keyword.import)
+(toplevel_use_item
+ alias: (id) @module)
+
(use_item
"use" @keyword.import)
(use_path
(id) @module)
+(use_names_item
+ (id) @module)
+
"func" @keyword.function
[
@@ -105,6 +114,7 @@
"include"
"import"
"export"
+ "as"
] @keyword.import
[
@@ -118,6 +128,8 @@
"s64"
"f32"
"f64"
+ "float32" ; deprecated
+ "float64" ; deprecated
"char"
"bool"
"string"
@@ -130,7 +142,7 @@
[
"@"
- "->"
+ "_"
] @punctuation.special
[
@@ -138,6 +150,8 @@
";"
":"
","
+ "."
+ "->"
] @punctuation.delimiter
[