tm-grammars 0.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.
Files changed (181) hide show
  1. package/LICENSE +22 -0
  2. package/NOTICE +6565 -0
  3. package/README.md +211 -0
  4. package/grammars/abap.json +380 -0
  5. package/grammars/actionscript-3.json +951 -0
  6. package/grammars/ada.json +3874 -0
  7. package/grammars/apache.json +562 -0
  8. package/grammars/apex.json +3203 -0
  9. package/grammars/apl.json +1479 -0
  10. package/grammars/applescript.json +1406 -0
  11. package/grammars/ara.json +428 -0
  12. package/grammars/asm.json +1741 -0
  13. package/grammars/astro.json +776 -0
  14. package/grammars/awk.json +388 -0
  15. package/grammars/ballerina.json +3768 -0
  16. package/grammars/bat.json +783 -0
  17. package/grammars/beancount.json +831 -0
  18. package/grammars/berry.json +172 -0
  19. package/grammars/bibtex.json +315 -0
  20. package/grammars/bicep.json +239 -0
  21. package/grammars/blade.json +3870 -0
  22. package/grammars/c.json +3552 -0
  23. package/grammars/cadence.json +738 -0
  24. package/grammars/clarity.json +877 -0
  25. package/grammars/clojure.json +426 -0
  26. package/grammars/cmake.json +143 -0
  27. package/grammars/cobol.json +1124 -0
  28. package/grammars/codeql.json +1540 -0
  29. package/grammars/coffee.json +1311 -0
  30. package/grammars/cpp-macro.json +9498 -0
  31. package/grammars/cpp.json +16635 -0
  32. package/grammars/crystal.json +1866 -0
  33. package/grammars/csharp.json +5722 -0
  34. package/grammars/css.json +1860 -0
  35. package/grammars/csv.json +46 -0
  36. package/grammars/cue.json +1128 -0
  37. package/grammars/cypher.json +353 -0
  38. package/grammars/d.json +3185 -0
  39. package/grammars/dart.json +522 -0
  40. package/grammars/dax.json +185 -0
  41. package/grammars/diff.json +155 -0
  42. package/grammars/docker.json +97 -0
  43. package/grammars/dream-maker.json +640 -0
  44. package/grammars/elixir.json +1014 -0
  45. package/grammars/elm.json +751 -0
  46. package/grammars/erb.json +156 -0
  47. package/grammars/erlang.json +1757 -0
  48. package/grammars/fish.json +189 -0
  49. package/grammars/fsharp.json +1831 -0
  50. package/grammars/gdresource.json +290 -0
  51. package/grammars/gdscript.json +969 -0
  52. package/grammars/gdshader.json +405 -0
  53. package/grammars/gherkin.json +133 -0
  54. package/grammars/git-commit.json +85 -0
  55. package/grammars/git-rebase.json +56 -0
  56. package/grammars/glimmer-js.json +98 -0
  57. package/grammars/glimmer-ts.json +98 -0
  58. package/grammars/glsl.json +57 -0
  59. package/grammars/gnuplot.json +892 -0
  60. package/grammars/go.json +1012 -0
  61. package/grammars/graphql.json +1295 -0
  62. package/grammars/groovy.json +1378 -0
  63. package/grammars/hack.json +2650 -0
  64. package/grammars/haml.json +598 -0
  65. package/grammars/handlebars.json +848 -0
  66. package/grammars/haskell.json +2431 -0
  67. package/grammars/hcl.json +787 -0
  68. package/grammars/hjson.json +821 -0
  69. package/grammars/hlsl.json +212 -0
  70. package/grammars/html.json +93 -0
  71. package/grammars/imba.json +2696 -0
  72. package/grammars/ini.json +108 -0
  73. package/grammars/java.json +1885 -0
  74. package/grammars/javascript.json +5984 -0
  75. package/grammars/jinja-html.json +16 -0
  76. package/grammars/jinja.json +345 -0
  77. package/grammars/jison.json +715 -0
  78. package/grammars/jsdoc.json +21 -0
  79. package/grammars/json.json +208 -0
  80. package/grammars/json5.json +244 -0
  81. package/grammars/jsonc.json +208 -0
  82. package/grammars/jsonl.json +208 -0
  83. package/grammars/jsonnet.json +211 -0
  84. package/grammars/jssm.json +159 -0
  85. package/grammars/jsx.json +5984 -0
  86. package/grammars/julia.json +1061 -0
  87. package/grammars/kotlin.json +580 -0
  88. package/grammars/kusto.json +687 -0
  89. package/grammars/latex.json +2395 -0
  90. package/grammars/less.json +5012 -0
  91. package/grammars/liquid.json +990 -0
  92. package/grammars/lisp.json +121 -0
  93. package/grammars/logo.json +55 -0
  94. package/grammars/lua.json +956 -0
  95. package/grammars/make.json +629 -0
  96. package/grammars/markdown.json +3066 -0
  97. package/grammars/marko.json +1344 -0
  98. package/grammars/matlab.json +1131 -0
  99. package/grammars/mdc.json +571 -0
  100. package/grammars/mdx.json +5629 -0
  101. package/grammars/mermaid.json +1382 -0
  102. package/grammars/mojo.json +4153 -0
  103. package/grammars/narrat.json +227 -0
  104. package/grammars/nextflow.json +298 -0
  105. package/grammars/nginx.json +2121 -0
  106. package/grammars/nim.json +1522 -0
  107. package/grammars/nix.json +1200 -0
  108. package/grammars/nushell.json +1047 -0
  109. package/grammars/objective-c.json +3750 -0
  110. package/grammars/objective-cpp.json +7242 -0
  111. package/grammars/ocaml.json +2967 -0
  112. package/grammars/pascal.json +154 -0
  113. package/grammars/perl.json +2971 -0
  114. package/grammars/php.json +4024 -0
  115. package/grammars/plsql.json +241 -0
  116. package/grammars/postcss.json +377 -0
  117. package/grammars/powerquery.json +349 -0
  118. package/grammars/powershell.json +1024 -0
  119. package/grammars/prisma.json +443 -0
  120. package/grammars/prolog.json +298 -0
  121. package/grammars/proto.json +507 -0
  122. package/grammars/pug.json +1033 -0
  123. package/grammars/puppet.json +777 -0
  124. package/grammars/purescript.json +871 -0
  125. package/grammars/python.json +4208 -0
  126. package/grammars/r.json +637 -0
  127. package/grammars/raku.json +310 -0
  128. package/grammars/razor.json +1813 -0
  129. package/grammars/reg.json +136 -0
  130. package/grammars/rel.json +200 -0
  131. package/grammars/riscv.json +298 -0
  132. package/grammars/rst.json +734 -0
  133. package/grammars/ruby.json +2769 -0
  134. package/grammars/rust.json +1171 -0
  135. package/grammars/sas.json +302 -0
  136. package/grammars/sass.json +618 -0
  137. package/grammars/scala.json +1313 -0
  138. package/grammars/scheme.json +384 -0
  139. package/grammars/scss.json +1874 -0
  140. package/grammars/shaderlab.json +199 -0
  141. package/grammars/shellscript.json +2025 -0
  142. package/grammars/shellsession.json +33 -0
  143. package/grammars/smalltalk.json +235 -0
  144. package/grammars/solidity.json +1210 -0
  145. package/grammars/sparql.json +45 -0
  146. package/grammars/splunk.json +91 -0
  147. package/grammars/sql.json +631 -0
  148. package/grammars/ssh-config.json +88 -0
  149. package/grammars/stata.json +3050 -0
  150. package/grammars/stylus.json +1208 -0
  151. package/grammars/svelte.json +1171 -0
  152. package/grammars/swift.json +4203 -0
  153. package/grammars/system-verilog.json +1063 -0
  154. package/grammars/tasl.json +292 -0
  155. package/grammars/tcl.json +291 -0
  156. package/grammars/tex.json +281 -0
  157. package/grammars/toml.json +431 -0
  158. package/grammars/tsx.json +5984 -0
  159. package/grammars/turtle.json +261 -0
  160. package/grammars/twig.json +1394 -0
  161. package/grammars/typescript.json +5735 -0
  162. package/grammars/v.json +1001 -0
  163. package/grammars/vb.json +232 -0
  164. package/grammars/verilog.json +305 -0
  165. package/grammars/vhdl.json +1484 -0
  166. package/grammars/viml.json +445 -0
  167. package/grammars/vue-html.json +559 -0
  168. package/grammars/vue.json +1237 -0
  169. package/grammars/vyper.json +5415 -0
  170. package/grammars/wasm.json +831 -0
  171. package/grammars/wenyan.json +129 -0
  172. package/grammars/wgsl.json +391 -0
  173. package/grammars/wolfram.json +2370 -0
  174. package/grammars/xml.json +382 -0
  175. package/grammars/xsl.json +89 -0
  176. package/grammars/yaml.json +616 -0
  177. package/grammars/zenscript.json +257 -0
  178. package/grammars/zig.json +312 -0
  179. package/index.d.ts +18 -0
  180. package/index.js +2165 -0
  181. package/package.json +46 -0
