Riley Bruins 2024-07-07 09:52:43 -07:00 committed by Christian Clason
parent 067415e971
commit 14dff71d38
2 changed files with 30 additions and 4 deletions

12
queries/wit/folds.scm Normal file
View file

@ -0,0 +1,12 @@
[
(world_items)
(world_body)
(interface_items)
(interface_body)
] @fold
(world_items
[
(use_item)
(import_item)
])+ @fold

View file

@ -4,7 +4,7 @@
(id)) @type (id)) @type
(package_decl (package_decl
(id)) @module (id) @module)
(valid_semver) @string.special (valid_semver) @string.special
@ -38,7 +38,7 @@
alias: (id) @type.definition) alias: (id) @type.definition)
(func_item (func_item
name: (id) @function) name: (id) @function.method)
(handle (handle
(id) @type) (id) @type)
@ -62,7 +62,7 @@
name: (id) @type) name: (id) @type)
(variant_case (variant_case
name: (id) @type) name: (id) @constant)
(enum_items (enum_items
name: (id) @type) name: (id) @type)
@ -73,18 +73,27 @@
(resource_item (resource_item
name: (id) @type) name: (id) @type)
(resource_method
(id) @function.method)
(resource_method (resource_method
"constructor" @constructor) "constructor" @constructor)
(toplevel_use_item (toplevel_use_item
"use" @keyword.import) "use" @keyword.import)
(toplevel_use_item
alias: (id) @module)
(use_item (use_item
"use" @keyword.import) "use" @keyword.import)
(use_path (use_path
(id) @module) (id) @module)
(use_names_item
(id) @module)
"func" @keyword.function "func" @keyword.function
[ [
@ -105,6 +114,7 @@
"include" "include"
"import" "import"
"export" "export"
"as"
] @keyword.import ] @keyword.import
[ [
@ -118,6 +128,8 @@
"s64" "s64"
"f32" "f32"
"f64" "f64"
"float32" ; deprecated
"float64" ; deprecated
"char" "char"
"bool" "bool"
"string" "string"
@ -130,7 +142,7 @@
[ [
"@" "@"
"->" "_"
] @punctuation.special ] @punctuation.special
[ [
@ -138,6 +150,8 @@
";" ";"
":" ":"
"," ","
"."
"->"
] @punctuation.delimiter ] @punctuation.delimiter
[ [