@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
@@ -0,0 +1,8 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "fsharp",
5
+ extensions: [".fs", ".fsi", ".ml", ".mli", ".fsx", ".fsscript"],
6
+ aliases: ["F#", "FSharp", "fsharp"],
7
+ loader: () => import('./fsharp.js')
8
+ });
@@ -0,0 +1,216 @@
1
+ const conf = {
2
+ comments: {
3
+ lineComment: "//",
4
+ blockComment: ["(*", "*)"]
5
+ },
6
+ brackets: [
7
+ ["{", "}"],
8
+ ["[", "]"],
9
+ ["(", ")"]
10
+ ],
11
+ autoClosingPairs: [
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
+ folding: {
25
+ markers: {
26
+ start: new RegExp("^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)"),
27
+ end: new RegExp("^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)")
28
+ }
29
+ }
30
+ };
31
+ const language = {
32
+ defaultToken: "",
33
+ tokenPostfix: ".fs",
34
+ keywords: [
35
+ "abstract",
36
+ "and",
37
+ "atomic",
38
+ "as",
39
+ "assert",
40
+ "asr",
41
+ "base",
42
+ "begin",
43
+ "break",
44
+ "checked",
45
+ "component",
46
+ "const",
47
+ "constraint",
48
+ "constructor",
49
+ "continue",
50
+ "class",
51
+ "default",
52
+ "delegate",
53
+ "do",
54
+ "done",
55
+ "downcast",
56
+ "downto",
57
+ "elif",
58
+ "else",
59
+ "end",
60
+ "exception",
61
+ "eager",
62
+ "event",
63
+ "external",
64
+ "extern",
65
+ "false",
66
+ "finally",
67
+ "for",
68
+ "fun",
69
+ "function",
70
+ "fixed",
71
+ "functor",
72
+ "global",
73
+ "if",
74
+ "in",
75
+ "include",
76
+ "inherit",
77
+ "inline",
78
+ "interface",
79
+ "internal",
80
+ "land",
81
+ "lor",
82
+ "lsl",
83
+ "lsr",
84
+ "lxor",
85
+ "lazy",
86
+ "let",
87
+ "match",
88
+ "member",
89
+ "mod",
90
+ "module",
91
+ "mutable",
92
+ "namespace",
93
+ "method",
94
+ "mixin",
95
+ "new",
96
+ "not",
97
+ "null",
98
+ "of",
99
+ "open",
100
+ "or",
101
+ "object",
102
+ "override",
103
+ "private",
104
+ "parallel",
105
+ "process",
106
+ "protected",
107
+ "pure",
108
+ "public",
109
+ "rec",
110
+ "return",
111
+ "static",
112
+ "sealed",
113
+ "struct",
114
+ "sig",
115
+ "then",
116
+ "to",
117
+ "true",
118
+ "tailcall",
119
+ "trait",
120
+ "try",
121
+ "type",
122
+ "upcast",
123
+ "use",
124
+ "val",
125
+ "void",
126
+ "virtual",
127
+ "volatile",
128
+ "when",
129
+ "while",
130
+ "with",
131
+ "yield"
132
+ ],
133
+ // we include these common regular expressions
134
+ symbols: /[=><!~?:&|+\-*\^%;\.,\/]+/,
135
+ escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
136
+ integersuffix: /[uU]?[yslnLI]?/,
137
+ floatsuffix: /[fFmM]?/,
138
+ // The main tokenizer for our languages
139
+ tokenizer: {
140
+ root: [
141
+ // identifiers and keywords
142
+ [
143
+ /[a-zA-Z_]\w*/,
144
+ {
145
+ cases: {
146
+ "@keywords": { token: "keyword.$0" },
147
+ "@default": "identifier"
148
+ }
149
+ }
150
+ ],
151
+ // whitespace
152
+ { include: "@whitespace" },
153
+ // [< attributes >].
154
+ [/\[<.*>\]/, "annotation"],
155
+ // Preprocessor directive
156
+ [/^#(if|else|endif)/, "keyword"],
157
+ // delimiters and operators
158
+ [/[{}()\[\]]/, "@brackets"],
159
+ [/[<>](?!@symbols)/, "@brackets"],
160
+ [/@symbols/, "delimiter"],
161
+ // numbers
162
+ [/\d*\d+[eE]([\-+]?\d+)?(@floatsuffix)/, "number.float"],
163
+ [/\d*\.\d+([eE][\-+]?\d+)?(@floatsuffix)/, "number.float"],
164
+ [/0x[0-9a-fA-F]+LF/, "number.float"],
165
+ [/0x[0-9a-fA-F]+(@integersuffix)/, "number.hex"],
166
+ [/0b[0-1]+(@integersuffix)/, "number.bin"],
167
+ [/\d+(@integersuffix)/, "number"],
168
+ // delimiter: after number because of .\d floats
169
+ [/[;,.]/, "delimiter"],
170
+ // strings
171
+ [/"([^"\\]|\\.)*$/, "string.invalid"],
172
+ // non-teminated string
173
+ [/"""/, "string", '@string."""'],
174
+ [/"/, "string", '@string."'],
175
+ // literal string
176
+ [/\@"/, { token: "string.quote", next: "@litstring" }],
177
+ // characters
178
+ [/'[^\\']'B?/, "string"],
179
+ [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
180
+ [/'/, "string.invalid"]
181
+ ],
182
+ whitespace: [
183
+ [/[ \t\r\n]+/, ""],
184
+ [/\(\*(?!\))/, "comment", "@comment"],
185
+ [/\/\/.*$/, "comment"]
186
+ ],
187
+ comment: [
188
+ [/[^*(]+/, "comment"],
189
+ [/\*\)/, "comment", "@pop"],
190
+ [/\*/, "comment"],
191
+ [/\(\*\)/, "comment"],
192
+ [/\(/, "comment"]
193
+ ],
194
+ string: [
195
+ [/[^\\"]+/, "string"],
196
+ [/@escapes/, "string.escape"],
197
+ [/\\./, "string.escape.invalid"],
198
+ [
199
+ /("""|"B?)/,
200
+ {
201
+ cases: {
202
+ "$#==$S2": { token: "string", next: "@pop" },
203
+ "@default": "string"
204
+ }
205
+ }
206
+ ]
207
+ ],
208
+ litstring: [
209
+ [/[^"]+/, "string"],
210
+ [/""/, "string.escape"],
211
+ [/"/, { token: "string.quote", next: "@pop" }]
212
+ ]
213
+ }
214
+ };
215
+
216
+ export { conf, language };
@@ -0,0 +1,8 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "go",
5
+ extensions: [".go"],
6
+ aliases: ["Go"],
7
+ loader: () => import('./go.js')
8
+ });
package/go/go.js ADDED
@@ -0,0 +1,217 @@
1
+ const conf = {
2
+ comments: {
3
+ lineComment: "//",
4
+ blockComment: ["/*", "*/"]
5
+ },
6
+ brackets: [
7
+ ["{", "}"],
8
+ ["[", "]"],
9
+ ["(", ")"]
10
+ ],
11
+ autoClosingPairs: [
12
+ { open: "{", close: "}" },
13
+ { open: "[", close: "]" },
14
+ { open: "(", close: ")" },
15
+ { open: "`", close: "`", notIn: ["string"] },
16
+ { open: '"', close: '"', notIn: ["string"] },
17
+ { open: "'", close: "'", notIn: ["string", "comment"] }
18
+ ],
19
+ surroundingPairs: [
20
+ { open: "{", close: "}" },
21
+ { open: "[", close: "]" },
22
+ { open: "(", close: ")" },
23
+ { open: "`", close: "`" },
24
+ { open: '"', close: '"' },
25
+ { open: "'", close: "'" }
26
+ ]
27
+ };
28
+ const language = {
29
+ defaultToken: "",
30
+ tokenPostfix: ".go",
31
+ keywords: [
32
+ "break",
33
+ "case",
34
+ "chan",
35
+ "const",
36
+ "continue",
37
+ "default",
38
+ "defer",
39
+ "else",
40
+ "fallthrough",
41
+ "for",
42
+ "func",
43
+ "go",
44
+ "goto",
45
+ "if",
46
+ "import",
47
+ "interface",
48
+ "map",
49
+ "package",
50
+ "range",
51
+ "return",
52
+ "select",
53
+ "struct",
54
+ "switch",
55
+ "type",
56
+ "var",
57
+ "bool",
58
+ "true",
59
+ "false",
60
+ "uint8",
61
+ "uint16",
62
+ "uint32",
63
+ "uint64",
64
+ "int8",
65
+ "int16",
66
+ "int32",
67
+ "int64",
68
+ "float32",
69
+ "float64",
70
+ "complex64",
71
+ "complex128",
72
+ "byte",
73
+ "rune",
74
+ "uint",
75
+ "int",
76
+ "uintptr",
77
+ "string",
78
+ "nil"
79
+ ],
80
+ operators: [
81
+ "+",
82
+ "-",
83
+ "*",
84
+ "/",
85
+ "%",
86
+ "&",
87
+ "|",
88
+ "^",
89
+ "<<",
90
+ ">>",
91
+ "&^",
92
+ "+=",
93
+ "-=",
94
+ "*=",
95
+ "/=",
96
+ "%=",
97
+ "&=",
98
+ "|=",
99
+ "^=",
100
+ "<<=",
101
+ ">>=",
102
+ "&^=",
103
+ "&&",
104
+ "||",
105
+ "<-",
106
+ "++",
107
+ "--",
108
+ "==",
109
+ "<",
110
+ ">",
111
+ "=",
112
+ "!",
113
+ "!=",
114
+ "<=",
115
+ ">=",
116
+ ":=",
117
+ "...",
118
+ "(",
119
+ ")",
120
+ "",
121
+ "]",
122
+ "{",
123
+ "}",
124
+ ",",
125
+ ";",
126
+ ".",
127
+ ":"
128
+ ],
129
+ // we include these common regular expressions
130
+ symbols: /[=><!~?:&|+\-*\/\^%]+/,
131
+ escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
132
+ // The main tokenizer for our languages
133
+ tokenizer: {
134
+ root: [
135
+ // identifiers and keywords
136
+ [
137
+ /[a-zA-Z_]\w*/,
138
+ {
139
+ cases: {
140
+ "@keywords": { token: "keyword.$0" },
141
+ "@default": "identifier"
142
+ }
143
+ }
144
+ ],
145
+ // whitespace
146
+ { include: "@whitespace" },
147
+ // [[ attributes ]].
148
+ [/\[\[.*\]\]/, "annotation"],
149
+ // Preprocessor directive
150
+ [/^\s*#\w+/, "keyword"],
151
+ // delimiters and operators
152
+ [/[{}()\[\]]/, "@brackets"],
153
+ [/[<>](?!@symbols)/, "@brackets"],
154
+ [
155
+ /@symbols/,
156
+ {
157
+ cases: {
158
+ "@operators": "delimiter",
159
+ "@default": ""
160
+ }
161
+ }
162
+ ],
163
+ // numbers
164
+ [/\d*\d+[eE]([\-+]?\d+)?/, "number.float"],
165
+ [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
166
+ [/0[xX][0-9a-fA-F']*[0-9a-fA-F]/, "number.hex"],
167
+ [/0[0-7']*[0-7]/, "number.octal"],
168
+ [/0[bB][0-1']*[0-1]/, "number.binary"],
169
+ [/\d[\d']*/, "number"],
170
+ [/\d/, "number"],
171
+ // delimiter: after number because of .\d floats
172
+ [/[;,.]/, "delimiter"],
173
+ // strings
174
+ [/"([^"\\]|\\.)*$/, "string.invalid"],
175
+ // non-teminated string
176
+ [/"/, "string", "@string"],
177
+ [/`/, "string", "@rawstring"],
178
+ // characters
179
+ [/'[^\\']'/, "string"],
180
+ [/(')(@escapes)(')/, ["string", "string.escape", "string"]],
181
+ [/'/, "string.invalid"]
182
+ ],
183
+ whitespace: [
184
+ [/[ \t\r\n]+/, ""],
185
+ [/\/\*\*(?!\/)/, "comment.doc", "@doccomment"],
186
+ [/\/\*/, "comment", "@comment"],
187
+ [/\/\/.*$/, "comment"]
188
+ ],
189
+ comment: [
190
+ [/[^\/*]+/, "comment"],
191
+ // [/\/\*/, 'comment', '@push' ], // nested comment not allowed :-(
192
+ // [/\/\*/, 'comment.invalid' ], // this breaks block comments in the shape of /* //*/
193
+ [/\*\//, "comment", "@pop"],
194
+ [/[\/*]/, "comment"]
195
+ ],
196
+ //Identical copy of comment above, except for the addition of .doc
197
+ doccomment: [
198
+ [/[^\/*]+/, "comment.doc"],
199
+ // [/\/\*/, 'comment.doc', '@push' ], // nested comment not allowed :-(
200
+ [/\/\*/, "comment.doc.invalid"],
201
+ [/\*\//, "comment.doc", "@pop"],
202
+ [/[\/*]/, "comment.doc"]
203
+ ],
204
+ string: [
205
+ [/[^\\"]+/, "string"],
206
+ [/@escapes/, "string.escape"],
207
+ [/\\./, "string.escape.invalid"],
208
+ [/"/, "string", "@pop"]
209
+ ],
210
+ rawstring: [
211
+ [/[^\`]/, "string"],
212
+ [/`/, "string", "@pop"]
213
+ ]
214
+ }
215
+ };
216
+
217
+ export { conf, language };
@@ -0,0 +1,9 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "graphql",
5
+ extensions: [".graphql", ".gql"],
6
+ aliases: ["GraphQL", "graphql", "gql"],
7
+ mimetypes: ["application/graphql"],
8
+ loader: () => import('./graphql.js')
9
+ });
@@ -0,0 +1,150 @@
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: '"""', notIn: ["string", "comment"] },
15
+ { open: '"', close: '"', notIn: ["string", "comment"] }
16
+ ],
17
+ surroundingPairs: [
18
+ { open: "{", close: "}" },
19
+ { open: "[", close: "]" },
20
+ { open: "(", close: ")" },
21
+ { open: '"""', close: '"""' },
22
+ { open: '"', close: '"' }
23
+ ],
24
+ folding: {
25
+ offSide: true
26
+ }
27
+ };
28
+ const language = {
29
+ // Set defaultToken to invalid to see what you do not tokenize yet
30
+ defaultToken: "invalid",
31
+ tokenPostfix: ".gql",
32
+ keywords: [
33
+ "null",
34
+ "true",
35
+ "false",
36
+ "query",
37
+ "mutation",
38
+ "subscription",
39
+ "extend",
40
+ "schema",
41
+ "directive",
42
+ "scalar",
43
+ "type",
44
+ "interface",
45
+ "union",
46
+ "enum",
47
+ "input",
48
+ "implements",
49
+ "fragment",
50
+ "on"
51
+ ],
52
+ typeKeywords: ["Int", "Float", "String", "Boolean", "ID"],
53
+ directiveLocations: [
54
+ "SCHEMA",
55
+ "SCALAR",
56
+ "OBJECT",
57
+ "FIELD_DEFINITION",
58
+ "ARGUMENT_DEFINITION",
59
+ "INTERFACE",
60
+ "UNION",
61
+ "ENUM",
62
+ "ENUM_VALUE",
63
+ "INPUT_OBJECT",
64
+ "INPUT_FIELD_DEFINITION",
65
+ "QUERY",
66
+ "MUTATION",
67
+ "SUBSCRIPTION",
68
+ "FIELD",
69
+ "FRAGMENT_DEFINITION",
70
+ "FRAGMENT_SPREAD",
71
+ "INLINE_FRAGMENT",
72
+ "VARIABLE_DEFINITION"
73
+ ],
74
+ operators: ["=", "!", "?", ":", "&", "|"],
75
+ // we include these common regular expressions
76
+ symbols: /[=!?:&|]+/,
77
+ // https://facebook.github.io/graphql/draft/#sec-String-Value
78
+ escapes: /\\(?:["\\\/bfnrt]|u[0-9A-Fa-f]{4})/,
79
+ // The main tokenizer for our languages
80
+ tokenizer: {
81
+ root: [
82
+ // fields and argument names
83
+ [
84
+ /[a-z_][\w$]*/,
85
+ {
86
+ cases: {
87
+ "@keywords": "keyword",
88
+ "@default": "key.identifier"
89
+ }
90
+ }
91
+ ],
92
+ // identify typed input variables
93
+ [
94
+ /[$][\w$]*/,
95
+ {
96
+ cases: {
97
+ "@keywords": "keyword",
98
+ "@default": "argument.identifier"
99
+ }
100
+ }
101
+ ],
102
+ // to show class names nicely
103
+ [
104
+ /[A-Z][\w\$]*/,
105
+ {
106
+ cases: {
107
+ "@typeKeywords": "keyword",
108
+ "@default": "type.identifier"
109
+ }
110
+ }
111
+ ],
112
+ // whitespace
113
+ { include: "@whitespace" },
114
+ // delimiters and operators
115
+ [/[{}()\[\]]/, "@brackets"],
116
+ [/@symbols/, { cases: { "@operators": "operator", "@default": "" } }],
117
+ // @ annotations.
118
+ // As an example, we emit a debugging log message on these tokens.
119
+ // Note: message are supressed during the first load -- change some lines to see them.
120
+ [/@\s*[a-zA-Z_\$][\w\$]*/, { token: "annotation", log: "annotation token: $0" }],
121
+ // numbers
122
+ [/\d*\.\d+([eE][\-+]?\d+)?/, "number.float"],
123
+ [/0[xX][0-9a-fA-F]+/, "number.hex"],
124
+ [/\d+/, "number"],
125
+ // delimiter: after number because of .\d floats
126
+ [/[;,.]/, "delimiter"],
127
+ [/"""/, { token: "string", next: "@mlstring", nextEmbedded: "markdown" }],
128
+ // strings
129
+ [/"([^"\\]|\\.)*$/, "string.invalid"],
130
+ // non-teminated string
131
+ [/"/, { token: "string.quote", bracket: "@open", next: "@string" }]
132
+ ],
133
+ mlstring: [
134
+ [/[^"]+/, "string"],
135
+ ['"""', { token: "string", next: "@pop", nextEmbedded: "@pop" }]
136
+ ],
137
+ string: [
138
+ [/[^\\"]+/, "string"],
139
+ [/@escapes/, "string.escape"],
140
+ [/\\./, "string.escape.invalid"],
141
+ [/"/, { token: "string.quote", bracket: "@close", next: "@pop" }]
142
+ ],
143
+ whitespace: [
144
+ [/[ \t\r\n]+/, ""],
145
+ [/#.*$/, "comment"]
146
+ ]
147
+ }
148
+ };
149
+
150
+ export { conf, language };
@@ -0,0 +1,9 @@
1
+ import { registerLanguage } from '../_.contribution.js';
2
+
3
+ registerLanguage({
4
+ id: "handlebars",
5
+ extensions: [".handlebars", ".hbs"],
6
+ aliases: ["Handlebars", "handlebars", "hbs"],
7
+ mimetypes: ["text/x-handlebars-template"],
8
+ loader: () => import('./handlebars.js')
9
+ });