@elastic/monaco-esql 1.0.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ export declare const commands: string[];
2
+ export declare const options: string[];
3
+ export declare const literals: string[];
4
+ export declare const functions: string[];
5
+ export declare const delimiters: string[];
6
+ export declare const operators: {
7
+ named: {
8
+ binary: string[];
9
+ other: string[];
10
+ };
11
+ };
@@ -0,0 +1,218 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.operators = exports.delimiters = exports.functions = exports.literals = exports.options = exports.commands = void 0;
4
+ exports.commands = [
5
+ "DISSECT",
6
+ "DROP",
7
+ "ENRICH",
8
+ "EVAL",
9
+ "EXPLAIN",
10
+ "FORK",
11
+ "FROM",
12
+ "FULL JOIN",
13
+ "GROK",
14
+ "INFO",
15
+ "INLINESTATS",
16
+ "JOIN",
17
+ "KEEP",
18
+ "LEFT JOIN",
19
+ "LEFT",
20
+ "LIMIT",
21
+ "LOOKUP JOIN",
22
+ "LOOKUP",
23
+ "METRICS",
24
+ "MV_EXPAND",
25
+ "RENAME",
26
+ "RIGHT JOIN",
27
+ "RIGHT",
28
+ "ROW",
29
+ "SHOW INFO",
30
+ "SHOW",
31
+ "SORT",
32
+ "STATS",
33
+ "WHERE",
34
+ ];
35
+ exports.options = ["BY", "ON", "WITH", "METADATA", "WHERE"];
36
+ exports.literals = ["TRUE", "FALSE", "NULL"];
37
+ exports.functions = [
38
+ "ABS",
39
+ "ACOS",
40
+ "ASIN",
41
+ "ATAN",
42
+ "ATAN2",
43
+ "AVG",
44
+ "BIT_LENGTH",
45
+ "BUCKET",
46
+ "BYTE_LENGTH",
47
+ "CASE",
48
+ "CATEGORIZE",
49
+ "CBRT",
50
+ "CEIL",
51
+ "CIDR_MATCH",
52
+ "COALESCE",
53
+ "CONCAT",
54
+ "COS",
55
+ "COSH",
56
+ "COUNT_DISTINCT",
57
+ "COUNT",
58
+ "DATE_DIFF",
59
+ "DATE_EXTRACT",
60
+ "DATE_FORMAT",
61
+ "DATE_PARSE",
62
+ "DATE_TRUNC",
63
+ "E",
64
+ "ENDS_WITH",
65
+ "EXP",
66
+ "FLOOR",
67
+ "FROM_BASE64",
68
+ "GREATEST",
69
+ "HASH",
70
+ "HYPOT",
71
+ "IP_PREFIX",
72
+ "LEAST",
73
+ "LEFT",
74
+ "LENGTH",
75
+ "LOCATE",
76
+ "LOG",
77
+ "LOG10",
78
+ "LTRIM",
79
+ "MATCH",
80
+ "MAX",
81
+ "MEDIAN_ABSOLUTE_DEVIATION",
82
+ "MEDIAN",
83
+ "MIN",
84
+ "MV_APPEND",
85
+ "MV_AVG",
86
+ "MV_CONCAT",
87
+ "MV_COUNT",
88
+ "MV_DEDUPE",
89
+ "MV_FIRST",
90
+ "MV_LAST",
91
+ "MV_MAX",
92
+ "MV_MEDIAN_ABSOLUTE_DEVIATION",
93
+ "MV_MEDIAN",
94
+ "MV_MIN",
95
+ "MV_PERCENTILE",
96
+ "MV_PSERIES_WEIGHTED_SUM",
97
+ "MV_SLICE",
98
+ "MV_SORT",
99
+ "MV_SUM",
100
+ "MV_ZIP",
101
+ "NOW",
102
+ "PERCENTILE",
103
+ "PI",
104
+ "POW",
105
+ "QSTR",
106
+ "REPEAT",
107
+ "REPLACE",
108
+ "REVERSE",
109
+ "RIGHT",
110
+ "ROUND",
111
+ "RTRIM",
112
+ "SIGNUM",
113
+ "SIN",
114
+ "SINH",
115
+ "SPACE",
116
+ "SPLIT",
117
+ "SQRT",
118
+ "ST_CENTROID_AGG",
119
+ "ST_CONTAINS",
120
+ "ST_DISJOINT",
121
+ "ST_DISTANCE",
122
+ "ST_ENVELOPE",
123
+ "ST_EXTENT_AGG",
124
+ "ST_INTERSECTS",
125
+ "ST_WITHIN",
126
+ "ST_X",
127
+ "ST_XMAX",
128
+ "ST_XMIN",
129
+ "ST_Y",
130
+ "ST_YMAX",
131
+ "ST_YMIN",
132
+ "STARTS_WITH",
133
+ "STD_DEV",
134
+ "SUBSTRING",
135
+ "SUM",
136
+ "TAN",
137
+ "TANH",
138
+ "TAU",
139
+ "TO_BASE64",
140
+ "TO_BOOLEAN",
141
+ "TO_CARTESIANPOINT",
142
+ "TO_CARTESIANSHAPE",
143
+ "TO_DATE_NANOS",
144
+ "TO_DATEPERIOD",
145
+ "TO_DATETIME",
146
+ "TO_DEGREES",
147
+ "TO_DOUBLE",
148
+ "TO_GEOPOINT",
149
+ "TO_GEOSHAPE",
150
+ "TO_INTEGER",
151
+ "TO_IP",
152
+ "TO_LONG",
153
+ "TO_LOWER",
154
+ "TO_RADIANS",
155
+ "TO_STRING",
156
+ "TO_TIMEDURATION",
157
+ "TO_UNSIGNED_LONG",
158
+ "TO_UPPER",
159
+ "TO_VERSION",
160
+ "TOP",
161
+ "TRIM",
162
+ "VALUES",
163
+ "WEIGHTED_AVG",
164
+ ];
165
+ exports.delimiters = [
166
+ "/",
167
+ ".",
168
+ ",",
169
+ "=~",
170
+ "<=",
171
+ ">=",
172
+ "==",
173
+ "!=",
174
+ "===",
175
+ "!==",
176
+ "=>",
177
+ "+",
178
+ "-",
179
+ "**",
180
+ "*",
181
+ "/",
182
+ "%",
183
+ "++",
184
+ "--",
185
+ "<<",
186
+ "</",
187
+ ">>",
188
+ ">>>",
189
+ "&",
190
+ "|",
191
+ "^",
192
+ "!",
193
+ "~",
194
+ "&&",
195
+ "||",
196
+ "?",
197
+ ":",
198
+ "=",
199
+ "+=",
200
+ "-=",
201
+ "*=",
202
+ "**=",
203
+ "/=",
204
+ "%=",
205
+ "<<=",
206
+ ">>=",
207
+ ">>>=",
208
+ "&=",
209
+ "|=",
210
+ "^=",
211
+ "@",
212
+ ];
213
+ exports.operators = {
214
+ named: {
215
+ binary: ["AND", "OR", "IS", "IN", "AS", "LIKE", "RLIKE"],
216
+ other: ["ASC", "DESC", "FIRST", "LAST", "NULLS", "NOT"],
217
+ },
218
+ };
package/lib/index.d.ts CHANGED
@@ -1 +1 @@
1
- export { monarchLanguage } from "./monarch";
1
+ export * as monarch from "./monarch";
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.monarchLanguage = void 0;
4
- var monarch_1 = require("./monarch");
5
- Object.defineProperty(exports, "monarchLanguage", { enumerable: true, get: function () { return monarch_1.monarchLanguage; } });
3
+ exports.monarch = void 0;
4
+ const tslib_1 = require("tslib");
5
+ exports.monarch = tslib_1.__importStar(require("./monarch"));
@@ -0,0 +1 @@
1
+ export declare const language: import("monaco-editor").languages.IMonarchLanguage;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.language = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const monarch_1 = require("./monarch");
6
+ const definitions = tslib_1.__importStar(require("./definitions"));
7
+ exports.language = (0, monarch_1.create)(definitions);
package/lib/monarch.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import type { languages } from "monaco-editor";
2
- export declare const monarchLanguage: languages.IMonarchLanguage;
2
+ export type CreateDependencies = Partial<typeof import("./definitions")>;
3
+ export declare const create: (deps?: CreateDependencies) => languages.IMonarchLanguage;
package/lib/monarch.js CHANGED
@@ -1,359 +1,156 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.monarchLanguage = void 0;
4
- const commands = [
5
- "DISSECT",
6
- "DROP",
7
- "ENRICH",
8
- "EVAL",
9
- "EXPLAIN",
10
- "FROM",
11
- "FULL JOIN",
12
- "GROK",
13
- "INFO",
14
- "INLINESTATS",
15
- "JOIN",
16
- "KEEP",
17
- "LEFT JOIN",
18
- "LEFT",
19
- "LIMIT",
20
- "LOOKUP JOIN",
21
- "LOOKUP",
22
- "METRICS",
23
- "MV_EXPAND",
24
- "RENAME",
25
- "RIGHT JOIN",
26
- "RIGHT",
27
- "ROW",
28
- "SHOW INFO",
29
- "SHOW",
30
- "SORT",
31
- "STATS",
32
- "WHERE",
33
- ];
34
- const options = ["BY", "ON", "WITH", "METADATA", "WHERE"];
35
- const literals = ["TRUE", "FALSE", "NULL"];
36
- const functions = [
37
- "ABS",
38
- "ACOS",
39
- "ASIN",
40
- "ATAN",
41
- "ATAN2",
42
- "AVG",
43
- "BIT_LENGTH",
44
- "BUCKET",
45
- "BYTE_LENGTH",
46
- "CASE",
47
- "CATEGORIZE",
48
- "CBRT",
49
- "CEIL",
50
- "CIDR_MATCH",
51
- "COALESCE",
52
- "CONCAT",
53
- "COS",
54
- "COSH",
55
- "COUNT_DISTINCT",
56
- "COUNT",
57
- "DATE_DIFF",
58
- "DATE_EXTRACT",
59
- "DATE_FORMAT",
60
- "DATE_PARSE",
61
- "DATE_TRUNC",
62
- "E",
63
- "ENDS_WITH",
64
- "EXP",
65
- "FLOOR",
66
- "FROM_BASE64",
67
- "GREATEST",
68
- "HASH",
69
- "HYPOT",
70
- "IP_PREFIX",
71
- "LEAST",
72
- "LEFT",
73
- "LENGTH",
74
- "LOCATE",
75
- "LOG",
76
- "LOG10",
77
- "LTRIM",
78
- "MATCH",
79
- "MAX",
80
- "MEDIAN_ABSOLUTE_DEVIATION",
81
- "MEDIAN",
82
- "MIN",
83
- "MV_APPEND",
84
- "MV_AVG",
85
- "MV_CONCAT",
86
- "MV_COUNT",
87
- "MV_DEDUPE",
88
- "MV_FIRST",
89
- "MV_LAST",
90
- "MV_MAX",
91
- "MV_MEDIAN_ABSOLUTE_DEVIATION",
92
- "MV_MEDIAN",
93
- "MV_MIN",
94
- "MV_PERCENTILE",
95
- "MV_PSERIES_WEIGHTED_SUM",
96
- "MV_SLICE",
97
- "MV_SORT",
98
- "MV_SUM",
99
- "MV_ZIP",
100
- "NOW",
101
- "PERCENTILE",
102
- "PI",
103
- "POW",
104
- "QSTR",
105
- "REPEAT",
106
- "REPLACE",
107
- "REVERSE",
108
- "RIGHT",
109
- "ROUND",
110
- "RTRIM",
111
- "SIGNUM",
112
- "SIN",
113
- "SINH",
114
- "SPACE",
115
- "SPLIT",
116
- "SQRT",
117
- "ST_CENTROID_AGG",
118
- "ST_CONTAINS",
119
- "ST_DISJOINT",
120
- "ST_DISTANCE",
121
- "ST_ENVELOPE",
122
- "ST_EXTENT_AGG",
123
- "ST_INTERSECTS",
124
- "ST_WITHIN",
125
- "ST_X",
126
- "ST_XMAX",
127
- "ST_XMIN",
128
- "ST_Y",
129
- "ST_YMAX",
130
- "ST_YMIN",
131
- "STARTS_WITH",
132
- "STD_DEV",
133
- "SUBSTRING",
134
- "SUM",
135
- "TAN",
136
- "TANH",
137
- "TAU",
138
- "TO_BASE64",
139
- "TO_BOOLEAN",
140
- "TO_CARTESIANPOINT",
141
- "TO_CARTESIANSHAPE",
142
- "TO_DATE_NANOS",
143
- "TO_DATEPERIOD",
144
- "TO_DATETIME",
145
- "TO_DEGREES",
146
- "TO_DOUBLE",
147
- "TO_GEOPOINT",
148
- "TO_GEOSHAPE",
149
- "TO_INTEGER",
150
- "TO_IP",
151
- "TO_LONG",
152
- "TO_LOWER",
153
- "TO_RADIANS",
154
- "TO_STRING",
155
- "TO_TIMEDURATION",
156
- "TO_UNSIGNED_LONG",
157
- "TO_UPPER",
158
- "TO_VERSION",
159
- "TOP",
160
- "TRIM",
161
- "VALUES",
162
- "WEIGHTED_AVG",
163
- ];
164
- const delimiters = [
165
- "/",
166
- ".",
167
- ",",
168
- "=~",
169
- "<=",
170
- ">=",
171
- "==",
172
- "!=",
173
- "===",
174
- "!==",
175
- "=>",
176
- "+",
177
- "-",
178
- "**",
179
- "*",
180
- "/",
181
- "%",
182
- "++",
183
- "--",
184
- "<<",
185
- "</",
186
- ">>",
187
- ">>>",
188
- "&",
189
- "|",
190
- "^",
191
- "!",
192
- "~",
193
- "&&",
194
- "||",
195
- "?",
196
- ":",
197
- "=",
198
- "+=",
199
- "-=",
200
- "*=",
201
- "**=",
202
- "/=",
203
- "%=",
204
- "<<=",
205
- ">>=",
206
- ">>>=",
207
- "&=",
208
- "|=",
209
- "^=",
210
- "@",
211
- ];
212
- const binaryNamedOperators = ["AND", "OR", "IS", "IN", "AS", "LIKE", "RLIKE"];
213
- const otherNamedOperators = ["ASC", "DESC", "FIRST", "LAST", "NULLS", "NOT"];
214
- exports.monarchLanguage = {
215
- // Uncomment when developing.
216
- // defaultToken: "invalid",
217
- // ES|QL is case-insensitive.
218
- ignoreCase: true,
219
- // Lists of known language keywords and built-ins.
220
- commands,
221
- options,
222
- literals,
223
- functions,
224
- delimiters,
225
- namedOperators: [...binaryNamedOperators, ...otherNamedOperators],
226
- // Pre-defined regular expressions.
227
- escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
228
- digits: /\d+(_+\d+)*/,
229
- brackets: [
230
- { open: "[", close: "]", token: "delimiter.square" },
231
- { open: "(", close: ")", token: "delimiter.parenthesis" },
232
- { open: "{", close: "}", token: "delimiter.curly" },
233
- { open: "<", close: ">", token: "delimiter.angle" },
234
- ],
235
- tokenizer: {
236
- root: [
237
- { include: "@whitespace" },
238
- // Keywords
239
- [
240
- /[a-zA-Z_$][\w$]*/,
241
- {
242
- cases: {
243
- "@commands": { token: "keyword.command.$0" },
244
- "@options": { token: "keyword.option.$0" },
245
- "@literals": { token: "keyword.literal.$0" },
246
- "@functions": { token: "identifier.function.$0" },
247
- "@namedOperators": { token: "keyword.operator.$0" },
248
- "@default": "identifier",
3
+ exports.create = void 0;
4
+ const create = (deps = {}) => {
5
+ const { commands = [], options = [], literals = [], functions = [], delimiters = [], } = deps;
6
+ return {
7
+ // Uncomment when developing.
8
+ // defaultToken: "invalid",
9
+ // ES|QL is case-insensitive.
10
+ ignoreCase: true,
11
+ // Lists of known language keywords and built-ins.
12
+ commands,
13
+ options,
14
+ literals,
15
+ functions,
16
+ delimiters,
17
+ namedOperators: [
18
+ ...(deps.operators?.named?.binary ?? []),
19
+ ...(deps.operators?.named?.other ?? []),
20
+ ],
21
+ // Pre-defined regular expressions.
22
+ escapes: /\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
23
+ digits: /\d+(_+\d+)*/,
24
+ brackets: [
25
+ { open: "[", close: "]", token: "delimiter.square" },
26
+ { open: "(", close: ")", token: "delimiter.parenthesis" },
27
+ { open: "{", close: "}", token: "delimiter.curly" },
28
+ { open: "<", close: ">", token: "delimiter.angle" },
29
+ ],
30
+ tokenizer: {
31
+ root: [
32
+ { include: "@whitespace" },
33
+ // Keywords
34
+ [
35
+ /[a-zA-Z_$][\w$]*/,
36
+ {
37
+ cases: {
38
+ "@commands": { token: "keyword.command.$0" },
39
+ "@options": { token: "keyword.option.$0" },
40
+ "@literals": { token: "keyword.literal.$0" },
41
+ "@functions": { token: "identifier.function.$0" },
42
+ "@namedOperators": { token: "keyword.operator.$0" },
43
+ "@default": "identifier",
44
+ },
249
45
  },
250
- },
251
- ],
252
- { include: "@expression" },
253
- { include: "@processingCommand" },
254
- [/\[|\(|\)|\]/, "@brackets"],
255
- [
256
- /[^\s]+/,
257
- {
258
- cases: {
259
- "@delimiters": "delimiter",
46
+ ],
47
+ { include: "@expression" },
48
+ { include: "@processingCommand" },
49
+ [/\[|\(|\)|\]/, "@brackets"],
50
+ [
51
+ /[^\s]+/,
52
+ {
53
+ cases: {
54
+ "@delimiters": "delimiter",
55
+ },
260
56
  },
261
- },
57
+ ],
262
58
  ],
263
- ],
264
- // --------------------------------- Hidden channel: whitespace and comments
265
- whitespace: [
266
- [/[ \t\r\n]+/, ""],
267
- [/\/\*\*(?!\/)/, "comment.doc", "@doc"],
268
- [/\/\*/, "comment", "@comment"],
269
- [/\/\/.*$/, "comment"],
270
- ],
271
- comment: [
272
- [/[^\/*]+/, "comment"],
273
- [/\*\//, "comment", "@pop"],
274
- [/[\/*]/, "comment"],
275
- ],
276
- doc: [
277
- [/[^\/*]+/, "comment.doc"],
278
- [/\*\//, "comment.doc", "@pop"],
279
- [/[\/*]/, "comment.doc"],
280
- ],
281
- // ---------------------------------------------------------------- Commands
282
- // This code block allows to color commands when they are followed by a pipe
283
- // character "|", this way all new processing commands are color even if
284
- // they are not part of the command name list.
285
- processingCommand: [
286
- [
287
- /\|/,
288
- { token: "delimiter.pipe", switchTo: "@beforeMnemonicWhitespace" },
59
+ // --------------------------------- Hidden channel: whitespace and comments
60
+ whitespace: [
61
+ [/[ \t\r\n]+/, ""],
62
+ [/\/\*\*(?!\/)/, "comment.doc", "@doc"],
63
+ [/\/\*/, "comment", "@comment"],
64
+ [/\/\/.*$/, "comment"],
289
65
  ],
290
- ],
291
- beforeMnemonicWhitespace: [
292
- { include: "@whitespace" },
293
- ["", { token: "", switchTo: "@commandName" }],
294
- ],
295
- // Matches *command name*, i.e. the mnemonic.
296
- commandName: [
297
- // First tries to match all known command names.
298
- [
299
- commands.join("|"),
300
- { token: "keyword.command.name", switchTo: "@root" },
66
+ comment: [
67
+ [/[^\/*]+/, "comment"],
68
+ [/\*\//, "comment", "@pop"],
69
+ [/[\/*]/, "comment"],
301
70
  ],
302
- // If command name is not well known, just matches the first word.
303
- [/\w+\b/, { token: "keyword.command.name", switchTo: "@root" }],
304
- ],
305
- // ------------------------------------------------------------- Expressions
306
- expression: [
307
- { include: "@whitespace" },
308
- { include: "@literal" },
309
- // Inline casts: 1.3::INTEGER
310
- [/::\w+\b/, "type"],
311
- // strings
312
- [/"""/, "string.triple", "@string_triple"],
313
- [/"([^"\\]|\\.)*$/, "string.invalid"], // non-terminated string
314
- [/'([^'\\]|\\.)*$/, "string.invalid"], // non-terminated string
315
- [/"/, "string", "@string"],
316
- // Escaped column parts: nested.`escaped`.column
317
- [/`/, "string", "@column_escape_part"],
318
- ],
319
- literal: [
320
- { include: "@number" },
321
- // Params
322
- [
323
- /\?{1,9}(([a-zA-Z_][a-zA-Z_0-9]+)|[0-9]+)?/,
324
- {
325
- cases: {
326
- "\\?{1,9}": "variable.name.unnamed",
327
- "\\?{1,9}([a-zA-Z_][a-zA-Z_0-9]+)?": "variable.name.named",
328
- "\\?{1,9}([0-9]+)?": "variable.name.positional",
71
+ doc: [
72
+ [/[^\/*]+/, "comment.doc"],
73
+ [/\*\//, "comment.doc", "@pop"],
74
+ [/[\/*]/, "comment.doc"],
75
+ ],
76
+ // ---------------------------------------------------------------- Commands
77
+ // This code block allows to color commands when they are followed by a pipe
78
+ // character "|", this way all new processing commands are color even if
79
+ // they are not part of the command name list.
80
+ processingCommand: [
81
+ [
82
+ /\|/,
83
+ { token: "delimiter.pipe", switchTo: "@beforeMnemonicWhitespace" },
84
+ ],
85
+ ],
86
+ beforeMnemonicWhitespace: [
87
+ { include: "@whitespace" },
88
+ ["", { token: "", switchTo: "@commandName" }],
89
+ ],
90
+ // Matches *command name*, i.e. the mnemonic.
91
+ commandName: [
92
+ // First tries to match all known command names.
93
+ [
94
+ commands.join("|"),
95
+ { token: "keyword.command.name", switchTo: "@root" },
96
+ ],
97
+ // If command name is not well known, just matches the first word.
98
+ [/\w+\b/, { token: "keyword.command.name", switchTo: "@root" }],
99
+ ],
100
+ // ------------------------------------------------------------- Expressions
101
+ expression: [
102
+ { include: "@whitespace" },
103
+ { include: "@literal" },
104
+ // Inline casts: 1.3::INTEGER
105
+ [/::\w+\b/, "type"],
106
+ // strings
107
+ [/"""/, "string.triple", "@string_triple"],
108
+ [/"([^"\\]|\\.)*$/, "string.invalid"], // non-terminated string
109
+ [/'([^'\\]|\\.)*$/, "string.invalid"], // non-terminated string
110
+ [/"/, "string", "@string"],
111
+ // Escaped column parts: nested.`escaped`.column
112
+ [/`/, "string", "@column_escape_part"],
113
+ ],
114
+ literal: [
115
+ { include: "@number" },
116
+ // Params
117
+ [
118
+ /\?{1,9}(([a-zA-Z_][a-zA-Z_0-9]+)|[0-9]+)?/,
119
+ {
120
+ cases: {
121
+ "\\?{1,9}": "variable.name.unnamed",
122
+ "\\?{1,9}([a-zA-Z_][a-zA-Z_0-9]+)?": "variable.name.named",
123
+ "\\?{1,9}([0-9]+)?": "variable.name.positional",
124
+ },
329
125
  },
330
- },
126
+ ],
331
127
  ],
332
- ],
333
- number: [
334
- [/(@digits)[eE]([\-+]?(@digits))?/, "number.float"],
335
- [/(@digits)\.(@digits)([eE][\-+]?(@digits))?/, "number.float"],
336
- [/(@digits)/, "number"],
337
- ],
338
- // Single double-quote strings: "str"
339
- string: [
340
- [/[^\\"]+/, "string"],
341
- [/@escapes/, "string.escape"],
342
- [/\\./, "string.escape.invalid"],
343
- [/"/, "string", "@pop"],
344
- ],
345
- // Triple double-quoted strings: """str"""
346
- string_triple: [
347
- [/"""/, "string.triple", "@pop"],
348
- [/[^"]+/, "string.triple"],
349
- ],
350
- // Backtick quoted "strings". ES|QL does not have back-tick "strings"
351
- // *per se*, but column parts can have backtick-escaped parts.
352
- column_escape_part: [
353
- [/[^`]+/, "string"],
354
- [/@escapes/, "string.escape"],
355
- [/\\./, "string.escape.invalid"],
356
- [/`/, "string", "@pop"],
357
- ],
358
- },
128
+ number: [
129
+ [/(@digits)[eE]([\-+]?(@digits))?/, "number.float"],
130
+ [/(@digits)\.(@digits)([eE][\-+]?(@digits))?/, "number.float"],
131
+ [/(@digits)/, "number"],
132
+ ],
133
+ // Single double-quote strings: "str"
134
+ string: [
135
+ [/[^\\"]+/, "string"],
136
+ [/@escapes/, "string.escape"],
137
+ [/\\./, "string.escape.invalid"],
138
+ [/"/, "string", "@pop"],
139
+ ],
140
+ // Triple double-quoted strings: """str"""
141
+ string_triple: [
142
+ [/"""/, "string.triple", "@pop"],
143
+ [/[^"]+/, "string.triple"],
144
+ ],
145
+ // Backtick quoted "strings". ES|QL does not have back-tick "strings"
146
+ // *per se*, but column parts can have backtick-escaped parts.
147
+ column_escape_part: [
148
+ [/[^`]+/, "string"],
149
+ [/@escapes/, "string.escape"],
150
+ [/\\./, "string.escape.invalid"],
151
+ [/`/, "string", "@pop"],
152
+ ],
153
+ },
154
+ };
359
155
  };
156
+ exports.create = create;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elastic/monaco-esql",
3
- "version": "1.0.2",
3
+ "version": "2.0.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"