@codingame/monaco-vscode-standalone-languages 23.2.0 → 23.2.2

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 (165) hide show
  1. package/_.contribution.js +48 -0
  2. package/abap/abap.contribution.js +8 -0
  3. package/abap/abap.js +1397 -0
  4. package/apex/apex.contribution.js +9 -0
  5. package/apex/apex.js +329 -0
  6. package/azcli/azcli.contribution.js +8 -0
  7. package/azcli/azcli.js +67 -0
  8. package/bat/bat.contribution.js +8 -0
  9. package/bat/bat.js +99 -0
  10. package/bicep/bicep.contribution.js +8 -0
  11. package/bicep/bicep.js +108 -0
  12. package/cameligo/cameligo.contribution.js +8 -0
  13. package/cameligo/cameligo.js +173 -0
  14. package/clojure/clojure.contribution.js +8 -0
  15. package/clojure/clojure.js +760 -0
  16. package/coffee/coffee.contribution.js +9 -0
  17. package/coffee/coffee.js +231 -0
  18. package/cpp/cpp.contribution.js +14 -0
  19. package/cpp/cpp.js +388 -0
  20. package/csharp/csharp.contribution.js +8 -0
  21. package/csharp/csharp.js +325 -0
  22. package/csp/csp.contribution.js +8 -0
  23. package/csp/csp.js +52 -0
  24. package/css/css.contribution.js +9 -0
  25. package/css/css.js +184 -0
  26. package/cypher/cypher.contribution.js +8 -0
  27. package/cypher/cypher.js +262 -0
  28. package/dart/dart.contribution.js +9 -0
  29. package/dart/dart.js +280 -0
  30. package/dockerfile/dockerfile.contribution.js +9 -0
  31. package/dockerfile/dockerfile.js +129 -0
  32. package/ecl/ecl.contribution.js +8 -0
  33. package/ecl/ecl.js +455 -0
  34. package/elixir/elixir.contribution.js +8 -0
  35. package/elixir/elixir.js +568 -0
  36. package/flow9/flow9.contribution.js +8 -0
  37. package/flow9/flow9.js +141 -0
  38. package/freemarker2/freemarker2.contribution.js +52 -0
  39. package/freemarker2/freemarker2.js +990 -0
  40. package/fsharp/fsharp.contribution.js +8 -0
  41. package/fsharp/fsharp.js +216 -0
  42. package/go/go.contribution.js +8 -0
  43. package/go/go.js +217 -0
  44. package/graphql/graphql.contribution.js +9 -0
  45. package/graphql/graphql.js +150 -0
  46. package/handlebars/handlebars.contribution.js +9 -0
  47. package/handlebars/handlebars.js +413 -0
  48. package/hcl/hcl.contribution.js +8 -0
  49. package/hcl/hcl.js +182 -0
  50. package/html/html.contribution.js +9 -0
  51. package/html/html.js +302 -0
  52. package/index.js +81 -48
  53. package/ini/ini.contribution.js +9 -0
  54. package/ini/ini.js +70 -0
  55. package/java/java.contribution.js +9 -0
  56. package/java/java.js +231 -0
  57. package/javascript/javascript.contribution.js +11 -0
  58. package/javascript/javascript.js +70 -0
  59. package/julia/julia.contribution.js +8 -0
  60. package/julia/julia.js +510 -0
  61. package/kotlin/kotlin.contribution.js +9 -0
  62. package/kotlin/kotlin.js +251 -0
  63. package/less/less.contribution.js +9 -0
  64. package/less/less.js +160 -0
  65. package/lexon/lexon.contribution.js +8 -0
  66. package/lexon/lexon.js +156 -0
  67. package/liquid/liquid.contribution.js +9 -0
  68. package/liquid/liquid.js +234 -0
  69. package/lua/lua.contribution.js +8 -0
  70. package/lua/lua.js +161 -0
  71. package/m3/m3.contribution.js +8 -0
  72. package/m3/m3.js +209 -0
  73. package/markdown/markdown.contribution.js +8 -0
  74. package/markdown/markdown.js +228 -0
  75. package/mdx/mdx.contribution.js +8 -0
  76. package/mdx/mdx.js +158 -0
  77. package/mips/mips.contribution.js +9 -0
  78. package/mips/mips.js +197 -0
  79. package/msdax/msdax.contribution.js +8 -0
  80. package/msdax/msdax.js +374 -0
  81. package/mysql/mysql.contribution.js +8 -0
  82. package/mysql/mysql.js +877 -0
  83. package/objective-c/objective-c.contribution.js +8 -0
  84. package/objective-c/objective-c.js +182 -0
  85. package/package.json +2 -2
  86. package/pascal/pascal.contribution.js +9 -0
  87. package/pascal/pascal.js +250 -0
  88. package/pascaligo/pascaligo.contribution.js +8 -0
  89. package/pascaligo/pascaligo.js +163 -0
  90. package/perl/perl.contribution.js +8 -0
  91. package/perl/perl.js +625 -0
  92. package/pgsql/pgsql.contribution.js +8 -0
  93. package/pgsql/pgsql.js +850 -0
  94. package/php/php.contribution.js +9 -0
  95. package/php/php.js +499 -0
  96. package/pla/pla.contribution.js +7 -0
  97. package/pla/pla.js +136 -0
  98. package/postiats/postiats.contribution.js +8 -0
  99. package/postiats/postiats.js +906 -0
  100. package/powerquery/powerquery.contribution.js +8 -0
  101. package/powerquery/powerquery.js +889 -0
  102. package/powershell/powershell.contribution.js +8 -0
  103. package/powershell/powershell.js +238 -0
  104. package/protobuf/protobuf.contribution.js +8 -0
  105. package/protobuf/protobuf.js +419 -0
  106. package/pug/pug.contribution.js +8 -0
  107. package/pug/pug.js +401 -0
  108. package/python/python.contribution.js +9 -0
  109. package/python/python.js +294 -0
  110. package/qsharp/qsharp.contribution.js +8 -0
  111. package/qsharp/qsharp.js +300 -0
  112. package/r/r.contribution.js +8 -0
  113. package/r/r.js +242 -0
  114. package/razor/razor.contribution.js +9 -0
  115. package/razor/razor.js +544 -0
  116. package/redis/redis.contribution.js +8 -0
  117. package/redis/redis.js +301 -0
  118. package/redshift/redshift.contribution.js +8 -0
  119. package/redshift/redshift.js +808 -0
  120. package/restructuredtext/restructuredtext.contribution.js +8 -0
  121. package/restructuredtext/restructuredtext.js +173 -0
  122. package/ruby/ruby.contribution.js +9 -0
  123. package/ruby/ruby.js +510 -0
  124. package/rust/rust.contribution.js +8 -0
  125. package/rust/rust.js +342 -0
  126. package/sb/sb.contribution.js +8 -0
  127. package/sb/sb.js +114 -0
  128. package/scala/scala.contribution.js +9 -0
  129. package/scala/scala.js +369 -0
  130. package/scheme/scheme.contribution.js +8 -0
  131. package/scheme/scheme.js +107 -0
  132. package/scss/scss.contribution.js +9 -0
  133. package/scss/scss.js +259 -0
  134. package/shell/shell.contribution.js +8 -0
  135. package/shell/shell.js +220 -0
  136. package/solidity/solidity.contribution.js +8 -0
  137. package/solidity/solidity.js +1366 -0
  138. package/sophia/sophia.contribution.js +8 -0
  139. package/sophia/sophia.js +198 -0
  140. package/sparql/sparql.contribution.js +8 -0
  141. package/sparql/sparql.js +200 -0
  142. package/sql/sql.contribution.js +8 -0
  143. package/sql/sql.js +852 -0
  144. package/st/st.contribution.js +8 -0
  145. package/st/st.js +415 -0
  146. package/swift/swift.contribution.js +9 -0
  147. package/swift/swift.js +311 -0
  148. package/systemverilog/systemverilog.contribution.js +14 -0
  149. package/systemverilog/systemverilog.js +575 -0
  150. package/tcl/tcl.contribution.js +8 -0
  151. package/tcl/tcl.js +231 -0
  152. package/twig/twig.contribution.js +9 -0
  153. package/twig/twig.js +391 -0
  154. package/typescript/typescript.contribution.js +11 -0
  155. package/typescript/typescript.js +336 -0
  156. package/typespec/typespec.contribution.js +8 -0
  157. package/typespec/typespec.js +126 -0
  158. package/vb/vb.contribution.js +8 -0
  159. package/vb/vb.js +371 -0
  160. package/wgsl/wgsl.contribution.js +8 -0
  161. package/wgsl/wgsl.js +452 -0
  162. package/xml/xml.contribution.js +28 -0
  163. package/xml/xml.js +88 -0
  164. package/yaml/yaml.contribution.js +9 -0
  165. package/yaml/yaml.js +199 -0
package/html/html.js ADDED
@@ -0,0 +1,302 @@
1
+ import { languages } from 'monaco-editor';
2
+
3
+ const EMPTY_ELEMENTS = [
4
+ "area",
5
+ "base",
6
+ "br",
7
+ "col",
8
+ "embed",
9
+ "hr",
10
+ "img",
11
+ "input",
12
+ "keygen",
13
+ "link",
14
+ "menuitem",
15
+ "meta",
16
+ "param",
17
+ "source",
18
+ "track",
19
+ "wbr"
20
+ ];
21
+ const conf = {
22
+ wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
23
+ comments: {
24
+ blockComment: ["<!--", "-->"]
25
+ },
26
+ brackets: [
27
+ ["<!--", "-->"],
28
+ ["<", ">"],
29
+ ["{", "}"],
30
+ ["(", ")"]
31
+ ],
32
+ autoClosingPairs: [
33
+ { open: "{", close: "}" },
34
+ { open: "[", close: "]" },
35
+ { open: "(", close: ")" },
36
+ { open: '"', close: '"' },
37
+ { open: "'", close: "'" }
38
+ ],
39
+ surroundingPairs: [
40
+ { open: '"', close: '"' },
41
+ { open: "'", close: "'" },
42
+ { open: "{", close: "}" },
43
+ { open: "[", close: "]" },
44
+ { open: "(", close: ")" },
45
+ { open: "<", close: ">" }
46
+ ],
47
+ onEnterRules: [
48
+ {
49
+ beforeText: new RegExp(
50
+ `<(?!(?:${EMPTY_ELEMENTS.join("|")}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,
51
+ "i"
52
+ ),
53
+ afterText: /^<\/([_:\w][_:\w-.\d]*)\s*>$/i,
54
+ action: {
55
+ indentAction: languages.IndentAction.IndentOutdent
56
+ }
57
+ },
58
+ {
59
+ beforeText: new RegExp(
60
+ `<(?!(?:${EMPTY_ELEMENTS.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,
61
+ "i"
62
+ ),
63
+ action: { indentAction: languages.IndentAction.Indent }
64
+ }
65
+ ],
66
+ folding: {
67
+ markers: {
68
+ start: new RegExp("^\\s*<!--\\s*#region\\b.*-->"),
69
+ end: new RegExp("^\\s*<!--\\s*#endregion\\b.*-->")
70
+ }
71
+ }
72
+ };
73
+ const language = {
74
+ defaultToken: "",
75
+ tokenPostfix: ".html",
76
+ ignoreCase: true,
77
+ // The main tokenizer for our languages
78
+ tokenizer: {
79
+ root: [
80
+ [/<!DOCTYPE/, "metatag", "@doctype"],
81
+ [/<!--/, "comment", "@comment"],
82
+ [/(<)((?:[\w\-]+:)?[\w\-]+)(\s*)(\/>)/, ["delimiter", "tag", "", "delimiter"]],
83
+ [/(<)(script)/, ["delimiter", { token: "tag", next: "@script" }]],
84
+ [/(<)(style)/, ["delimiter", { token: "tag", next: "@style" }]],
85
+ [/(<)((?:[\w\-]+:)?[\w\-]+)/, ["delimiter", { token: "tag", next: "@otherTag" }]],
86
+ [/(<\/)((?:[\w\-]+:)?[\w\-]+)/, ["delimiter", { token: "tag", next: "@otherTag" }]],
87
+ [/</, "delimiter"],
88
+ [/[^<]+/]
89
+ // text
90
+ ],
91
+ doctype: [
92
+ [/[^>]+/, "metatag.content"],
93
+ [/>/, "metatag", "@pop"]
94
+ ],
95
+ comment: [
96
+ [/-->/, "comment", "@pop"],
97
+ [/[^-]+/, "comment.content"],
98
+ [/./, "comment.content"]
99
+ ],
100
+ otherTag: [
101
+ [/\/?>/, "delimiter", "@pop"],
102
+ [/"([^"]*)"/, "attribute.value"],
103
+ [/'([^']*)'/, "attribute.value"],
104
+ [/[\w\-]+/, "attribute.name"],
105
+ [/=/, "delimiter"],
106
+ [/[ \t\r\n]+/]
107
+ // whitespace
108
+ ],
109
+ // -- BEGIN <script> tags handling
110
+ // After <script
111
+ script: [
112
+ [/type/, "attribute.name", "@scriptAfterType"],
113
+ [/"([^"]*)"/, "attribute.value"],
114
+ [/'([^']*)'/, "attribute.value"],
115
+ [/[\w\-]+/, "attribute.name"],
116
+ [/=/, "delimiter"],
117
+ [
118
+ />/,
119
+ {
120
+ token: "delimiter",
121
+ next: "@scriptEmbedded",
122
+ nextEmbedded: "text/javascript"
123
+ }
124
+ ],
125
+ [/[ \t\r\n]+/],
126
+ // whitespace
127
+ [/(<\/)(script\s*)(>)/, ["delimiter", "tag", { token: "delimiter", next: "@pop" }]]
128
+ ],
129
+ // After <script ... type
130
+ scriptAfterType: [
131
+ [/=/, "delimiter", "@scriptAfterTypeEquals"],
132
+ [
133
+ />/,
134
+ {
135
+ token: "delimiter",
136
+ next: "@scriptEmbedded",
137
+ nextEmbedded: "text/javascript"
138
+ }
139
+ ],
140
+ // cover invalid e.g. <script type>
141
+ [/[ \t\r\n]+/],
142
+ // whitespace
143
+ [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
144
+ ],
145
+ // After <script ... type =
146
+ scriptAfterTypeEquals: [
147
+ [
148
+ /"module"/,
149
+ {
150
+ token: "attribute.value",
151
+ switchTo: "@scriptWithCustomType.text/javascript"
152
+ }
153
+ ],
154
+ [
155
+ /'module'/,
156
+ {
157
+ token: "attribute.value",
158
+ switchTo: "@scriptWithCustomType.text/javascript"
159
+ }
160
+ ],
161
+ [
162
+ /"([^"]*)"/,
163
+ {
164
+ token: "attribute.value",
165
+ switchTo: "@scriptWithCustomType.$1"
166
+ }
167
+ ],
168
+ [
169
+ /'([^']*)'/,
170
+ {
171
+ token: "attribute.value",
172
+ switchTo: "@scriptWithCustomType.$1"
173
+ }
174
+ ],
175
+ [
176
+ />/,
177
+ {
178
+ token: "delimiter",
179
+ next: "@scriptEmbedded",
180
+ nextEmbedded: "text/javascript"
181
+ }
182
+ ],
183
+ // cover invalid e.g. <script type=>
184
+ [/[ \t\r\n]+/],
185
+ // whitespace
186
+ [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
187
+ ],
188
+ // After <script ... type = $S2
189
+ scriptWithCustomType: [
190
+ [
191
+ />/,
192
+ {
193
+ token: "delimiter",
194
+ next: "@scriptEmbedded.$S2",
195
+ nextEmbedded: "$S2"
196
+ }
197
+ ],
198
+ [/"([^"]*)"/, "attribute.value"],
199
+ [/'([^']*)'/, "attribute.value"],
200
+ [/[\w\-]+/, "attribute.name"],
201
+ [/=/, "delimiter"],
202
+ [/[ \t\r\n]+/],
203
+ // whitespace
204
+ [/<\/script\s*>/, { token: "@rematch", next: "@pop" }]
205
+ ],
206
+ scriptEmbedded: [
207
+ [/<\/script/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
208
+ [/[^<]+/, ""]
209
+ ],
210
+ // -- END <script> tags handling
211
+ // -- BEGIN <style> tags handling
212
+ // After <style
213
+ style: [
214
+ [/type/, "attribute.name", "@styleAfterType"],
215
+ [/"([^"]*)"/, "attribute.value"],
216
+ [/'([^']*)'/, "attribute.value"],
217
+ [/[\w\-]+/, "attribute.name"],
218
+ [/=/, "delimiter"],
219
+ [
220
+ />/,
221
+ {
222
+ token: "delimiter",
223
+ next: "@styleEmbedded",
224
+ nextEmbedded: "text/css"
225
+ }
226
+ ],
227
+ [/[ \t\r\n]+/],
228
+ // whitespace
229
+ [/(<\/)(style\s*)(>)/, ["delimiter", "tag", { token: "delimiter", next: "@pop" }]]
230
+ ],
231
+ // After <style ... type
232
+ styleAfterType: [
233
+ [/=/, "delimiter", "@styleAfterTypeEquals"],
234
+ [
235
+ />/,
236
+ {
237
+ token: "delimiter",
238
+ next: "@styleEmbedded",
239
+ nextEmbedded: "text/css"
240
+ }
241
+ ],
242
+ // cover invalid e.g. <style type>
243
+ [/[ \t\r\n]+/],
244
+ // whitespace
245
+ [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
246
+ ],
247
+ // After <style ... type =
248
+ styleAfterTypeEquals: [
249
+ [
250
+ /"([^"]*)"/,
251
+ {
252
+ token: "attribute.value",
253
+ switchTo: "@styleWithCustomType.$1"
254
+ }
255
+ ],
256
+ [
257
+ /'([^']*)'/,
258
+ {
259
+ token: "attribute.value",
260
+ switchTo: "@styleWithCustomType.$1"
261
+ }
262
+ ],
263
+ [
264
+ />/,
265
+ {
266
+ token: "delimiter",
267
+ next: "@styleEmbedded",
268
+ nextEmbedded: "text/css"
269
+ }
270
+ ],
271
+ // cover invalid e.g. <style type=>
272
+ [/[ \t\r\n]+/],
273
+ // whitespace
274
+ [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
275
+ ],
276
+ // After <style ... type = $S2
277
+ styleWithCustomType: [
278
+ [
279
+ />/,
280
+ {
281
+ token: "delimiter",
282
+ next: "@styleEmbedded.$S2",
283
+ nextEmbedded: "$S2"
284
+ }
285
+ ],
286
+ [/"([^"]*)"/, "attribute.value"],
287
+ [/'([^']*)'/, "attribute.value"],
288
+ [/[\w\-]+/, "attribute.name"],
289
+ [/=/, "delimiter"],
290
+ [/[ \t\r\n]+/],
291
+ // whitespace
292
+ [/<\/style\s*>/, { token: "@rematch", next: "@pop" }]
293
+ ],
294
+ styleEmbedded: [
295
+ [/<\/style/, { token: "@rematch", next: "@pop", nextEmbedded: "@pop" }],
296
+ [/[^<]+/, ""]
297
+ ]
298
+ // -- END <style> tags handling
299
+ }
300
+ };
301
+
302
+ export { conf, language };
package/index.js CHANGED
@@ -1,48 +1,81 @@
1
- import { languages } from 'monaco-editor';
2
-
3
- const languageDefinitions = {};
4
- const lazyLanguageLoaders = {};
5
- class LazyLanguageLoader {
6
- static getOrCreate(languageId) {
7
- if (!lazyLanguageLoaders[languageId]) {
8
- lazyLanguageLoaders[languageId] = new LazyLanguageLoader(languageId);
9
- }
10
- return lazyLanguageLoaders[languageId];
11
- }
12
- constructor(languageId) {
13
- this._languageId = languageId;
14
- this._loadingTriggered = false;
15
- this._lazyLoadPromise = new Promise((resolve, reject) => {
16
- this._lazyLoadPromiseResolve = resolve;
17
- this._lazyLoadPromiseReject = reject;
18
- });
19
- }
20
- load() {
21
- if (!this._loadingTriggered) {
22
- this._loadingTriggered = true;
23
- languageDefinitions[this._languageId].loader().then(
24
- (mod) => this._lazyLoadPromiseResolve(mod),
25
- (err) => this._lazyLoadPromiseReject(err)
26
- );
27
- }
28
- return this._lazyLoadPromise;
29
- }
30
- }
31
- function registerLanguage(def) {
32
- const languageId = def.id;
33
- languageDefinitions[languageId] = def;
34
- languages.register(def);
35
- const lazyLanguageLoader = LazyLanguageLoader.getOrCreate(languageId);
36
- languages.registerTokensProviderFactory(languageId, {
37
- create: async () => {
38
- const mod = await lazyLanguageLoader.load();
39
- return mod.language;
40
- }
41
- });
42
- languages.onLanguageEncountered(languageId, async () => {
43
- const mod = await lazyLanguageLoader.load();
44
- languages.setLanguageConfiguration(languageId, mod.conf);
45
- });
46
- }
47
-
48
- export { registerLanguage };
1
+ import './abap/abap.contribution.js';
2
+ import './apex/apex.contribution.js';
3
+ import './azcli/azcli.contribution.js';
4
+ import './bat/bat.contribution.js';
5
+ import './bicep/bicep.contribution.js';
6
+ import './cameligo/cameligo.contribution.js';
7
+ import './clojure/clojure.contribution.js';
8
+ import './coffee/coffee.contribution.js';
9
+ import './cpp/cpp.contribution.js';
10
+ import './csharp/csharp.contribution.js';
11
+ import './csp/csp.contribution.js';
12
+ import './css/css.contribution.js';
13
+ import './cypher/cypher.contribution.js';
14
+ import './dart/dart.contribution.js';
15
+ import './dockerfile/dockerfile.contribution.js';
16
+ import './ecl/ecl.contribution.js';
17
+ import './elixir/elixir.contribution.js';
18
+ import './flow9/flow9.contribution.js';
19
+ import './fsharp/fsharp.contribution.js';
20
+ import './freemarker2/freemarker2.contribution.js';
21
+ import './go/go.contribution.js';
22
+ import './graphql/graphql.contribution.js';
23
+ import './handlebars/handlebars.contribution.js';
24
+ import './hcl/hcl.contribution.js';
25
+ import './html/html.contribution.js';
26
+ import './ini/ini.contribution.js';
27
+ import './java/java.contribution.js';
28
+ import './javascript/javascript.contribution.js';
29
+ import './julia/julia.contribution.js';
30
+ import './kotlin/kotlin.contribution.js';
31
+ import './less/less.contribution.js';
32
+ import './lexon/lexon.contribution.js';
33
+ import './lua/lua.contribution.js';
34
+ import './liquid/liquid.contribution.js';
35
+ import './m3/m3.contribution.js';
36
+ import './markdown/markdown.contribution.js';
37
+ import './mdx/mdx.contribution.js';
38
+ import './mips/mips.contribution.js';
39
+ import './msdax/msdax.contribution.js';
40
+ import './mysql/mysql.contribution.js';
41
+ import './objective-c/objective-c.contribution.js';
42
+ import './pascal/pascal.contribution.js';
43
+ import './pascaligo/pascaligo.contribution.js';
44
+ import './perl/perl.contribution.js';
45
+ import './pgsql/pgsql.contribution.js';
46
+ import './php/php.contribution.js';
47
+ import './pla/pla.contribution.js';
48
+ import './postiats/postiats.contribution.js';
49
+ import './powerquery/powerquery.contribution.js';
50
+ import './powershell/powershell.contribution.js';
51
+ import './protobuf/protobuf.contribution.js';
52
+ import './pug/pug.contribution.js';
53
+ import './python/python.contribution.js';
54
+ import './qsharp/qsharp.contribution.js';
55
+ import './r/r.contribution.js';
56
+ import './razor/razor.contribution.js';
57
+ import './redis/redis.contribution.js';
58
+ import './redshift/redshift.contribution.js';
59
+ import './restructuredtext/restructuredtext.contribution.js';
60
+ import './ruby/ruby.contribution.js';
61
+ import './rust/rust.contribution.js';
62
+ import './sb/sb.contribution.js';
63
+ import './scala/scala.contribution.js';
64
+ import './scheme/scheme.contribution.js';
65
+ import './scss/scss.contribution.js';
66
+ import './shell/shell.contribution.js';
67
+ import './solidity/solidity.contribution.js';
68
+ import './sophia/sophia.contribution.js';
69
+ import './sparql/sparql.contribution.js';
70
+ import './sql/sql.contribution.js';
71
+ import './st/st.contribution.js';
72
+ import './swift/swift.contribution.js';
73
+ import './systemverilog/systemverilog.contribution.js';
74
+ import './tcl/tcl.contribution.js';
75
+ import './twig/twig.contribution.js';
76
+ import './typescript/typescript.contribution.js';
77
+ import './typespec/typespec.contribution.js';
78
+ import './vb/vb.contribution.js';
79
+ import './wgsl/wgsl.contribution.js';
80
+ import './xml/xml.contribution.js';
81
+ import './yaml/yaml.contribution.js';
@@ -0,0 +1,9 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "ini",
5
+ extensions: [".ini", ".properties", ".gitconfig"],
6
+ filenames: ["config", ".gitattributes", ".gitconfig", ".editorconfig"],
7
+ aliases: ["Ini", "ini"],
8
+ loader: () => import('./ini.js')
9
+ });
package/ini/ini.js ADDED
@@ -0,0 +1,70 @@
1
+ const conf = {
2
+ comments: {
3
+ lineComment: "#"
4
+ },
5
+ brackets: [
6
+ ["{", "}"],
7
+ ["[", "]"],
8
+ ["(", ")"]
9
+ ],
10
+ autoClosingPairs: [
11
+ { open: "{", close: "}" },
12
+ { open: "[", close: "]" },
13
+ { open: "(", close: ")" },
14
+ { open: '"', close: '"' },
15
+ { open: "'", close: "'" }
16
+ ],
17
+ surroundingPairs: [
18
+ { open: "{", close: "}" },
19
+ { open: "[", close: "]" },
20
+ { open: "(", close: ")" },
21
+ { open: '"', close: '"' },
22
+ { open: "'", close: "'" }
23
+ ]
24
+ };
25
+ const language = {
26
+ defaultToken: "",
27
+ tokenPostfix: ".ini",
28
+ // we include these common regular expressions
29
+ escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
30
+ // The main tokenizer for our languages
31
+ tokenizer: {
32
+ root: [
33
+ // sections
34
+ [/^\[[^\]]*\]/, "metatag"],
35
+ // keys
36
+ [/(^\w+)(\s*)(\=)/, ["key", "", "delimiter"]],
37
+ // whitespace
38
+ { include: "@whitespace" },
39
+ // numbers
40
+ [/\d+/, "number"],
41
+ // strings: recover on non-terminated strings
42
+ [/"([^"\\]|\\.)*$/, "string.invalid"],
43
+ // non-teminated string
44
+ [/'([^'\\]|\\.)*$/, "string.invalid"],
45
+ // non-teminated string
46
+ [/"/, "string", '@string."'],
47
+ [/'/, "string", "@string.'"]
48
+ ],
49
+ whitespace: [
50
+ [/[ \t\r\n]+/, ""],
51
+ [/^\s*[#;].*$/, "comment"]
52
+ ],
53
+ string: [
54
+ [/[^\\"']+/, "string"],
55
+ [/@escapes/, "string.escape"],
56
+ [/\\./, "string.escape.invalid"],
57
+ [
58
+ /["']/,
59
+ {
60
+ cases: {
61
+ "$#==$S2": { token: "string", next: "@pop" },
62
+ "@default": "string"
63
+ }
64
+ }
65
+ ]
66
+ ]
67
+ }
68
+ };
69
+
70
+ export { conf, language };
@@ -0,0 +1,9 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "java",
5
+ extensions: [".java", ".jav"],
6
+ aliases: ["Java", "java"],
7
+ mimetypes: ["text/x-java-source", "text/x-java"],
8
+ loader: () => import('./java.js')
9
+ });