mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 03:10:04 -04:00
feat(wit): add folds, missing highlights
References: https://github.com/liamwh/tree-sitter-wit/blob/main/grammar.js79f3646325/crates/extension_api/wit/since_v0.0.4/extension.wit436ad58923/wit/mqtt.wita068bfe064/crates/wasi-nn/wit/wasi-nn.wit
This commit is contained in:
parent
067415e971
commit
14dff71d38
2 changed files with 30 additions and 4 deletions
12
queries/wit/folds.scm
Normal file
12
queries/wit/folds.scm
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
[
|
||||||
|
(world_items)
|
||||||
|
(world_body)
|
||||||
|
(interface_items)
|
||||||
|
(interface_body)
|
||||||
|
] @fold
|
||||||
|
|
||||||
|
(world_items
|
||||||
|
[
|
||||||
|
(use_item)
|
||||||
|
(import_item)
|
||||||
|
])+ @fold
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
[
|
[
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue