ts-wasms 1.0.6 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -9
- package/index.d.ts +102 -0
- package/index.js +27 -0
- package/out/angular/folds.scm +1 -0
- package/out/angular/highlights.scm +178 -0
- package/out/angular/indents.scm +16 -0
- package/out/angular/injections.scm +1 -0
- package/out/angular/locals.scm +1 -0
- package/out/angular/tree-sitter-angular.wasm +0 -0
- package/out/asm/highlights.scm +66 -0
- package/out/asm/injections.scm +5 -0
- package/out/asm/tree-sitter-asm.wasm +0 -0
- package/out/astro/folds.scm +1 -0
- package/out/astro/highlights.scm +12 -0
- package/out/astro/indents.scm +1 -0
- package/out/astro/injections.scm +27 -0
- package/out/astro/locals.scm +1 -0
- package/out/astro/tree-sitter-astro.wasm +0 -0
- package/out/bash/folds.scm +9 -0
- package/out/bash/indents.scm +32 -0
- package/out/bash/injections.scm +90 -0
- package/out/bash/locals.scm +14 -0
- package/out/c/folds.scm +23 -0
- package/out/c/indents.scm +99 -0
- package/out/c/injections.scm +128 -0
- package/out/c/locals.scm +67 -0
- package/out/clojure/folds.scm +2 -0
- package/out/clojure/injections.scm +2 -0
- package/out/clojure/locals.scm +1 -0
- package/out/cmake/folds.scm +8 -0
- package/out/cmake/highlights.scm +221 -0
- package/out/cmake/indents.scm +26 -0
- package/out/cmake/injections.scm +5 -0
- package/out/cmake/tree-sitter-cmake.wasm +0 -0
- package/out/comment/highlights.scm +49 -0
- package/out/comment/tree-sitter-comment.wasm +0 -0
- package/out/commonlisp/folds.scm +2 -0
- package/out/commonlisp/highlights.scm +314 -0
- package/out/commonlisp/injections.scm +5 -0
- package/out/commonlisp/locals.scm +109 -0
- package/out/cpp/folds.scm +14 -0
- package/out/cpp/indents.scm +8 -0
- package/out/cpp/locals.scm +78 -0
- package/out/css/folds.scm +10 -0
- package/out/css/indents.scm +11 -0
- package/out/css/injections.scm +2 -0
- package/out/csv/highlights.scm +5 -0
- package/out/csv/tree-sitter-csv.wasm +0 -0
- package/out/csv-psv/highlights.scm +5 -0
- package/out/csv-psv/tree-sitter-csv-psv.wasm +0 -0
- package/out/csv-tsv/highlights.scm +4 -0
- package/out/csv-tsv/tree-sitter-csv-tsv.wasm +0 -0
- package/out/dart/indents.scm +49 -0
- package/out/dart/injections.scm +2 -0
- package/out/dart/locals.scm +32 -0
- package/out/diff/folds.scm +5 -0
- package/out/diff/highlights.scm +49 -0
- package/out/diff/injections.scm +2 -0
- package/out/diff/tree-sitter-diff.wasm +0 -0
- package/out/dockerfile/highlights.scm +58 -0
- package/out/dockerfile/injections.scm +12 -0
- package/out/dockerfile/tree-sitter-dockerfile.wasm +0 -0
- package/out/dtd/folds.scm +4 -0
- package/out/dtd/highlights.scm +148 -0
- package/out/dtd/injections.scm +2 -0
- package/out/dtd/locals.scm +11 -0
- package/out/editorconfig/folds.scm +1 -0
- package/out/editorconfig/highlights.scm +35 -0
- package/out/editorconfig/injections.scm +2 -0
- package/out/editorconfig/tree-sitter-editorconfig.wasm +0 -0
- package/out/elixir/folds.scm +10 -0
- package/out/elixir/indents.scm +25 -0
- package/out/elixir/locals.scm +200 -0
- package/out/elm/folds.scm +14 -0
- package/out/erlang/folds.scm +9 -0
- package/out/erlang/injections.scm +2 -0
- package/out/fish/folds.scm +8 -0
- package/out/fish/highlights.scm +61 -0
- package/out/fish/indents.scm +18 -0
- package/out/fish/injections.scm +2 -0
- package/out/fish/locals.scm +19 -0
- package/out/fish/tree-sitter-fish.wasm +0 -0
- package/out/gdscript/folds.scm +26 -0
- package/out/gdscript/highlights.scm +635 -0
- package/out/gdscript/indents.scm +78 -0
- package/out/gdscript/injections.scm +2 -0
- package/out/gdscript/locals.scm +121 -0
- package/out/gdscript/tree-sitter-gdscript.wasm +0 -0
- package/out/gdshader/highlights.scm +256 -0
- package/out/gdshader/injections.scm +2 -0
- package/out/gdshader/locals.scm +24 -0
- package/out/gdshader/tags.scm +13 -0
- package/out/gdshader/tree-sitter-gdshader.wasm +0 -0
- package/out/git-config/highlights.scm +28 -0
- package/out/git-config/tree-sitter-git-config.wasm +0 -0
- package/out/git-rebase/highlights.scm +36 -0
- package/out/git-rebase/tree-sitter-git-rebase.wasm +0 -0
- package/out/gitattributes/highlights.scm +52 -0
- package/out/gitattributes/injections.scm +2 -0
- package/out/gitattributes/locals.scm +8 -0
- package/out/gitattributes/tree-sitter-gitattributes.wasm +0 -0
- package/out/gitignore/highlights.scm +36 -0
- package/out/gitignore/injections.scm +2 -0
- package/out/gitignore/tree-sitter-gitignore.wasm +0 -0
- package/out/go/folds.scm +19 -0
- package/out/go/indents.scm +48 -0
- package/out/go/injections.scm +42 -0
- package/out/go/locals.scm +88 -0
- package/out/godot-resource/tree-sitter-godot-resource.wasm +0 -0
- package/out/graphql/highlights.scm +163 -0
- package/out/graphql/indents.scm +11 -0
- package/out/graphql/injections.scm +2 -0
- package/out/groovy/folds.scm +6 -0
- package/out/groovy/highlights.scm +148 -0
- package/out/groovy/indents.scm +23 -0
- package/out/groovy/injections.scm +5 -0
- package/out/groovy/locals.scm +6 -0
- package/out/groovy/tree-sitter-groovy.wasm +0 -0
- package/out/haskell/folds.scm +6 -0
- package/out/hcl/folds.scm +6 -0
- package/out/hcl/highlights.scm +118 -0
- package/out/hcl/indents.scm +16 -0
- package/out/hcl/injections.scm +6 -0
- package/out/html/folds.scm +5 -0
- package/out/html/indents.scm +1 -0
- package/out/html/locals.scm +1 -0
- package/out/ini/folds.scm +1 -0
- package/out/ini/highlights.scm +16 -0
- package/out/ini/injections.scm +3 -0
- package/out/ini/tree-sitter-ini.wasm +0 -0
- package/out/java/folds.scm +8 -0
- package/out/java/indents.scm +40 -0
- package/out/java/injections.scm +31 -0
- package/out/java/locals.scm +100 -0
- package/out/javascript/folds.scm +1 -0
- package/out/javascript/indents.scm +1 -0
- package/out/json/folds.scm +5 -0
- package/out/json/indents.scm +11 -0
- package/out/json/injections.scm +2 -0
- package/out/json/locals.scm +4 -0
- package/out/julia/folds.scm +14 -0
- package/out/julia/indents.scm +52 -0
- package/out/kotlin/folds.scm +13 -0
- package/out/kotlin/injections.scm +52 -0
- package/out/kotlin/locals.scm +78 -0
- package/out/lua/folds.scm +12 -0
- package/out/lua/indents.scm +47 -0
- package/out/markdown/folds.scm +12 -0
- package/out/markdown/indents.scm +1 -0
- package/out/matlab/folds.scm +13 -0
- package/out/matlab/highlights.scm +218 -0
- package/out/matlab/indents.scm +40 -0
- package/out/matlab/injections.scm +2 -0
- package/out/matlab/locals.scm +33 -0
- package/out/matlab/tree-sitter-matlab.wasm +0 -0
- package/out/nim/folds.scm +41 -0
- package/out/nim/highlights.scm +186 -0
- package/out/nim/injections.scm +79 -0
- package/out/nim/locals.scm +328 -0
- package/out/nim/tree-sitter-nim.wasm +0 -0
- package/out/nix/folds.scm +11 -0
- package/out/nix/indents.scm +75 -0
- package/out/ocaml/folds.scm +30 -0
- package/out/ocaml/indents.scm +77 -0
- package/out/ocaml/injections.scm +2 -0
- package/out/php/folds.scm +1 -0
- package/out/php/indents.scm +1 -0
- package/out/php/locals.scm +1 -0
- package/out/prisma/folds.scm +7 -0
- package/out/prisma/injections.scm +5 -0
- package/out/python/folds.scm +28 -0
- package/out/python/indents.scm +213 -0
- package/out/python/injections.scm +30 -0
- package/out/python/locals.scm +124 -0
- package/out/qmljs/folds.scm +8 -0
- package/out/qmljs/highlights.scm +61 -0
- package/out/qmljs/injections.scm +1 -0
- package/out/qmljs/locals.scm +6 -0
- package/out/qmljs/tree-sitter-qmljs.wasm +0 -0
- package/out/query/folds.scm +6 -0
- package/out/query/highlights.scm +102 -0
- package/out/query/indents.scm +25 -0
- package/out/query/injections.scm +28 -0
- package/out/query/locals.scm +21 -0
- package/out/r/indents.scm +33 -0
- package/out/r/injections.scm +2 -0
- package/out/racket/folds.scm +2 -0
- package/out/racket/injections.scm +5 -0
- package/out/ruby/folds.scm +12 -0
- package/out/ruby/indents.scm +43 -0
- package/out/ruby/injections.scm +34 -0
- package/out/rust/folds.scm +25 -0
- package/out/rust/indents.scm +133 -0
- package/out/rust/locals.scm +98 -0
- package/out/scala/folds.scm +16 -0
- package/out/scala/injections.scm +5 -0
- package/out/scheme/folds.scm +2 -0
- package/out/scheme/injections.scm +2 -0
- package/out/scss/folds.scm +1 -0
- package/out/scss/indents.scm +7 -0
- package/out/scss/injections.scm +2 -0
- package/out/sql/folds.scm +1 -0
- package/out/sql/highlights.scm +445 -0
- package/out/sql/indents.scm +27 -0
- package/out/sql/injections.scm +5 -0
- package/out/sql/tree-sitter-sql.wasm +0 -0
- package/out/terraform/folds.scm +1 -0
- package/out/terraform/highlights.scm +41 -0
- package/out/terraform/indents.scm +1 -0
- package/out/terraform/injections.scm +1 -0
- package/out/toml/folds.scm +5 -0
- package/out/toml/indents.scm +11 -0
- package/out/toml/injections.scm +2 -0
- package/out/toml/locals.scm +4 -0
- package/out/tsx/folds.scm +1 -0
- package/out/tsx/indents.scm +1 -0
- package/out/tsx/injections.scm +1 -0
- package/out/typescript/folds.scm +8 -0
- package/out/typescript/indents.scm +7 -0
- package/out/typescript/injections.scm +28 -0
- package/out/vim/folds.scm +4 -0
- package/out/vim/highlights.scm +362 -0
- package/out/vim/injections.scm +44 -0
- package/out/vim/locals.scm +19 -0
- package/out/vim/tree-sitter-vim.wasm +0 -0
- package/out/vimdoc/highlights.scm +74 -0
- package/out/vimdoc/injections.scm +4 -0
- package/out/vue/folds.scm +6 -0
- package/out/vue/highlights.scm +54 -0
- package/out/vue/indents.scm +7 -0
- package/out/vue/injections.scm +78 -0
- package/out/vue/tree-sitter-vue.wasm +0 -0
- package/out/xml/folds.scm +5 -0
- package/out/xml/highlights.scm +198 -0
- package/out/xml/indents.scm +16 -0
- package/out/xml/injections.scm +32 -0
- package/out/xml/locals.scm +35 -0
- package/out/yaml/folds.scm +4 -0
- package/out/yaml/highlights.scm +79 -0
- package/out/yaml/indents.scm +7 -0
- package/out/yaml/injections.scm +81 -0
- package/out/yaml/locals.scm +9 -0
- package/out/yaml/tree-sitter-yaml.wasm +0 -0
- package/out/zig/locals.scm +96 -0
- package/package.json +61 -19
- package/out/clojurescript/highlights.scm +0 -29
- package/out/clojurescript/tree-sitter-clojurescript.wasm +0 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
[
|
|
2
|
+
(import_from_statement)
|
|
3
|
+
(generator_expression)
|
|
4
|
+
(list_comprehension)
|
|
5
|
+
(set_comprehension)
|
|
6
|
+
(dictionary_comprehension)
|
|
7
|
+
(tuple_pattern)
|
|
8
|
+
(list_pattern)
|
|
9
|
+
(binary_operator)
|
|
10
|
+
(lambda)
|
|
11
|
+
(concatenated_string)
|
|
12
|
+
] @indent.begin
|
|
13
|
+
|
|
14
|
+
((list) @indent.align
|
|
15
|
+
(#set! indent.open_delimiter "[")
|
|
16
|
+
(#set! indent.close_delimiter "]"))
|
|
17
|
+
|
|
18
|
+
((dictionary) @indent.align
|
|
19
|
+
(#set! indent.open_delimiter "{")
|
|
20
|
+
(#set! indent.close_delimiter "}"))
|
|
21
|
+
|
|
22
|
+
((set) @indent.align
|
|
23
|
+
(#set! indent.open_delimiter "{")
|
|
24
|
+
(#set! indent.close_delimiter "}"))
|
|
25
|
+
|
|
26
|
+
((parenthesized_expression) @indent.align
|
|
27
|
+
(#set! indent.open_delimiter "(")
|
|
28
|
+
(#set! indent.close_delimiter ")"))
|
|
29
|
+
|
|
30
|
+
((for_statement) @indent.begin
|
|
31
|
+
(#set! indent.immediate 1))
|
|
32
|
+
|
|
33
|
+
((if_statement) @indent.begin
|
|
34
|
+
(#set! indent.immediate 1))
|
|
35
|
+
|
|
36
|
+
((while_statement) @indent.begin
|
|
37
|
+
(#set! indent.immediate 1))
|
|
38
|
+
|
|
39
|
+
((try_statement) @indent.begin
|
|
40
|
+
(#set! indent.immediate 1))
|
|
41
|
+
|
|
42
|
+
(ERROR
|
|
43
|
+
"try"
|
|
44
|
+
.
|
|
45
|
+
":"
|
|
46
|
+
(#set! indent.immediate 1)) @indent.begin
|
|
47
|
+
|
|
48
|
+
(ERROR
|
|
49
|
+
"try"
|
|
50
|
+
.
|
|
51
|
+
":"
|
|
52
|
+
(ERROR
|
|
53
|
+
(block
|
|
54
|
+
(expression_statement
|
|
55
|
+
(identifier) @_except) @indent.branch))
|
|
56
|
+
(#eq? @_except "except"))
|
|
57
|
+
|
|
58
|
+
((function_definition) @indent.begin
|
|
59
|
+
(#set! indent.immediate 1))
|
|
60
|
+
|
|
61
|
+
((class_definition) @indent.begin
|
|
62
|
+
(#set! indent.immediate 1))
|
|
63
|
+
|
|
64
|
+
((with_statement) @indent.begin
|
|
65
|
+
(#set! indent.immediate 1))
|
|
66
|
+
|
|
67
|
+
((match_statement) @indent.begin
|
|
68
|
+
(#set! indent.immediate 1))
|
|
69
|
+
|
|
70
|
+
((case_clause) @indent.begin
|
|
71
|
+
(#set! indent.immediate 1))
|
|
72
|
+
|
|
73
|
+
; if (cond1
|
|
74
|
+
; or cond2
|
|
75
|
+
; or cond3):
|
|
76
|
+
; pass
|
|
77
|
+
;
|
|
78
|
+
(if_statement
|
|
79
|
+
condition: (parenthesized_expression) @indent.align
|
|
80
|
+
(#lua-match? @indent.align "^%([^\n]")
|
|
81
|
+
(#set! indent.open_delimiter "(")
|
|
82
|
+
(#set! indent.close_delimiter ")")
|
|
83
|
+
(#set! indent.avoid_last_matching_next 1))
|
|
84
|
+
|
|
85
|
+
; while (
|
|
86
|
+
; cond1
|
|
87
|
+
; or cond2
|
|
88
|
+
; or cond3):
|
|
89
|
+
; pass
|
|
90
|
+
;
|
|
91
|
+
(while_statement
|
|
92
|
+
condition: (parenthesized_expression) @indent.align
|
|
93
|
+
(#lua-match? @indent.align "[^\n ]%)$")
|
|
94
|
+
(#set! indent.open_delimiter "(")
|
|
95
|
+
(#set! indent.close_delimiter ")")
|
|
96
|
+
(#set! indent.avoid_last_matching_next 1))
|
|
97
|
+
|
|
98
|
+
; if (
|
|
99
|
+
; cond1
|
|
100
|
+
; or cond2
|
|
101
|
+
; or cond3):
|
|
102
|
+
; pass
|
|
103
|
+
;
|
|
104
|
+
(if_statement
|
|
105
|
+
condition: (parenthesized_expression) @indent.align
|
|
106
|
+
(#lua-match? @indent.align "[^\n ]%)$")
|
|
107
|
+
(#set! indent.open_delimiter "(")
|
|
108
|
+
(#set! indent.close_delimiter ")")
|
|
109
|
+
(#set! indent.avoid_last_matching_next 1))
|
|
110
|
+
|
|
111
|
+
(ERROR
|
|
112
|
+
"(" @indent.align
|
|
113
|
+
(#set! indent.open_delimiter "(")
|
|
114
|
+
(#set! indent.close_delimiter ")")
|
|
115
|
+
.
|
|
116
|
+
(_))
|
|
117
|
+
|
|
118
|
+
((argument_list) @indent.align
|
|
119
|
+
(#set! indent.open_delimiter "(")
|
|
120
|
+
(#set! indent.close_delimiter ")"))
|
|
121
|
+
|
|
122
|
+
((parameters) @indent.align
|
|
123
|
+
(#set! indent.open_delimiter "(")
|
|
124
|
+
(#set! indent.close_delimiter ")"))
|
|
125
|
+
|
|
126
|
+
((parameters) @indent.align
|
|
127
|
+
(#lua-match? @indent.align "[^\n ]%)$")
|
|
128
|
+
(#set! indent.open_delimiter "(")
|
|
129
|
+
(#set! indent.close_delimiter ")")
|
|
130
|
+
(#set! indent.avoid_last_matching_next 1))
|
|
131
|
+
|
|
132
|
+
((tuple) @indent.align
|
|
133
|
+
(#set! indent.open_delimiter "(")
|
|
134
|
+
(#set! indent.close_delimiter ")"))
|
|
135
|
+
|
|
136
|
+
(ERROR
|
|
137
|
+
"[" @indent.align
|
|
138
|
+
(#set! indent.open_delimiter "[")
|
|
139
|
+
(#set! indent.close_delimiter "]")
|
|
140
|
+
.
|
|
141
|
+
(_))
|
|
142
|
+
|
|
143
|
+
(ERROR
|
|
144
|
+
"{" @indent.align
|
|
145
|
+
(#set! indent.open_delimiter "{")
|
|
146
|
+
(#set! indent.close_delimiter "}")
|
|
147
|
+
.
|
|
148
|
+
(_))
|
|
149
|
+
|
|
150
|
+
[
|
|
151
|
+
(break_statement)
|
|
152
|
+
(continue_statement)
|
|
153
|
+
] @indent.dedent
|
|
154
|
+
|
|
155
|
+
(ERROR
|
|
156
|
+
(_) @indent.branch
|
|
157
|
+
":"
|
|
158
|
+
.
|
|
159
|
+
(#lua-match? @indent.branch "^else"))
|
|
160
|
+
|
|
161
|
+
(ERROR
|
|
162
|
+
(_) @indent.branch @indent.dedent
|
|
163
|
+
":"
|
|
164
|
+
.
|
|
165
|
+
(#lua-match? @indent.branch "^elif"))
|
|
166
|
+
|
|
167
|
+
(generator_expression
|
|
168
|
+
")" @indent.end)
|
|
169
|
+
|
|
170
|
+
(list_comprehension
|
|
171
|
+
"]" @indent.end)
|
|
172
|
+
|
|
173
|
+
(set_comprehension
|
|
174
|
+
"}" @indent.end)
|
|
175
|
+
|
|
176
|
+
(dictionary_comprehension
|
|
177
|
+
"}" @indent.end)
|
|
178
|
+
|
|
179
|
+
(tuple_pattern
|
|
180
|
+
")" @indent.end)
|
|
181
|
+
|
|
182
|
+
(list_pattern
|
|
183
|
+
"]" @indent.end)
|
|
184
|
+
|
|
185
|
+
(return_statement
|
|
186
|
+
[
|
|
187
|
+
(_) @indent.end
|
|
188
|
+
(_
|
|
189
|
+
[
|
|
190
|
+
(_)
|
|
191
|
+
")"
|
|
192
|
+
"}"
|
|
193
|
+
"]"
|
|
194
|
+
] @indent.end .)
|
|
195
|
+
(attribute
|
|
196
|
+
attribute: (_) @indent.end)
|
|
197
|
+
(call
|
|
198
|
+
arguments: (_
|
|
199
|
+
")" @indent.end))
|
|
200
|
+
"return" @indent.end
|
|
201
|
+
] .)
|
|
202
|
+
|
|
203
|
+
[
|
|
204
|
+
")"
|
|
205
|
+
"]"
|
|
206
|
+
"}"
|
|
207
|
+
(elif_clause)
|
|
208
|
+
(else_clause)
|
|
209
|
+
(except_clause)
|
|
210
|
+
(finally_clause)
|
|
211
|
+
] @indent.branch
|
|
212
|
+
|
|
213
|
+
(string) @indent.auto
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
(call
|
|
2
|
+
function: (attribute
|
|
3
|
+
object: (identifier) @_re)
|
|
4
|
+
arguments: (argument_list
|
|
5
|
+
(string
|
|
6
|
+
(string_content) @injection.content))
|
|
7
|
+
(#eq? @_re "re")
|
|
8
|
+
(#set! injection.language "regex"))
|
|
9
|
+
|
|
10
|
+
(call
|
|
11
|
+
function: (attribute
|
|
12
|
+
object: (identifier) @_re)
|
|
13
|
+
arguments: (argument_list
|
|
14
|
+
(concatenated_string
|
|
15
|
+
[
|
|
16
|
+
(string
|
|
17
|
+
(string_content) @injection.content)
|
|
18
|
+
(comment)
|
|
19
|
+
]+))
|
|
20
|
+
(#eq? @_re "re")
|
|
21
|
+
(#set! injection.language "regex"))
|
|
22
|
+
|
|
23
|
+
((binary_operator
|
|
24
|
+
left: (string
|
|
25
|
+
(string_content) @injection.content)
|
|
26
|
+
operator: "%")
|
|
27
|
+
(#set! injection.language "printf"))
|
|
28
|
+
|
|
29
|
+
((comment) @injection.content
|
|
30
|
+
(#set! injection.language "comment"))
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
; Program structure
|
|
2
|
+
(module) @local.scope
|
|
3
|
+
|
|
4
|
+
(class_definition
|
|
5
|
+
body: (block
|
|
6
|
+
(expression_statement
|
|
7
|
+
(assignment
|
|
8
|
+
left: (identifier) @local.definition.field)))) @local.scope
|
|
9
|
+
|
|
10
|
+
(class_definition
|
|
11
|
+
body: (block
|
|
12
|
+
(expression_statement
|
|
13
|
+
(assignment
|
|
14
|
+
left: (_
|
|
15
|
+
(identifier) @local.definition.field))))) @local.scope
|
|
16
|
+
|
|
17
|
+
; Imports
|
|
18
|
+
(aliased_import
|
|
19
|
+
alias: (identifier) @local.definition.import) @local.scope
|
|
20
|
+
|
|
21
|
+
(import_statement
|
|
22
|
+
name: (dotted_name
|
|
23
|
+
(identifier) @local.definition.import)) @local.scope
|
|
24
|
+
|
|
25
|
+
(import_from_statement
|
|
26
|
+
name: (dotted_name
|
|
27
|
+
(identifier) @local.definition.import)) @local.scope
|
|
28
|
+
|
|
29
|
+
; Function with parameters, defines parameters
|
|
30
|
+
(parameters
|
|
31
|
+
(identifier) @local.definition.parameter)
|
|
32
|
+
|
|
33
|
+
(default_parameter
|
|
34
|
+
(identifier) @local.definition.parameter)
|
|
35
|
+
|
|
36
|
+
(typed_parameter
|
|
37
|
+
(identifier) @local.definition.parameter)
|
|
38
|
+
|
|
39
|
+
(typed_default_parameter
|
|
40
|
+
(identifier) @local.definition.parameter)
|
|
41
|
+
|
|
42
|
+
; *args parameter
|
|
43
|
+
(parameters
|
|
44
|
+
(list_splat_pattern
|
|
45
|
+
(identifier) @local.definition.parameter))
|
|
46
|
+
|
|
47
|
+
; **kwargs parameter
|
|
48
|
+
(parameters
|
|
49
|
+
(dictionary_splat_pattern
|
|
50
|
+
(identifier) @local.definition.parameter))
|
|
51
|
+
|
|
52
|
+
; Function defines function and scope
|
|
53
|
+
((function_definition
|
|
54
|
+
name: (identifier) @local.definition.function) @local.scope
|
|
55
|
+
(#set! definition.function.scope "parent"))
|
|
56
|
+
|
|
57
|
+
((class_definition
|
|
58
|
+
name: (identifier) @local.definition.type) @local.scope
|
|
59
|
+
(#set! definition.type.scope "parent"))
|
|
60
|
+
|
|
61
|
+
(class_definition
|
|
62
|
+
body: (block
|
|
63
|
+
(function_definition
|
|
64
|
+
name: (identifier) @local.definition.method)))
|
|
65
|
+
|
|
66
|
+
; Loops
|
|
67
|
+
; not a scope!
|
|
68
|
+
(for_statement
|
|
69
|
+
left: (pattern_list
|
|
70
|
+
(identifier) @local.definition.var))
|
|
71
|
+
|
|
72
|
+
(for_statement
|
|
73
|
+
left: (tuple_pattern
|
|
74
|
+
(identifier) @local.definition.var))
|
|
75
|
+
|
|
76
|
+
(for_statement
|
|
77
|
+
left: (identifier) @local.definition.var)
|
|
78
|
+
|
|
79
|
+
; not a scope!
|
|
80
|
+
;(while_statement) @local.scope
|
|
81
|
+
; for in list comprehension
|
|
82
|
+
(for_in_clause
|
|
83
|
+
left: (identifier) @local.definition.var)
|
|
84
|
+
|
|
85
|
+
(for_in_clause
|
|
86
|
+
left: (tuple_pattern
|
|
87
|
+
(identifier) @local.definition.var))
|
|
88
|
+
|
|
89
|
+
(for_in_clause
|
|
90
|
+
left: (pattern_list
|
|
91
|
+
(identifier) @local.definition.var))
|
|
92
|
+
|
|
93
|
+
(dictionary_comprehension) @local.scope
|
|
94
|
+
|
|
95
|
+
(list_comprehension) @local.scope
|
|
96
|
+
|
|
97
|
+
(set_comprehension) @local.scope
|
|
98
|
+
|
|
99
|
+
; Assignments
|
|
100
|
+
(assignment
|
|
101
|
+
left: (identifier) @local.definition.var)
|
|
102
|
+
|
|
103
|
+
(assignment
|
|
104
|
+
left: (pattern_list
|
|
105
|
+
(identifier) @local.definition.var))
|
|
106
|
+
|
|
107
|
+
(assignment
|
|
108
|
+
left: (tuple_pattern
|
|
109
|
+
(identifier) @local.definition.var))
|
|
110
|
+
|
|
111
|
+
(assignment
|
|
112
|
+
left: (attribute
|
|
113
|
+
(identifier)
|
|
114
|
+
(identifier) @local.definition.field))
|
|
115
|
+
|
|
116
|
+
; Walrus operator x := 1
|
|
117
|
+
(named_expression
|
|
118
|
+
(identifier) @local.definition.var)
|
|
119
|
+
|
|
120
|
+
(as_pattern
|
|
121
|
+
alias: (as_pattern_target) @local.definition.var)
|
|
122
|
+
|
|
123
|
+
; REFERENCES
|
|
124
|
+
(identifier) @local.reference
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
;;; Annotations
|
|
2
|
+
|
|
3
|
+
(ui_annotation
|
|
4
|
+
"@" @operator
|
|
5
|
+
type_name: [
|
|
6
|
+
(identifier) @attribute
|
|
7
|
+
(nested_identifier (identifier) @attribute)
|
|
8
|
+
])
|
|
9
|
+
|
|
10
|
+
;;; Properties
|
|
11
|
+
|
|
12
|
+
(ui_object_definition_binding
|
|
13
|
+
name: [
|
|
14
|
+
(identifier) @property
|
|
15
|
+
(nested_identifier (identifier) @property)
|
|
16
|
+
])
|
|
17
|
+
|
|
18
|
+
(ui_binding
|
|
19
|
+
name: [
|
|
20
|
+
(identifier) @property
|
|
21
|
+
(nested_identifier (identifier) @property)
|
|
22
|
+
])
|
|
23
|
+
|
|
24
|
+
;; locals query appears not working unless id: <ref> isn't a parameter.
|
|
25
|
+
(ui_binding
|
|
26
|
+
name: (identifier) @property
|
|
27
|
+
(#eq? @property "id")
|
|
28
|
+
value: (expression_statement (identifier) @variable.parameter))
|
|
29
|
+
|
|
30
|
+
(ui_property
|
|
31
|
+
name: (identifier) @property)
|
|
32
|
+
|
|
33
|
+
(ui_required
|
|
34
|
+
name: (identifier) @property)
|
|
35
|
+
|
|
36
|
+
(ui_list_property_type
|
|
37
|
+
["<" ">"] @punctuation.bracket)
|
|
38
|
+
|
|
39
|
+
;;; Signals
|
|
40
|
+
|
|
41
|
+
(ui_signal
|
|
42
|
+
name: (identifier) @function.signal)
|
|
43
|
+
|
|
44
|
+
(ui_signal_parameter
|
|
45
|
+
(identifier) @variable.parameter)
|
|
46
|
+
|
|
47
|
+
;;; Keywords
|
|
48
|
+
|
|
49
|
+
[
|
|
50
|
+
"as"
|
|
51
|
+
"component"
|
|
52
|
+
"default"
|
|
53
|
+
"final"
|
|
54
|
+
"import"
|
|
55
|
+
"on"
|
|
56
|
+
"pragma"
|
|
57
|
+
"property"
|
|
58
|
+
"readonly"
|
|
59
|
+
"required"
|
|
60
|
+
"signal"
|
|
61
|
+
] @keyword
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
; inherits: ecma
|
|
Binary file
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
(string) @string
|
|
2
|
+
|
|
3
|
+
(escape_sequence) @string.escape
|
|
4
|
+
|
|
5
|
+
(capture
|
|
6
|
+
(identifier) @type)
|
|
7
|
+
|
|
8
|
+
(predicate
|
|
9
|
+
name: (identifier) @function.call)
|
|
10
|
+
|
|
11
|
+
(named_node
|
|
12
|
+
name: (identifier) @variable)
|
|
13
|
+
|
|
14
|
+
(missing_node
|
|
15
|
+
name: (identifier) @variable)
|
|
16
|
+
|
|
17
|
+
(field_definition
|
|
18
|
+
name: (identifier) @variable.member)
|
|
19
|
+
|
|
20
|
+
(negated_field
|
|
21
|
+
"!" @operator
|
|
22
|
+
(identifier) @property)
|
|
23
|
+
|
|
24
|
+
(comment) @comment @spell
|
|
25
|
+
|
|
26
|
+
(quantifier) @operator
|
|
27
|
+
|
|
28
|
+
(predicate_type) @punctuation.special
|
|
29
|
+
|
|
30
|
+
"." @operator
|
|
31
|
+
|
|
32
|
+
[
|
|
33
|
+
"["
|
|
34
|
+
"]"
|
|
35
|
+
"("
|
|
36
|
+
")"
|
|
37
|
+
] @punctuation.bracket
|
|
38
|
+
|
|
39
|
+
[
|
|
40
|
+
":"
|
|
41
|
+
"/"
|
|
42
|
+
] @punctuation.delimiter
|
|
43
|
+
|
|
44
|
+
[
|
|
45
|
+
"@"
|
|
46
|
+
"#"
|
|
47
|
+
] @punctuation.special
|
|
48
|
+
|
|
49
|
+
(predicate
|
|
50
|
+
"." @punctuation.special)
|
|
51
|
+
|
|
52
|
+
"_" @character.special
|
|
53
|
+
|
|
54
|
+
"MISSING" @keyword
|
|
55
|
+
|
|
56
|
+
((parameters
|
|
57
|
+
(identifier) @number)
|
|
58
|
+
(#match? @number "^[-+]?[0-9]+(.[0-9]+)?$"))
|
|
59
|
+
|
|
60
|
+
((program
|
|
61
|
+
.
|
|
62
|
+
(comment)*
|
|
63
|
+
.
|
|
64
|
+
(comment) @keyword.import @nospell)
|
|
65
|
+
(#lua-match? @keyword.import "^;+ *inherits *:"))
|
|
66
|
+
|
|
67
|
+
((program
|
|
68
|
+
.
|
|
69
|
+
(comment)*
|
|
70
|
+
.
|
|
71
|
+
(comment) @keyword.directive @nospell)
|
|
72
|
+
(#lua-match? @keyword.directive "^;+ *extends *$"))
|
|
73
|
+
|
|
74
|
+
((comment) @keyword.directive @nospell
|
|
75
|
+
(#lua-match? @keyword.directive "^;+%s*format%-ignore%s*$"))
|
|
76
|
+
|
|
77
|
+
((predicate
|
|
78
|
+
name: (identifier) @_name
|
|
79
|
+
parameters: (parameters
|
|
80
|
+
.
|
|
81
|
+
(capture)?
|
|
82
|
+
.
|
|
83
|
+
(identifier) @property))
|
|
84
|
+
(#eq? @_name "set"))
|
|
85
|
+
|
|
86
|
+
((predicate
|
|
87
|
+
name: (identifier) @_name
|
|
88
|
+
parameters: (parameters
|
|
89
|
+
(string
|
|
90
|
+
"\"" @string
|
|
91
|
+
"\"" @string) @string.regexp))
|
|
92
|
+
(#any-of? @_name "match" "not-match" "vim-match" "not-vim-match" "lua-match" "not-lua-match"))
|
|
93
|
+
|
|
94
|
+
((predicate
|
|
95
|
+
name: (identifier) @_name
|
|
96
|
+
parameters: (parameters
|
|
97
|
+
(string
|
|
98
|
+
"\"" @string
|
|
99
|
+
"\"" @string) @string.regexp
|
|
100
|
+
.
|
|
101
|
+
(string) .))
|
|
102
|
+
(#any-of? @_name "gsub" "not-gsub"))
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[
|
|
2
|
+
(list)
|
|
3
|
+
(named_node)
|
|
4
|
+
(grouping)
|
|
5
|
+
(predicate)
|
|
6
|
+
"["
|
|
7
|
+
] @indent.begin
|
|
8
|
+
|
|
9
|
+
; ERROR node indents
|
|
10
|
+
(ERROR
|
|
11
|
+
"(") @indent.begin
|
|
12
|
+
|
|
13
|
+
"]" @indent.branch @indent.end
|
|
14
|
+
|
|
15
|
+
[
|
|
16
|
+
")"
|
|
17
|
+
"?"
|
|
18
|
+
"*"
|
|
19
|
+
"+"
|
|
20
|
+
] @indent.end
|
|
21
|
+
|
|
22
|
+
; Captures always mark the end of a node
|
|
23
|
+
; Because of that, mark it as indent.end
|
|
24
|
+
(capture
|
|
25
|
+
name: (identifier) @indent.end)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
((predicate
|
|
2
|
+
name: (identifier) @_name
|
|
3
|
+
parameters: (parameters
|
|
4
|
+
(string
|
|
5
|
+
(string_content) @injection.content)))
|
|
6
|
+
(#any-of? @_name "match" "not-match" "any-match" "vim-match" "not-vim-match" "any-vim-match")
|
|
7
|
+
(#set! injection.language "regex"))
|
|
8
|
+
|
|
9
|
+
((predicate
|
|
10
|
+
name: (identifier) @_name
|
|
11
|
+
parameters: (parameters
|
|
12
|
+
(string
|
|
13
|
+
(string_content) @injection.content)))
|
|
14
|
+
(#any-of? @_name "lua-match" "not-lua-match" "any-lua-match")
|
|
15
|
+
(#set! injection.language "luap"))
|
|
16
|
+
|
|
17
|
+
((predicate
|
|
18
|
+
name: (identifier) @_name
|
|
19
|
+
parameters: (parameters
|
|
20
|
+
(string
|
|
21
|
+
(string_content) @injection.content)
|
|
22
|
+
.
|
|
23
|
+
(string) .))
|
|
24
|
+
(#any-of? @_name "gsub" "not-gsub")
|
|
25
|
+
(#set! injection.language "luap"))
|
|
26
|
+
|
|
27
|
+
((comment) @injection.content
|
|
28
|
+
(#set! injection.language "comment"))
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
(program) @local.scope
|
|
2
|
+
|
|
3
|
+
(program
|
|
4
|
+
(named_node) @local.scope)
|
|
5
|
+
|
|
6
|
+
(program
|
|
7
|
+
(anonymous_node) @local.scope)
|
|
8
|
+
|
|
9
|
+
(program
|
|
10
|
+
(grouping) @local.scope)
|
|
11
|
+
|
|
12
|
+
(identifier) @local.reference
|
|
13
|
+
|
|
14
|
+
(named_node
|
|
15
|
+
(capture) @local.definition.var)
|
|
16
|
+
|
|
17
|
+
(anonymous_node
|
|
18
|
+
(capture) @local.definition.var)
|
|
19
|
+
|
|
20
|
+
(grouping
|
|
21
|
+
(capture) @local.definition.var)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[
|
|
2
|
+
(braced_expression)
|
|
3
|
+
(parenthesized_expression)
|
|
4
|
+
(call)
|
|
5
|
+
"if"
|
|
6
|
+
"else"
|
|
7
|
+
"while"
|
|
8
|
+
"repeat"
|
|
9
|
+
"for"
|
|
10
|
+
] @indent.begin
|
|
11
|
+
|
|
12
|
+
(binary_operator
|
|
13
|
+
rhs: (_) @_no_indent
|
|
14
|
+
(#not-kind-eq? @_no_indent function_definition)) @indent.begin
|
|
15
|
+
|
|
16
|
+
[
|
|
17
|
+
"}"
|
|
18
|
+
")"
|
|
19
|
+
] @indent.branch
|
|
20
|
+
|
|
21
|
+
((parameters
|
|
22
|
+
.
|
|
23
|
+
(parameter
|
|
24
|
+
name: (identifier))) @indent.align
|
|
25
|
+
(#set! indent.open_delimiter "(")
|
|
26
|
+
(#set! indent.close_delimiter ")"))
|
|
27
|
+
|
|
28
|
+
[
|
|
29
|
+
")"
|
|
30
|
+
"}"
|
|
31
|
+
] @indent.end
|
|
32
|
+
|
|
33
|
+
(comment) @indent.ignore
|