@codingame/monaco-vscode-standalone-languages 3.2.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 (163) hide show
  1. package/_.contribution.js +74 -0
  2. package/abap/abap.contribution.js +19 -0
  3. package/abap/abap.js +1406 -0
  4. package/apex/apex.contribution.js +20 -0
  5. package/apex/apex.js +338 -0
  6. package/azcli/azcli.contribution.js +19 -0
  7. package/azcli/azcli.js +76 -0
  8. package/bat/bat.contribution.js +19 -0
  9. package/bat/bat.js +108 -0
  10. package/bicep/bicep.contribution.js +19 -0
  11. package/bicep/bicep.js +117 -0
  12. package/cameligo/cameligo.contribution.js +19 -0
  13. package/cameligo/cameligo.js +182 -0
  14. package/clojure/clojure.contribution.js +19 -0
  15. package/clojure/clojure.js +769 -0
  16. package/coffee/coffee.contribution.js +20 -0
  17. package/coffee/coffee.js +240 -0
  18. package/cpp/cpp.contribution.js +29 -0
  19. package/cpp/cpp.js +409 -0
  20. package/csharp/csharp.contribution.js +19 -0
  21. package/csharp/csharp.js +334 -0
  22. package/csp/csp.contribution.js +19 -0
  23. package/csp/csp.js +61 -0
  24. package/css/css.contribution.js +20 -0
  25. package/css/css.js +193 -0
  26. package/cypher/cypher.contribution.js +19 -0
  27. package/cypher/cypher.js +271 -0
  28. package/dart/dart.contribution.js +20 -0
  29. package/dart/dart.js +289 -0
  30. package/dockerfile/dockerfile.contribution.js +20 -0
  31. package/dockerfile/dockerfile.js +138 -0
  32. package/ecl/ecl.contribution.js +19 -0
  33. package/ecl/ecl.js +464 -0
  34. package/elixir/elixir.contribution.js +19 -0
  35. package/elixir/elixir.js +577 -0
  36. package/flow9/flow9.contribution.js +19 -0
  37. package/flow9/flow9.js +150 -0
  38. package/freemarker2/freemarker2.contribution.js +73 -0
  39. package/freemarker2/freemarker2.js +1016 -0
  40. package/fsharp/fsharp.contribution.js +19 -0
  41. package/fsharp/fsharp.js +225 -0
  42. package/go/go.contribution.js +19 -0
  43. package/go/go.js +226 -0
  44. package/graphql/graphql.contribution.js +20 -0
  45. package/graphql/graphql.js +159 -0
  46. package/handlebars/handlebars.contribution.js +20 -0
  47. package/handlebars/handlebars.js +439 -0
  48. package/hcl/hcl.contribution.js +19 -0
  49. package/hcl/hcl.js +191 -0
  50. package/html/html.contribution.js +20 -0
  51. package/html/html.js +328 -0
  52. package/index.js +81 -0
  53. package/ini/ini.contribution.js +20 -0
  54. package/ini/ini.js +79 -0
  55. package/java/java.contribution.js +20 -0
  56. package/java/java.js +240 -0
  57. package/javascript/javascript.contribution.js +22 -0
  58. package/javascript/javascript.js +77 -0
  59. package/julia/julia.contribution.js +19 -0
  60. package/julia/julia.js +519 -0
  61. package/kotlin/kotlin.contribution.js +20 -0
  62. package/kotlin/kotlin.js +261 -0
  63. package/less/less.contribution.js +20 -0
  64. package/less/less.js +169 -0
  65. package/lexon/lexon.contribution.js +19 -0
  66. package/lexon/lexon.js +165 -0
  67. package/liquid/liquid.contribution.js +20 -0
  68. package/liquid/liquid.js +260 -0
  69. package/lua/lua.contribution.js +19 -0
  70. package/lua/lua.js +170 -0
  71. package/m3/m3.contribution.js +19 -0
  72. package/m3/m3.js +218 -0
  73. package/markdown/markdown.contribution.js +19 -0
  74. package/markdown/markdown.js +237 -0
  75. package/mdx/mdx.contribution.js +19 -0
  76. package/mdx/mdx.js +184 -0
  77. package/mips/mips.contribution.js +20 -0
  78. package/mips/mips.js +206 -0
  79. package/msdax/msdax.contribution.js +19 -0
  80. package/msdax/msdax.js +383 -0
  81. package/mysql/mysql.contribution.js +19 -0
  82. package/mysql/mysql.js +886 -0
  83. package/objective-c/objective-c.contribution.js +19 -0
  84. package/objective-c/objective-c.js +191 -0
  85. package/package.json +23 -0
  86. package/pascal/pascal.contribution.js +20 -0
  87. package/pascal/pascal.js +259 -0
  88. package/pascaligo/pascaligo.contribution.js +19 -0
  89. package/pascaligo/pascaligo.js +172 -0
  90. package/perl/perl.contribution.js +19 -0
  91. package/perl/perl.js +634 -0
  92. package/pgsql/pgsql.contribution.js +19 -0
  93. package/pgsql/pgsql.js +859 -0
  94. package/php/php.contribution.js +20 -0
  95. package/php/php.js +508 -0
  96. package/pla/pla.contribution.js +18 -0
  97. package/pla/pla.js +145 -0
  98. package/postiats/postiats.contribution.js +19 -0
  99. package/postiats/postiats.js +915 -0
  100. package/powerquery/powerquery.contribution.js +19 -0
  101. package/powerquery/powerquery.js +898 -0
  102. package/powershell/powershell.contribution.js +19 -0
  103. package/powershell/powershell.js +247 -0
  104. package/protobuf/protobuf.contribution.js +19 -0
  105. package/protobuf/protobuf.js +428 -0
  106. package/pug/pug.contribution.js +19 -0
  107. package/pug/pug.js +410 -0
  108. package/python/python.contribution.js +20 -0
  109. package/python/python.js +295 -0
  110. package/qsharp/qsharp.contribution.js +19 -0
  111. package/qsharp/qsharp.js +293 -0
  112. package/r/r.contribution.js +19 -0
  113. package/r/r.js +251 -0
  114. package/razor/razor.contribution.js +20 -0
  115. package/razor/razor.js +570 -0
  116. package/redis/redis.contribution.js +19 -0
  117. package/redis/redis.js +310 -0
  118. package/redshift/redshift.contribution.js +19 -0
  119. package/redshift/redshift.js +817 -0
  120. package/restructuredtext/restructuredtext.contribution.js +19 -0
  121. package/restructuredtext/restructuredtext.js +182 -0
  122. package/ruby/ruby.contribution.js +20 -0
  123. package/ruby/ruby.js +519 -0
  124. package/rust/rust.contribution.js +19 -0
  125. package/rust/rust.js +351 -0
  126. package/sb/sb.contribution.js +19 -0
  127. package/sb/sb.js +123 -0
  128. package/scala/scala.contribution.js +20 -0
  129. package/scala/scala.js +378 -0
  130. package/scheme/scheme.contribution.js +19 -0
  131. package/scheme/scheme.js +116 -0
  132. package/scss/scss.contribution.js +20 -0
  133. package/scss/scss.js +268 -0
  134. package/shell/shell.contribution.js +19 -0
  135. package/shell/shell.js +229 -0
  136. package/solidity/solidity.contribution.js +19 -0
  137. package/solidity/solidity.js +1375 -0
  138. package/sophia/sophia.contribution.js +19 -0
  139. package/sophia/sophia.js +207 -0
  140. package/sparql/sparql.contribution.js +19 -0
  141. package/sparql/sparql.js +209 -0
  142. package/sql/sql.contribution.js +19 -0
  143. package/sql/sql.js +861 -0
  144. package/st/st.contribution.js +19 -0
  145. package/st/st.js +424 -0
  146. package/swift/swift.contribution.js +20 -0
  147. package/swift/swift.js +320 -0
  148. package/systemverilog/systemverilog.contribution.js +29 -0
  149. package/systemverilog/systemverilog.js +584 -0
  150. package/tcl/tcl.contribution.js +19 -0
  151. package/tcl/tcl.js +240 -0
  152. package/twig/twig.contribution.js +20 -0
  153. package/twig/twig.js +400 -0
  154. package/typescript/typescript.contribution.js +20 -0
  155. package/typescript/typescript.js +362 -0
  156. package/vb/vb.contribution.js +19 -0
  157. package/vb/vb.js +380 -0
  158. package/wgsl/wgsl.contribution.js +19 -0
  159. package/wgsl/wgsl.js +461 -0
  160. package/xml/xml.contribution.js +39 -0
  161. package/xml/xml.js +114 -0
  162. package/yaml/yaml.contribution.js +20 -0
  163. package/yaml/yaml.js +225 -0