@@ -0,0 +1,969 @@
1
+ {
2
+ "displayName": "GDScript",
3
+ "fileTypes": [
4
+ "gd"
5
+ ],
6
+ "name": "gdscript",
7
+ "patterns": [
8
+ {
9
+ "include": "#nodepath_object"
10
+ },
11
+ {
12
+ "include": "#base_expression"
13
+ },
14
+ {
15
+ "include": "#logic_op"
16
+ },
17
+ {
18
+ "include": "#in_keyword"
19
+ },
20
+ {
21
+ "include": "#getter_setter_godot4"
22
+ },
23
+ {
24
+ "include": "#compare_op"
25
+ },
26
+ {
27
+ "include": "#arithmetic_op"
28
+ },
29
+ {
30
+ "include": "#assignment_op"
31
+ },
32
+ {
33
+ "include": "#lambda_declaration"
34
+ },
35
+ {
36
+ "include": "#control_flow"
37
+ },
38
+ {
39
+ "include": "#annotations"
40
+ },
41
+ {
42
+ "include": "#keywords"
43
+ },
44
+ {
45
+ "include": "#self"
46
+ },
47
+ {
48
+ "include": "#class_definition"
49
+ },
50
+ {
51
+ "include": "#variable_definition"
52
+ },
53
+ {
54
+ "include": "#class_name"
55
+ },
56
+ {
57
+ "include": "#builtin_func"
58
+ },
59
+ {
60
+ "include": "#builtin_get_node_shorthand"
61
+ },
62
+ {
63
+ "include": "#builtin_classes"
64
+ },
65
+ {
66
+ "include": "#const_vars"
67
+ },
68
+ {
69
+ "include": "#pascal_case_class"
70
+ },
71
+ {
72
+ "include": "#class_new"
73
+ },
74
+ {
75
+ "include": "#class_is"
76
+ },
77
+ {
78
+ "include": "#class_enum"
79
+ },
80
+ {
81
+ "include": "#signal_declaration_bare"
82
+ },
83
+ {
84
+ "include": "#signal_declaration"
85
+ },
86
+ {
87
+ "include": "#function_declaration"
88
+ },
89
+ {
90
+ "include": "#function_keyword"
91
+ },
92
+ {
93
+ "include": "#any_method"
94
+ },
95
+ {
96
+ "include": "#any_variable"
97
+ },
98
+ {
99
+ "include": "#any_property"
100
+ },
101
+ {
102
+ "include": "#extends"
103
+ }
104
+ ],
105
+ "repository": {
106
+ "annotated_parameter": {
107
+ "begin": "(?x)\n \\b\n ([a-zA-Z_]\\w*) \\s* (:)\n",
108
+ "beginCaptures": {
109
+ "1": {
110
+ "name": "variable.parameter.function.language.gdscript"
111
+ },
112
+ "2": {
113
+ "name": "punctuation.separator.annotation.gdscript"
114
+ }
115
+ },
116
+ "end": "(,)|(?=\\))",
117
+ "endCaptures": {
118
+ "1": {
119
+ "name": "punctuation.separator.parameters.gdscript"
120
+ }
121
+ },
122
+ "patterns": [
123
+ {
124
+ "include": "#base_expression"
125
+ },
126
+ {
127
+ "match": "=(?!=)",
128
+ "name": "keyword.operator.assignment.gdscript"
129
+ }
130
+ ]
131
+ },
132
+ "annotations": {
133
+ "captures": {
134
+ "1": {
135
+ "name": "entity.name.function.decorator.gdscript"
136
+ },
137
+ "2": {
138
+ "name": "entity.name.function.decorator.gdscript"
139
+ }
140
+ },
141
+ "match": "(@)(export|export_color_no_alpha|export_dir|export_enum|export_exp_easing|export_file|export_flags|export_flags_2d_navigation|export_flags_2d_physics|export_flags_2d_render|export_flags_3d_navigation|export_flags_3d_physics|export_flags_3d_render|export_global_dir|export_global_file|export_multiline|export_node_path|export_placeholder|export_range|icon|onready|rpc|tool|warning_ignore|abstract)\\b"
142
+ },
143
+ "any_method": {
144
+ "match": "\\b([A-Za-z_]\\w*)\\b(?=\\s*(?:[(]))",
145
+ "name": "support.function.any-method.gdscript"
146
+ },
147
+ "any_property": {
148
+ "captures": {
149
+ "1": {
150
+ "name": "punctuation.accessor.gdscript"
151
+ },
152
+ "2": {
153
+ "name": "variable.other.property.gdscript"
154
+ }
155
+ },
156
+ "match": "\\b(\\.)\\s*(?<![@\\$#%])([A-Za-z_]\\w*)\\b(?![(])"
157
+ },
158
+ "any_variable": {
159
+ "match": "\\b(?<![@\\$#%])([A-Za-z_]\\w*)\\b(?![(])",
160
+ "name": "variable.other.gdscript"
161
+ },
162
+ "arithmetic_op": {
163
+ "match": "\\+=|-=|\\*=|/=|%=|&=|\\|=|\\*|/|%|\\+|-|<<|>>|&|\\||\\^|~|!",
164
+ "name": "keyword.operator.arithmetic.gdscript"
165
+ },
166
+ "assignment_op": {
167
+ "match": "=",
168
+ "name": "keyword.operator.assignment.gdscript"
169
+ },
170
+ "base_expression": {
171
+ "patterns": [
172
+ {
173
+ "include": "#builtin_get_node_shorthand"
174
+ },
175
+ {
176
+ "include": "#nodepath_object"
177
+ },
178
+ {
179
+ "include": "#nodepath_function"
180
+ },
181
+ {
182
+ "include": "#strings"
183
+ },
184
+ {
185
+ "include": "#keywords"
186
+ },
187
+ {
188
+ "include": "#logic_op"
189
+ },
190
+ {
191
+ "include": "#lambda_declaration"
192
+ },
193
+ {
194
+ "include": "#in_keyword"
195
+ },
196
+ {
197
+ "include": "#control_flow"
198
+ },
199
+ {
200
+ "include": "#round_braces"
201
+ },
202
+ {
203
+ "include": "#function_call"
204
+ },
205
+ {
206
+ "include": "#comment"
207
+ },
208
+ {
209
+ "include": "#self"
210
+ },
211
+ {
212
+ "include": "#letter"
213
+ },
214
+ {
215
+ "include": "#numbers"
216
+ },
217
+ {
218
+ "include": "#builtin_func"
219
+ },
220
+ {
221
+ "include": "#builtin_classes"
222
+ },
223
+ {
224
+ "include": "#const_vars"
225
+ },
226
+ {
227
+ "include": "#pascal_case_class"
228
+ },
229
+ {
230
+ "include": "#line_continuation"
231
+ }
232
+ ]
233
+ },
234
+ "builtin_classes": {
235
+ "match": "(?<![^.]\\.|:)\\b(OS|GDScript|Vector2|Vector2i|Vector3|Vector3i|Color|Rect2|Rect2i|Array|Basis|Dictionary|Plane|Quat|RID|Rect3|Transform|Transform2D|Transform3D|AABB|String|Color|NodePath|Object|PoolByteArray|PoolIntArray|PoolRealArray|PoolStringArray|PoolVector2Array|PoolVector3Array|PoolColorArray|bool|int|float|StringName|Quaternion|PackedByteArray|PackedInt32Array|PackedInt64Array|PackedFloat32Array|PackedFloat64Array|PackedStringArray|PackedVector2Array|PackedVector2iArray|PackedVector3Array|PackedVector3iArray|PackedColorArray|super)\\b",
236
+ "name": "entity.name.type.class.builtin.gdscript"
237
+ },
238
+ "builtin_func": {
239
+ "match": "(?<![^.]\\.|:)\\b(abs|absf|absi|acos|asin|assert|atan|atan2|bytes2var|bytes2var_with_objects|ceil|char|clamp|clampf|clampi|Color8|convert|cos|cosh|cubic_interpolate|db2linear|decimals|dectime|deg2rad|dict2inst|ease|error_string|exp|floor|fmod|fposmod|funcref|get_stack|hash|inst2dict|instance_from_id|inverse_lerp|is_equal_approx|is_inf|is_instance_id_valid|is_instance_valid|is_nan|is_zero_approx|len|lerp|lerp_angle|linear2db|load|log|max|maxf|maxi|min|minf|mini|move_toward|nearest_po2|pingpong|posmod|pow|preload|print|printerr|printraw|prints|printt|print_debug|print_stack|print_verbose|push_error|push_warning|rad2deg|randf|randfn|randf_range|randi|randi_range|randomize|rand_from_seed|rand_range|rand_seed|range|range_lerp|range_step_decimals|rid_allocate_id|rid_from_int64|round|seed|sign|signf|signi|sin|sinh|smoothstep|snapped|sqrt|stepify|step_decimals|str|str2var|tan|tanh|typeof|type_exists|var2bytes|var2bytes_with_objects|var2str|weakref|wrapf|wrapi|yield)\\b(?=(\\()([^)]*)(\\)))",
240
+ "name": "support.function.builtin.gdscript"
241
+ },
242
+ "builtin_get_node_shorthand": {
243
+ "patterns": [
244
+ {
245
+ "include": "#builtin_get_node_shorthand_quoted"
246
+ },
247
+ {
248
+ "include": "#builtin_get_node_shorthand_bare"
249
+ }
250
+ ]
251
+ },
252
+ "builtin_get_node_shorthand_bare": {
253
+ "begin": "(\\$|%|\\$%)([a-zA-Z_]\\w*/?)",
254
+ "beginCaptures": {
255
+ "1": {
256
+ "name": "keyword.control.flow.gdscript"
257
+ },
258
+ "2": {
259
+ "name": "constant.character.escape.gdscript"
260
+ }
261
+ },
262
+ "end": "[^\\w%]",
263
+ "name": "meta.literal.nodepath.gdscript",
264
+ "patterns": [
265
+ {
266
+ "captures": {
267
+ "1": {
268
+ "name": "keyword.control.flow.gdscript"
269
+ },
270
+ "2": {
271
+ "name": "constant.character.escape.gdscript"
272
+ }
273
+ },
274
+ "match": "(%)?([a-zA-Z_]\\w*/?)"
275
+ }
276
+ ]
277
+ },
278
+ "builtin_get_node_shorthand_quoted": {
279
+ "begin": "(?:(\\$)|(&|\\^|@))(\"|')",
280
+ "beginCaptures": {
281
+ "1": {
282
+ "name": "keyword.control.flow.gdscript"
283
+ },
284
+ "2": {
285
+ "name": "variable.other.enummember.gdscript"
286
+ }
287
+ },
288
+ "end": "(\\3)",
289
+ "name": "meta.literal.nodepath.gdscript constant.character.escape.gdscript",
290
+ "patterns": [
291
+ {
292
+ "match": "%",
293
+ "name": "keyword.control.flow"
294
+ }
295
+ ]
296
+ },
297
+ "class_definition": {
298
+ "captures": {
299
+ "1": {
300
+ "name": "entity.name.type.class.gdscript"
301
+ },
302
+ "2": {
303
+ "name": "class.other.gdscript"
304
+ }
305
+ },
306
+ "match": "(?<=^class)\\s+([a-zA-Z_]\\w*)\\s*(?=:)"
307
+ },
308
+ "class_enum": {
309
+ "captures": {
310
+ "1": {
311
+ "name": "entity.name.type.class.gdscript"
312
+ },
313
+ "2": {
314
+ "name": "constant.language.gdscript"
315
+ }
316
+ },
317
+ "match": "\\b([A-Z][a-zA-Z_0-9]*)\\.([A-Z_0-9]+)"
318
+ },
319
+ "class_is": {
320
+ "captures": {
321
+ "1": {
322
+ "name": "storage.type.is.gdscript"
323
+ },
324
+ "2": {
325
+ "name": "entity.name.type.class.gdscript"
326
+ }
327
+ },
328
+ "match": "\\s+(is)\\s+([a-zA-Z_]\\w*)"
329
+ },
330
+ "class_name": {
331
+ "captures": {
332
+ "1": {
333
+ "name": "entity.name.type.class.gdscript"
334
+ },
335
+ "2": {
336
+ "name": "class.other.gdscript"
337
+ }
338
+ },
339
+ "match": "(?<=class_name)\\s+([a-zA-Z_]\\w*(\\.([a-zA-Z_]\\w*))?)"
340
+ },
341
+ "class_new": {
342
+ "captures": {
343
+ "1": {
344
+ "name": "entity.name.type.class.gdscript"
345
+ },
346
+ "2": {
347
+ "name": "storage.type.new.gdscript"
348
+ },
349
+ "3": {
350
+ "name": "punctuation.parenthesis.begin.gdscript"
351
+ }
352
+ },
353
+ "match": "\\b([a-zA-Z_]\\w*).(new)\\("
354
+ },
355
+ "comment": {
356
+ "captures": {
357
+ "1": {
358
+ "name": "punctuation.definition.comment.number-sign.gdscript"
359
+ }
360
+ },
361
+ "match": "(#).*$\\n?",
362
+ "name": "comment.line.number-sign.gdscript"
363
+ },
364
+ "compare_op": {
365
+ "match": "<=|>=|==|<|>|!=",
366
+ "name": "keyword.operator.comparison.gdscript"
367
+ },
368
+ "const_vars": {
369
+ "match": "\\b([A-Z_][A-Z_0-9]*)\\b",
370
+ "name": "constant.language.gdscript"
371
+ },
372
+ "control_flow": {
373
+ "match": "\\b(?:if|elif|else|while|break|continue|pass|return|match|yield|await)\\b",
374
+ "name": "keyword.control.gdscript"
375
+ },
376
+ "extends": {
377
+ "match": "(?<=extends)\\s+[a-zA-Z_]\\w*(\\.([a-zA-Z_]\\w*))?",
378
+ "name": "entity.other.inherited-class.gdscript"
379
+ },
380
+ "function_arguments": {
381
+ "begin": "(\\()",
382
+ "beginCaptures": {
383
+ "1": {
384
+ "name": "punctuation.definition.arguments.begin.gdscript"
385
+ }
386
+ },
387
+ "contentName": "meta.function.parameters.gdscript",
388
+ "end": "(?=\\))(?!\\)\\s*\\()",
389
+ "patterns": [
390
+ {
391
+ "match": "(,)",
392
+ "name": "punctuation.separator.arguments.gdscript"
393
+ },
394
+ {
395
+ "captures": {
396
+ "1": {
397
+ "name": "variable.parameter.function-call.gdscript"
398
+ },
399
+ "2": {
400
+ "name": "keyword.operator.assignment.gdscript"
401
+ }
402
+ },
403
+ "match": "\\b([a-zA-Z_]\\w*)\\s*(=)(?!=)"
404
+ },
405
+ {
406
+ "match": "=(?!=)",
407
+ "name": "keyword.operator.assignment.gdscript"
408
+ },
409
+ {
410
+ "include": "#base_expression"
411
+ },
412
+ {
413
+ "captures": {
414
+ "1": {
415
+ "name": "punctuation.definition.arguments.end.gdscript"
416
+ },
417
+ "2": {
418
+ "name": "punctuation.definition.arguments.begin.gdscript"
419
+ }
420
+ },
421
+ "match": "\\s*(\\))\\s*(\\()"
422
+ },
423
+ {
424
+ "include": "#letter"
425
+ },
426
+ {
427
+ "include": "#any_variable"
428
+ },
429
+ {
430
+ "include": "#any_property"
431
+ },
432
+ {
433
+ "include": "#keywords"
434
+ }
435
+ ]
436
+ },
437
+ "function_call": {
438
+ "begin": "(?x)\n \\b(?=\n ([a-zA-Z_]\\w*) \\s* (\\()\n )\n",
439
+ "comment": "Regular function call of the type \"name(args)\"",
440
+ "end": "(\\))",
441
+ "endCaptures": {
442
+ "1": {
443
+ "name": "punctuation.definition.arguments.end.gdscript"
444
+ }
445
+ },
446
+ "name": "meta.function-call.gdscript",
447
+ "patterns": [
448
+ {
449
+ "include": "#function_name"
450
+ },
451
+ {
452
+ "include": "#function_arguments"
453
+ }
454
+ ]
455
+ },
456
+ "function_declaration": {
457
+ "begin": "(?x) \\s*\n (func) \\s+\n ([a-zA-Z_]\\w*) \\s*\n (?=\\()",
458
+ "beginCaptures": {
459
+ "1": {
460
+ "name": "keyword.language.gdscript storage.type.function.gdscript"
461
+ },
462
+ "2": {
463
+ "name": "entity.name.function.gdscript"
464
+ }
465
+ },
466
+ "end": "((:)|(?=[#'\"\\n]))",
467
+ "endCaptures": {
468
+ "1": {
469
+ "name": "punctuation.section.function.begin.gdscript"
470
+ }
471
+ },
472
+ "name": "meta.function.gdscript",
473
+ "patterns": [
474
+ {
475
+ "include": "#parameters"
476
+ },
477
+ {
478
+ "include": "#line_continuation"
479
+ },
480
+ {
481
+ "captures": {
482
+ "1": {
483
+ "name": "keyword.language.void.gdscript"
484
+ },
485
+ "2": {
486
+ "name": "entity.name.type.class.gdscript"
487
+ }
488
+ },
489
+ "match": "\\s*(?:\\-\\>)\\s*(void\\w*)|([a-zA-Z_]\\w*)\\s*\\:"
490
+ },
491
+ {
492
+ "include": "#base_expression"
493
+ }
494
+ ]
495
+ },
496
+ "function_keyword": {
497
+ "match": "func",
498
+ "name": "keyword.language.gdscript"
499
+ },
500
+ "function_name": {
501
+ "patterns": [
502
+ {
503
+ "include": "#builtin_func"
504
+ },
505
+ {
506
+ "include": "#builtin_classes"
507
+ },
508
+ {
509
+ "comment": "Some color schemas support meta.function-call.generic scope",
510
+ "match": "(?x)\n \\b ([a-zA-Z_]\\w*) \\b\n",
511
+ "name": "support.function.any-method.gdscript"
512
+ }
513
+ ]
514
+ },
515
+ "getter_setter_godot4": {
516
+ "patterns": [
517
+ {
518
+ "captures": {
519
+ "1": {
520
+ "name": "entity.name.function.gdscript"
521
+ }
522
+ },
523
+ "match": "\\b(get):"
524
+ },
525
+ {
526
+ "begin": "(?x) \\s+\n (set) \\s*\n (?=\\()",
527
+ "beginCaptures": {
528
+ "1": {
529
+ "name": "entity.name.function.gdscript"
530
+ }
531
+ },
532
+ "end": "(:|(?=[#'\"\\n]))",
533
+ "name": "meta.function.gdscript",
534
+ "patterns": [
535
+ {
536
+ "include": "#parameters"
537
+ },
538
+ {
539
+ "include": "#line_continuation"
540
+ },
541
+ {
542
+ "captures": {
543
+ "1": {
544
+ },
545
+ "2": {
546
+ "name": "entity.name.type.class.gdscript"
547
+ }
548
+ },
549
+ "match": "\\s*(\\-\\>)\\s*([a-zA-Z_]\\w*)\\s*\\:"
550
+ }
551
+ ]
552
+ }
553
+ ]
554
+ },
555
+ "in_keyword": {
556
+ "patterns": [
557
+ {
558
+ "begin": "\\b(for)\\b",
559
+ "captures": {
560
+ "1": {
561
+ "name": "keyword.control.gdscript"
562
+ }
563
+ },
564
+ "end": ":",
565
+ "patterns": [
566
+ {
567
+ "match": "\\bin\\b",
568
+ "name": "keyword.control.gdscript"
569
+ },
570
+ {
571
+ "include": "#base_expression"
572
+ },
573
+ {
574
+ "include": "#any_variable"
575
+ },
576
+ {
577
+ "include": "#any_property"
578
+ }
579
+ ]
580
+ },
581
+ {
582
+ "match": "\\bin\\b",
583
+ "name": "keyword.operator.wordlike.gdscript"
584
+ }
585
+ ]
586
+ },
587
+ "keywords": {
588
+ "match": "\\b(?:class|class_name|extends|is|onready|tool|static|export|as|void|enum|preload|assert|breakpoint|rpc|sync|remote|master|puppet|slave|remotesync|mastersync|puppetsync|trait|namespace)\\b",
589
+ "name": "keyword.language.gdscript"
590
+ },
591
+ "lambda_declaration": {
592
+ "begin": "(func)\\s?(?=\\()",
593
+ "beginCaptures": {
594
+ "1": {
595
+ "name": "keyword.language.gdscript storage.type.function.gdscript"
596
+ },
597
+ "2": {
598
+ "name": "entity.name.function.gdscript"
599
+ }
600
+ },
601
+ "end": "(:|(?=[#'\"\\n]))",
602
+ "name": "meta.function.gdscript",
603
+ "patterns": [
604
+ {
605
+ "include": "#parameters"
606
+ },
607
+ {
608
+ "include": "#line_continuation"
609
+ },
610
+ {
611
+ "captures": {
612
+ "1": {
613
+ "name": "keyword.language.void.gdscript"
614
+ },
615
+ "2": {
616
+ "name": "entity.name.type.class.gdscript"
617
+ }
618
+ },
619
+ "match": "\\s*(?:\\-\\>)\\s*(void\\w*)|([a-zA-Z_]\\w*)\\s*\\:"
620
+ },
621
+ {
622
+ "include": "#base_expression"
623
+ },
624
+ {
625
+ "include": "#any_variable"
626
+ },
627
+ {
628
+ "include": "#any_property"
629
+ }
630
+ ]
631
+ },
632
+ "letter": {
633
+ "match": "\\b(?:true|false|null)\\b",
634
+ "name": "constant.language.gdscript"
635
+ },
636
+ "line_continuation": {
637
+ "patterns": [
638
+ {
639
+ "captures": {
640
+ "1": {
641
+ "name": "punctuation.separator.continuation.line.gdscript"
642
+ },
643
+ "2": {
644
+ "name": "invalid.illegal.line.continuation.gdscript"
645
+ }
646
+ },
647
+ "match": "(\\\\)\\s*(\\S.*$\\n?)"
648
+ },
649
+ {
650
+ "begin": "(\\\\)\\s*$\\n?",
651
+ "beginCaptures": {
652
+ "1": {
653
+ "name": "punctuation.separator.continuation.line.gdscript"
654
+ }
655
+ },
656
+ "end": "(?x)\n (?=^\\s*$)\n |\n (?! (\\s* [rR]? (\\'\\'\\'|\\\"\\\"\\\"|\\'|\\\"))\n |\n (\\G $) (?# '\\G' is necessary for ST)\n )\n",
657
+ "patterns": [
658
+ {
659
+ "include": "#base_expression"
660
+ }
661
+ ]
662
+ }
663
+ ]
664
+ },
665
+ "logic_op": {
666
+ "match": "\\b(and|or|not|!)\\b",
667
+ "name": "keyword.operator.wordlike.gdscript"
668
+ },
669
+ "loose_default": {
670
+ "begin": "(=)",
671
+ "beginCaptures": {
672
+ "1": {
673
+ "name": "keyword.operator.gdscript"
674
+ }
675
+ },
676
+ "end": "(,)|(?=\\))",
677
+ "endCaptures": {
678
+ "1": {
679
+ "name": "punctuation.separator.parameters.gdscript"
680
+ }
681
+ },
682
+ "patterns": [
683
+ {
684
+ "include": "#base_expression"
685
+ }
686
+ ]
687
+ },
688
+ "nodepath_function": {
689
+ "begin": "(get_node_or_null|has_node|has_node_and_resource|find_node|get_node)\\s*(\\()",
690
+ "beginCaptures": {
691
+ "1": {
692
+ "name": "entity.name.function.gdscript"
693
+ },
694
+ "2": {
695
+ "name": "punctuation.definition.parameters.begin.gdscript"
696
+ }
697
+ },
698
+ "end": "(\\))",
699
+ "endCaptures": {
700
+ "1": {
701
+ "name": "punctuation.definition.parameters.end.gdscript"
702
+ }
703
+ },
704
+ "patterns": [
705
+ {
706
+ "begin": "(\"|')",
707
+ "end": "\\1",
708
+ "name": "meta.literal.nodepath.gdscript constant.character.escape",
709
+ "patterns": [
710
+ {
711
+ "match": "%",
712
+ "name": "keyword.control.flow"
713
+ }
714
+ ]
715
+ }
716
+ ]
717
+ },
718
+ "nodepath_object": {
719
+ "begin": "(NodePath)\\s*(?:\\()",
720
+ "beginCaptures": {
721
+ "1": {
722
+ "name": "support.class.library.gdscript"
723
+ }
724
+ },
725
+ "end": "(?:\\))",
726
+ "name": "meta.literal.nodepath.gdscript",
727
+ "patterns": [
728
+ {
729
+ "begin": "(\"|')",
730
+ "end": "\\1",
731
+ "name": "constant.character.escape.gdscript",
732
+ "patterns": [
733
+ {
734
+ "match": "%",
735
+ "name": "keyword.control.flow.gdscript"
736
+ }
737
+ ]
738
+ }
739
+ ]
740
+ },
741
+ "numbers": {
742
+ "patterns": [
743
+ {
744
+ "match": "0b[01_]+",
745
+ "name": "constant.numeric.integer.binary.gdscript"
746
+ },
747
+ {
748
+ "match": "0x[0-9A-Fa-f_]+",
749
+ "name": "constant.numeric.integer.hexadecimal.gdscript"
750
+ },
751
+ {
752
+ "match": "[-]?([0-9_]+\\.[0-9_]*(e[\\-\\+]?[0-9_]+)?)",
753
+ "name": "constant.numeric.float.gdscript"
754
+ },
755
+ {
756
+ "match": "[-]?(\\.[0-9_]+(e[\\-\\+]?[0-9_]+)?)",
757
+ "name": "constant.numeric.float.gdscript"
758
+ },
759
+ {
760
+ "match": "[-]?([0-9_]+e[\\-\\+]?\\[0-9_])",
761
+ "name": "constant.numeric.float.gdscript"
762
+ },
763
+ {
764
+ "match": "[-]?[0-9_]+",
765
+ "name": "constant.numeric.integer.gdscript"
766
+ }
767
+ ]
768
+ },
769
+ "parameters": {
770
+ "begin": "(\\()",
771
+ "beginCaptures": {
772
+ "1": {
773
+ "name": "punctuation.definition.parameters.begin.gdscript"
774
+ }
775
+ },
776
+ "end": "(\\))",
777
+ "endCaptures": {
778
+ "1": {
779
+ "name": "punctuation.definition.parameters.end.gdscript"
780
+ }
781
+ },
782
+ "name": "meta.function.parameters.gdscript",
783
+ "patterns": [
784
+ {
785
+ "include": "#annotated_parameter"
786
+ },
787
+ {
788
+ "captures": {
789
+ "1": {
790
+ "name": "variable.parameter.function.language.gdscript"
791
+ },
792
+ "2": {
793
+ "name": "punctuation.separator.parameters.gdscript"
794
+ }
795
+ },
796
+ "match": "(?x)\n ([a-zA-Z_]\\w*)\n \\s* (?: (,) | (?=[)#\\n=]))\n"
797
+ },
798
+ {
799
+ "include": "#comment"
800
+ },
801
+ {
802
+ "include": "#loose_default"
803
+ }
804
+ ]
805
+ },
806
+ "pascal_case_class": {
807
+ "match": "\\b([A-Z][a-z_0-9]*([A-Z]?[a-z_0-9]+)*[A-Z]?)\\b",
808
+ "name": "entity.name.type.class.gdscript"
809
+ },
810
+ "round_braces": {
811
+ "begin": "\\(",
812
+ "beginCaptures": {
813
+ "0": {
814
+ "name": "punctuation.parenthesis.begin.gdscript"
815
+ }
816
+ },
817
+ "end": "\\)",
818
+ "endCaptures": {
819
+ "0": {
820
+ "name": "punctuation.parenthesis.end.gdscript"
821
+ }
822
+ },
823
+ "patterns": [
824
+ {
825
+ "include": "#base_expression"
826
+ },
827
+ {
828
+ "include": "#any_variable"
829
+ }
830
+ ]
831
+ },
832
+ "self": {
833
+ "match": "\\bself\\b",
834
+ "name": "variable.language.gdscript"
835
+ },
836
+ "signal_declaration": {
837
+ "begin": "(?x) \\s*\n (signal) \\s+\n ([a-zA-Z_]\\w*) \\s*\n (?=\\()",
838
+ "beginCaptures": {
839
+ "1": {
840
+ "name": "keyword.language.gdscript storage.type.function.gdscript"
841
+ },
842
+ "2": {
843
+ "name": "entity.name.function.gdscript"
844
+ }
845
+ },
846
+ "end": "((?=[#'\"\\n]))",
847
+ "name": "meta.signal.gdscript",
848
+ "patterns": [
849
+ {
850
+ "include": "#parameters"
851
+ },
852
+ {
853
+ "include": "#line_continuation"
854
+ },
855
+ {
856
+ "captures": {
857
+ "1": {
858
+ },
859
+ "2": {
860
+ "name": "entity.name.type.class.gdscript"
861
+ }
862
+ },
863
+ "match": "\\s*(\\-\\>)\\s*([a-zA-Z_]\\w*)\\s*\\:"
864
+ }
865
+ ]
866
+ },
867
+ "signal_declaration_bare": {
868
+ "captures": {
869
+ "1": {
870
+ "name": "keyword.language.gdscript storage.type.function.gdscript"
871
+ },
872
+ "2": {
873
+ "name": "entity.name.function.gdscript"
874
+ }
875
+ },
876
+ "match": "(?x) \\s*\n (signal) \\s+\n ([a-zA-Z_]\\w*)(?=[\\n\\s])"
877
+ },
878
+ "string_formatting": {
879
+ "captures": {
880
+ "1": {
881
+ "name": "constant.character.format.placeholder.other.gdscript"
882
+ }
883
+ },
884
+ "match": "(?x)\n (\n % (\\([\\w\\s]*\\))?\n [-+#0 ]*\n (\\d+|\\*)? (\\.(\\d+|\\*))?\n ([hlL])?\n [diouxXeEfFgGcrsab%]\n )\n",
885
+ "name": "meta.format.percent.gdscript"
886
+ },
887
+ "strings": {
888
+ "begin": "(r)?(\"\"\"|'''|\"|')",
889
+ "beginCaptures": {
890
+ "1": {
891
+ "name": "constant.character.escape.gdscript"
892
+ }
893
+ },
894
+ "end": "\\2",
895
+ "name": "string.quoted.gdscript",
896
+ "patterns": [
897
+ {
898
+ "match": "\\\\.",
899
+ "name": "constant.character.escape.gdscript"
900
+ },
901
+ {
902
+ "include": "#string_formatting"
903
+ }
904
+ ]
905
+ },
906
+ "variable_definition": {
907
+ "begin": "\\b(?:(var)|(const))\\s+([a-zA-Z_]\\w*)\\s*",
908
+ "beginCaptures": {
909
+ "1": {
910
+ "name": "keyword.language.gdscript storage.type.var.gdscript"
911
+ },
912
+ "2": {
913
+ "name": "keyword.language.gdscript storage.type.const.gdscript"
914
+ },
915
+ "3": {
916
+ "name": "variable.other.gdscript"
917
+ }
918
+ },
919
+ "end": "$|;",
920
+ "patterns": [
921
+ {
922
+ "captures": {
923
+ "1": {
924
+ "name": "punctuation.separator.annotation.gdscript"
925
+ },
926
+ "2": {
927
+ "name": "entity.name.type.class.gdscript"
928
+ }
929
+ },
930
+ "match": "(:)\\s*([a-zA-Z_]\\w*)?"
931
+ },
932
+ {
933
+ "match": "=(?!=)",
934
+ "name": "keyword.operator.assignment.gdscript"
935
+ },
936
+ {
937
+ "captures": {
938
+ "1": {
939
+ "name": "keyword.language.gdscript storage.type.const.gdscript"
940
+ },
941
+ "2": {
942
+ "name": "entity.name.function.gdscript"
943
+ },
944
+ "3": {
945
+ "name": "entity.name.function.gdscript"
946
+ }
947
+ },
948
+ "match": "(setget)\\s+([a-zA-Z_]\\w*)(?:[,]\\s*([a-zA-Z_]\\w*))?"
949
+ },
950
+ {
951
+ "include": "#base_expression"
952
+ },
953
+ {
954
+ "include": "#letter"
955
+ },
956
+ {
957
+ "include": "#any_variable"
958
+ },
959
+ {
960
+ "include": "#any_property"
961
+ },
962
+ {
963
+ "include": "#keywords"
964
+ }
965
+ ]
966
+ }
967
+ },
968
+ "scopeName": "source.gdscript"
969
+ }