@@ -0,0 +1,439 @@
1
+ import * as monaco_editor_core_star from 'monaco-editor';
2
+
3
+ /*!-----------------------------------------------------------------------------
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
+ * Version: 0.47.0(undefined)
6
+ * Released under the MIT license
7
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
8
+ *-----------------------------------------------------------------------------*/
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
23
+
24
+ // src/fillers/monaco-editor-core.ts
25
+ var monaco_editor_core_exports = {};
26
+ __reExport(monaco_editor_core_exports, monaco_editor_core_star);
27
+
28
+ // src/basic-languages/handlebars/handlebars.ts
29
+ var EMPTY_ELEMENTS = [
30
+ "area",
31
+ "base",
32
+ "br",
33
+ "col",
34
+ "embed",
35
+ "hr",
36
+ "img",
37
+ "input",
38
+ "keygen",
39
+ "link",
40
+ "menuitem",
41
+ "meta",
42
+ "param",
43
+ "source",
44
+ "track",
45
+ "wbr"
46
+ ];
47
+ var conf = {
48
+ wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
49
+ comments: {
50
+ blockComment: ["{{!--", "--}}"]
51
+ },
52
+ brackets: [
53
+ ["<!--", "-->"],
54
+ ["<", ">"],
55
+ ["{{", "}}"],
56
+ ["{", "}"],
57
+ ["(", ")"]
58
+ ],
59
+ autoClosingPairs: [
60
+ { open: "{", close: "}" },
61
+ { open: "[", close: "]" },
62
+ { open: "(", close: ")" },
63
+ { open: '"', close: '"' },
64
+ { open: "'", close: "'" }
65
+ ],
66
+ surroundingPairs: [
67
+ { open: "<", close: ">" },
68
+ { open: '"', close: '"' },
69
+ { open: "'", close: "'" }
70
+ ],
71
+ onEnterRules: [
72
+ {
73
+ beforeText: new RegExp(
74
+ `<(?!(?:${EMPTY_ELEMENTS.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,
75
+ "i"
76
+ ),
77
+ afterText: /^<\/(\w[\w\d]*)\s*>$/i,
78
+ action: {
79
+ indentAction: monaco_editor_core_exports.languages.IndentAction.IndentOutdent
80
+ }
81
+ },
82
+ {
83
+ beforeText: new RegExp(
84
+ `<(?!(?:${EMPTY_ELEMENTS.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,
85
+ "i"
86
+ ),
87
+ action: { indentAction: monaco_editor_core_exports.languages.IndentAction.Indent }
88
+ }
89
+ ]
90
+ };
91
+ var language = {
92
+ defaultToken: "",
93
+ tokenPostfix: "",
94
+ // ignoreCase: true,
95
+ // The main tokenizer for our languages
96
+ tokenizer: {
97
+ root: [
98
+ [/\{\{!--/, "comment.block.start.handlebars", "@commentBlock"],
99
+ [/\{\{!/, "comment.start.handlebars", "@comment"],
100
+ [/\{\{/, { token: "@rematch", switchTo: "@handlebarsInSimpleState.root" }],
101
+ [/<!DOCTYPE/, "metatag.html", "@doctype"],
102
+ [/<!--/, "comment.html", "@commentHtml"],
103
+ [/(<)(\w+)(\/>)/, ["delimiter.html", "tag.html", "delimiter.html"]],
104
+ [/(<)(script)/, ["delimiter.html", { token: "tag.html", next: "@script" }]],
105
+ [/(<)(style)/, ["delimiter.html", { token: "tag.html", next: "@style" }]],
106
+ [/(<)([:\w]+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
107
+ [/(<\/)(\w+)/, ["delimiter.html", { token: "tag.html", next: "@otherTag" }]],
108
+ [/</, "delimiter.html"],
109
+ [/\{/, "delimiter.html"],
110
+ [/[^<{]+/]
111
+ // text
112
+ ],
113
+ doctype: [
114
+ [
115
+ /\{\{/,
116
+ {
117
+ token: "@rematch",
118
+ switchTo: "@handlebarsInSimpleState.comment"
119
+ }
120
+ ],
121
+ [/[^>]+/, "metatag.content.html"],
122
+ [/>/, "metatag.html", "@pop"]
123
+ ],
124
+ comment: [
125
+ [/\}\}/, "comment.end.handlebars", "@pop"],
126
+ [/./, "comment.content.handlebars"]
127
+ ],
128
+ commentBlock: [
129
+ [/--\}\}/, "comment.block.end.handlebars", "@pop"],
130
+ [/./, "comment.content.handlebars"]
131
+ ],
132
+ commentHtml: [
133
+ [
134
+ /\{\{/,
135
+ {
136
+ token: "@rematch",
137
+ switchTo: "@handlebarsInSimpleState.comment"
138
+ }
139
+ ],
140
+ [/-->/, "comment.html", "@pop"],
141
+ [/[^-]+/, "comment.content.html"],
142
+ [/./, "comment.content.html"]
143
+ ],
144
+ otherTag: [
145
+ [
146
+ /\{\{/,
147
+ {
148
+ token: "@rematch",
149
+ switchTo: "@handlebarsInSimpleState.otherTag"
150
+ }
151
+ ],
152
+ [/\/?>/, "delimiter.html", "@pop"],
153
+ [/"([^"]*)"/, "attribute.value"],
154
+ [/'([^']*)'/, "attribute.value"],
155
+ [/[\w\-]+/, "attribute.name"],
156
+ [/=/, "delimiter"],
157
+ [/[ \t\r\n]+/]
158
+ // whitespace
159
+ ],
160
+ // -- BEGIN <script> tags handling
161
+ // After <script
162
+ script: [
163
+ [
164
+ /\{\{/,
165
+ {
166
+ token: "@rematch",
167
+ switchTo: "@handlebarsInSimpleState.script"
168
+ }
169
+ ],
170
+ [/type/, "attribute.name", "@scriptAfterType"],
171
+ [/"([^"]*)"/, "attribute.value"],
172
+ [/'([^']*)'/, "attribute.value"],
173
+ [/[\w\-]+/, "attribute.name"],
174
+ [/=/, "delimiter"],
175
+ [
176
+ />/,
177
+ {
178
+ token: "delimiter.html",
179
+ next: "@scriptEmbedded.text/javascript",
180
+ nextEmbedded: "text/javascript"
181
+ }
182
+ ],
183
+ [/[ \t\r\n]+/],
184
+ // whitespace
185
+ [
186
+ /(<\/)(script\s*)(>)/,
187
+ ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }]
188
+ ]
189
+ ],
190
+ // After <script ... type
191
+ scriptAfterType: [
192
+ [
193
+ /\{\{/,
194
+ {
195
+ token: "@rematch",
196
+ switchTo: "@handlebarsInSimpleState.scriptAfterType"
197
+ }
198
+ ],
199
+ [/=/, "delimiter", "@scriptAfterTypeEquals"],
200
+ [
201
+ />/,
202
+ {
203
+ token: "delimiter.html",
204
+ next: "@scriptEmbedded.text/javascript",
205
+ nextEmbedded: "text/javascript"
206
+ }
207
+ ],
208
+ // cover invalid e.g. <script type>
209
+ [/[ \t\r\n]+/],
210
+ // whitespace
211
+ [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
212
+ ],
213
+ // After <script ... type =
214
+ scriptAfterTypeEquals: [
215
+ [
216
+ /\{\{/,
217
+ {
218
+ token: "@rematch",
219
+ switchTo: "@handlebarsInSimpleState.scriptAfterTypeEquals"
220
+ }
221
+ ],
222
+ [
223
+ /"([^"]*)"/,
224
+ {
225
+ token: "attribute.value",
226
+ switchTo: "@scriptWithCustomType.$1"
227
+ }
228
+ ],
229
+ [
230
+ /'([^']*)'/,
231
+ {
232
+ token: "attribute.value",
233
+ switchTo: "@scriptWithCustomType.$1"
234
+ }
235
+ ],
236
+ [
237
+ />/,
238
+ {
239
+ token: "delimiter.html",
240
+ next: "@scriptEmbedded.text/javascript",
241
+ nextEmbedded: "text/javascript"
242
+ }
243
+ ],
244
+ // cover invalid e.g. <script type=>
245
+ [/[ \t\r\n]+/],
246
+ // whitespace
247
+ [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
248
+ ],
249
+ // After <script ... type = $S2
250
+ scriptWithCustomType: [
251
+ [
252
+ /\{\{/,
253
+ {
254
+ token: "@rematch",
255
+ switchTo: "@handlebarsInSimpleState.scriptWithCustomType.$S2"
256
+ }
257
+ ],
258
+ [
259
+ />/,
260
+ {
261
+ token: "delimiter.html",
262
+ next: "@scriptEmbedded.$S2",
263
+ nextEmbedded: "$S2"
264
+ }
265
+ ],
266
+ [/"([^"]*)"/, "attribute.value"],
267
+ [/'([^']*)'/, "attribute.value"],
268
+ [/[\w\-]+/, "attribute.name"],
269
+ [/=/, "delimiter"],
270
+ [/[ \t\r\n]+/],
271
+ // whitespace
272
+ [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
273
+ ],
274
+ scriptEmbedded: [
275
+ [
276
+ /\{\{/,
277
+ {
278
+ token: "@rematch",
279
+ switchTo: "@handlebarsInEmbeddedState.scriptEmbedded.$S2",
280
+ nextEmbedded: "@pop"
281
+ }
282
+ ],
283
+ [/<\/script/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }]
284
+ ],
285
+ // -- END <script> tags handling
286
+ // -- BEGIN <style> tags handling
287
+ // After <style
288
+ style: [
289
+ [
290
+ /\{\{/,
291
+ {
292
+ token: "@rematch",
293
+ switchTo: "@handlebarsInSimpleState.style"
294
+ }
295
+ ],
296
+ [/type/, "attribute.name", "@styleAfterType"],
297
+ [/"([^"]*)"/, "attribute.value"],
298
+ [/'([^']*)'/, "attribute.value"],
299
+ [/[\w\-]+/, "attribute.name"],
300
+ [/=/, "delimiter"],
301
+ [
302
+ />/,
303
+ {
304
+ token: "delimiter.html",
305
+ next: "@styleEmbedded.text/css",
306
+ nextEmbedded: "text/css"
307
+ }
308
+ ],
309
+ [/[ \t\r\n]+/],
310
+ // whitespace
311
+ [
312
+ /(<\/)(style\s*)(>)/,
313
+ ["delimiter.html", "tag.html", { token: "delimiter.html", next: "@pop" }]
314
+ ]
315
+ ],
316
+ // After <style ... type
317
+ styleAfterType: [
318
+ [
319
+ /\{\{/,
320
+ {
321
+ token: "@rematch",
322
+ switchTo: "@handlebarsInSimpleState.styleAfterType"
323
+ }
324
+ ],
325
+ [/=/, "delimiter", "@styleAfterTypeEquals"],
326
+ [
327
+ />/,
328
+ {
329
+ token: "delimiter.html",
330
+ next: "@styleEmbedded.text/css",
331
+ nextEmbedded: "text/css"
332
+ }
333
+ ],
334
+ // cover invalid e.g. <style type>
335
+ [/[ \t\r\n]+/],
336
+ // whitespace
337
+ [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
338
+ ],
339
+ // After <style ... type =
340
+ styleAfterTypeEquals: [
341
+ [
342
+ /\{\{/,
343
+ {
344
+ token: "@rematch",
345
+ switchTo: "@handlebarsInSimpleState.styleAfterTypeEquals"
346
+ }
347
+ ],
348
+ [
349
+ /"([^"]*)"/,
350
+ {
351
+ token: "attribute.value",
352
+ switchTo: "@styleWithCustomType.$1"
353
+ }
354
+ ],
355
+ [
356
+ /'([^']*)'/,
357
+ {
358
+ token: "attribute.value",
359
+ switchTo: "@styleWithCustomType.$1"
360
+ }
361
+ ],
362
+ [
363
+ />/,
364
+ {
365
+ token: "delimiter.html",
366
+ next: "@styleEmbedded.text/css",
367
+ nextEmbedded: "text/css"
368
+ }
369
+ ],
370
+ // cover invalid e.g. <style type=>
371
+ [/[ \t\r\n]+/],
372
+ // whitespace
373
+ [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
374
+ ],
375
+ // After <style ... type = $S2
376
+ styleWithCustomType: [
377
+ [
378
+ /\{\{/,
379
+ {
380
+ token: "@rematch",
381
+ switchTo: "@handlebarsInSimpleState.styleWithCustomType.$S2"
382
+ }
383
+ ],
384
+ [
385
+ />/,
386
+ {
387
+ token: "delimiter.html",
388
+ next: "@styleEmbedded.$S2",
389
+ nextEmbedded: "$S2"
390
+ }
391
+ ],
392
+ [/"([^"]*)"/, "attribute.value"],
393
+ [/'([^']*)'/, "attribute.value"],
394
+ [/[\w\-]+/, "attribute.name"],
395
+ [/=/, "delimiter"],
396
+ [/[ \t\r\n]+/],
397
+ // whitespace
398
+ [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
399
+ ],
400
+ styleEmbedded: [
401
+ [
402
+ /\{\{/,
403
+ {
404
+ token: "@rematch",
405
+ switchTo: "@handlebarsInEmbeddedState.styleEmbedded.$S2",
406
+ nextEmbedded: "@pop"
407
+ }
408
+ ],
409
+ [/<\/style/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }]
410
+ ],
411
+ // -- END <style> tags handling
412
+ handlebarsInSimpleState: [
413
+ [/\{\{\{?/, "delimiter.handlebars"],
414
+ [/\}\}\}?/, { token: "delimiter.handlebars", switchTo: "@$S2.$S3" }],
415
+ { include: "handlebarsRoot" }
416
+ ],
417
+ handlebarsInEmbeddedState: [
418
+ [/\{\{\{?/, "delimiter.handlebars"],
419
+ [
420
+ /\}\}\}?/,
421
+ {
422
+ token: "delimiter.handlebars",
423
+ switchTo: "@$S2.$S3",
424
+ nextEmbedded: "$S3"
425
+ }
426
+ ],
427
+ { include: "handlebarsRoot" }
428
+ ],
429
+ handlebarsRoot: [
430
+ [/"[^"]*"/, "string.handlebars"],
431
+ [/[#/][^\s}]+/, "keyword.helper.handlebars"],
432
+ [/else\b/, "keyword.helper.handlebars"],
433
+ [/[\s]+/],
434
+ [/[^}]/, "variable.parameter.handlebars"]
435
+ ]
436
+ }
437
+ };
438
+
439
+ export { conf, language };
@@ -0,0 +1,19 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ /*!-----------------------------------------------------------------------------
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
+ * Version: 0.47.0(undefined)
6
+ * Released under the MIT license
7
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
8
+ *-----------------------------------------------------------------------------*/
9
+
10
+ registerLanguage({
11
+ id: "hcl",
12
+ extensions: [".tf", ".tfvars", ".hcl"],
13
+ aliases: ["Terraform", "tf", "HCL", "hcl"],
14
+ loader: () => {
15
+ {
16
+ return import('./hcl.js');
17
+ }
18
+ }
19
+ });
package/hcl/hcl.js ADDED
@@ -0,0 +1,191 @@
1
+ /*!-----------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Version: 0.47.0(undefined)
4
+ * Released under the MIT license
5
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
6
+ *-----------------------------------------------------------------------------*/
7
+
8
+
9
+ // src/basic-languages/hcl/hcl.ts
10
+ var conf = {
11
+ comments: {
12
+ lineComment: "#",
13
+ blockComment: ["/*", "*/"]
14
+ },
15
+ brackets: [
16
+ ["{", "}"],
17
+ ["[", "]"],
18
+ ["(", ")"]
19
+ ],
20
+ autoClosingPairs: [
21
+ { open: "{", close: "}" },
22
+ { open: "[", close: "]" },
23
+ { open: "(", close: ")" },
24
+ { open: '"', close: '"', notIn: ["string"] }
25
+ ],
26
+ surroundingPairs: [
27
+ { open: "{", close: "}" },
28
+ { open: "[", close: "]" },
29
+ { open: "(", close: ")" },
30
+ { open: '"', close: '"' }
31
+ ]
32
+ };
33
+ var language = {
34
+ defaultToken: "",
35
+ tokenPostfix: ".hcl",
36
+ keywords: [
37
+ "var",
38
+ "local",
39
+ "path",
40
+ "for_each",
41
+ "any",
42
+ "string",
43
+ "number",
44
+ "bool",
45
+ "true",
46
+ "false",
47
+ "null",
48
+ "if ",
49
+ "else ",
50
+ "endif ",
51
+ "for ",
52
+ "in",
53
+ "endfor"
54
+ ],
55
+ operators: [
56
+ "=",
57
+ ">=",
58
+ "<=",
59
+ "==",
60
+ "!=",
61
+ "+",
62
+ "-",
63
+ "*",
64
+ "/",
65
+ "%",
66
+ "&&",
67
+ "||",
68
+ "!",
69
+ "<",
70
+ ">",
71
+ "?",
72
+ "...",
73
+ ":"
74
+ ],
75
+ symbols: /[=><!~?:&|+\-*\/\^%]+/,
76
+ escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
77
+ terraformFunctions: /(abs|ceil|floor|log|max|min|pow|signum|chomp|format|formatlist|indent|join|lower|regex|regexall|replace|split|strrev|substr|title|trimspace|upper|chunklist|coalesce|coalescelist|compact|concat|contains|distinct|element|flatten|index|keys|length|list|lookup|map|matchkeys|merge|range|reverse|setintersection|setproduct|setunion|slice|sort|transpose|values|zipmap|base64decode|base64encode|base64gzip|csvdecode|jsondecode|jsonencode|urlencode|yamldecode|yamlencode|abspath|dirname|pathexpand|basename|file|fileexists|fileset|filebase64|templatefile|formatdate|timeadd|timestamp|base64sha256|base64sha512|bcrypt|filebase64sha256|filebase64sha512|filemd5|filemd1|filesha256|filesha512|md5|rsadecrypt|sha1|sha256|sha512|uuid|uuidv5|cidrhost|cidrnetmask|cidrsubnet|tobool|tolist|tomap|tonumber|toset|tostring)/,
78
+ terraformMainBlocks: /(module|data|terraform|resource|provider|variable|output|locals)/,
79
+ tokenizer: {
80
+ root: [
81
+ // highlight main blocks
82
+ [
83
+ /^@terraformMainBlocks([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)(\{)/,
84
+ ["type", "", "string", "", "string", "", "@brackets"]
85
+ ],
86
+ // highlight all the remaining blocks
87
+ [
88
+ /(\w+[ \t]+)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)(\{)/,
89
+ ["identifier", "", "string", "", "string", "", "@brackets"]
90
+ ],
91
+ // highlight block
92
+ [
93
+ /(\w+[ \t]+)([ \t]*)([\w-]+|"[\w-]+"|)([ \t]*)([\w-]+|"[\w-]+"|)(=)(\{)/,
94
+ ["identifier", "", "string", "", "operator", "", "@brackets"]
95
+ ],
96
+ // terraform general highlight - shared with expressions
97
+ { include: "@terraform" }
98
+ ],
99
+ terraform: [
100
+ // highlight terraform functions
101
+ [/@terraformFunctions(\()/, ["type", "@brackets"]],
102
+ // all other words are variables or keywords
103
+ [
104
+ /[a-zA-Z_]\w*-*/,
105
+ // must work with variables such as foo-bar and also with negative numbers
106
+ {
107
+ cases: {
108
+ "@keywords": { token: "keyword.$0" },
109
+ "@default": "variable"
110
+ }
111
+ }
112
+ ],
113
+ { include: "@whitespace" },
114
+ { include: "@heredoc" },
115
+ // delimiters and operators
116
+ [/[{}()\[\]]/, "@brackets"],
117
+ [/[<>](?!@symbols)/, "@brackets"],
118
+ [
119
+ /@symbols/,
120
+ {
121
+ cases: {
122
+ "@operators": "operator",
123
+ "@default": ""
124
+ }
125
+ }
126
+ ],
127
+ // numbers
128
+ [/\d*\d+[eE]([\-+]?\d+)?/, "number.float"],
129
+ [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
130
+ [/\d[\d']*/, "number"],
131
+ [/\d/, "number"],
132
+ [/[;,.]/, "delimiter"],
133
+ // delimiter: after number because of .\d floats
134
+ // strings
135
+ [/"/, "string", "@string"],
136
+ // this will include expressions
137
+ [/'/, "invalid"]
138
+ ],
139
+ heredoc: [
140
+ [/<<[-]*\s*["]?([\w\-]+)["]?/, { token: "string.heredoc.delimiter", next: "@heredocBody.$1" }]
141
+ ],
142
+ heredocBody: [
143
+ [
144
+ /([\w\-]+)$/,
145
+ {
146
+ cases: {
147
+ "$1==$S2": [
148
+ {
149
+ token: "string.heredoc.delimiter",
150
+ next: "@popall"
151
+ }
152
+ ],
153
+ "@default": "string.heredoc"
154
+ }
155
+ }
156
+ ],
157
+ [/./, "string.heredoc"]
158
+ ],
159
+ whitespace: [
160
+ [/[ \t\r\n]+/, ""],
161
+ [/\/\*/, "comment", "@comment"],
162
+ [/\/\/.*$/, "comment"],
163
+ [/#.*$/, "comment"]
164
+ ],
165
+ comment: [
166
+ [/[^\/*]+/, "comment"],
167
+ [/\*\//, "comment", "@pop"],
168
+ [/[\/*]/, "comment"]
169
+ ],
170
+ string: [
171
+ [/\$\{/, { token: "delimiter", next: "@stringExpression" }],
172
+ [/[^\\"\$]+/, "string"],
173
+ [/@escapes/, "string.escape"],
174
+ [/\\./, "string.escape.invalid"],
175
+ [/"/, "string", "@popall"]
176
+ ],
177
+ stringInsideExpression: [
178
+ [/[^\\"]+/, "string"],
179
+ [/@escapes/, "string.escape"],
180
+ [/\\./, "string.escape.invalid"],
181
+ [/"/, "string", "@pop"]
182
+ ],
183
+ stringExpression: [
184
+ [/\}/, { token: "delimiter", next: "@pop" }],
185
+ [/"/, "string", "@stringInsideExpression"],
186
+ { include: "@terraform" }
187
+ ]
188
+ }
189
+ };
190
+
191
+ export { conf, language };
@@ -0,0 +1,20 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ /*!-----------------------------------------------------------------------------
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
+ * Version: 0.47.0(undefined)
6
+ * Released under the MIT license
7
+ * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
8
+ *-----------------------------------------------------------------------------*/
9
+
10
+ registerLanguage({
11
+ id: "html",
12
+ extensions: [".html", ".htm", ".shtml", ".xhtml", ".mdoc", ".jsp", ".asp", ".aspx", ".jshtm"],
13
+ aliases: ["HTML", "htm", "html", "xhtml"],
14
+ mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
15
+ loader: () => {
16
+ {
17
+ return import('./html.js');
18
+ }
19
+ }
20
+ });