@kusto/monaco-kusto 11.4.0 → 12.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.
- package/README.md +19 -1
- package/package.json +3 -1
- package/release/dev/globals-0aacfe72.js +46 -0
- package/release/dev/kustoMode.js +214 -497
- package/release/dev/kustoWorker.js +49 -90
- package/release/dev/{main-1587ba64.js → main-b690e47e.js} +2 -2
- package/release/dev/monaco.contribution.js +235 -201
- package/release/dev/{schema-a5230652.js → schema-957f5e9b.js} +13 -2
- package/release/esm/extendedGlobalApi/getRangeHtml.d.ts +2 -0
- package/release/esm/extendedGlobalApi/getRangeHtml.js +11 -0
- package/release/esm/extendedGlobalApi/index.d.ts +1 -0
- package/release/esm/extendedGlobalApi/index.js +1 -0
- package/release/esm/globals-88d92b64.js +40 -0
- package/release/esm/globals.d.ts +1 -0
- package/release/esm/globals.js +1 -0
- package/release/esm/kusto.worker.js +39 -91
- package/release/esm/kustoMode.js +39 -29
- package/release/esm/kustoWorker.d.ts +2 -5
- package/release/esm/kustoWorker.js +2 -5
- package/release/esm/languageFeatures.d.ts +0 -13
- package/release/esm/languageFeatures.js +0 -299
- package/release/esm/languageServiceManager/kustoLanguageService.d.ts +2 -4
- package/release/esm/languageServiceManager/kustoLanguageService.js +58 -71
- package/release/esm/languageServiceManager/settings.d.ts +0 -2
- package/release/esm/monaco.contribution.d.ts +1 -6
- package/release/esm/monaco.contribution.js +22 -79
- package/release/esm/{schema-c006895b.js → schema-66580db4.js} +12 -2
- package/release/esm/syntaxHighlighting/SemanticTokensProvider.d.ts +18 -0
- package/release/esm/syntaxHighlighting/SemanticTokensProvider.js +78 -0
- package/release/esm/syntaxHighlighting/kustoMonarchLanguageDefinition.d.ts +2 -0
- package/release/esm/syntaxHighlighting/kustoMonarchLanguageDefinition.js +401 -0
- package/release/esm/syntaxHighlighting/themes.d.ts +11 -0
- package/release/esm/syntaxHighlighting/themes.js +103 -0
- package/release/esm/syntaxHighlighting/types.d.ts +41 -0
- package/release/esm/syntaxHighlighting/types.js +55 -0
- package/release/min/globals-cce7b304.js +7 -0
- package/release/min/kustoMode.js +2 -2
- package/release/min/kustoWorker.js +4 -4
- package/release/min/{main-75aa3e71.js → main-13659fc4.js} +2 -2
- package/release/min/monaco.contribution.js +2 -2
- package/release/min/schema-ab3cbb28.js +7 -0
- package/release/esm/languageServiceManager/kustoMonarchLanguageDefinition.d.ts +0 -2
- package/release/esm/languageServiceManager/kustoMonarchLanguageDefinition.js +0 -211
- package/release/min/schema-192b3175.js +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version:
|
|
3
|
+
* monaco-kusto version: 12.0.0(2f1838c12bdb98562467acf51b6fd3e396182e86)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
@@ -81,4 +81,14 @@ const getInputParameterAsCslString = inputParameter => {
|
|
|
81
81
|
*/
|
|
82
82
|
let showSchema;
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
const schema = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
85
|
+
__proto__: null,
|
|
86
|
+
getCallName,
|
|
87
|
+
getCslTypeNameFromClrType,
|
|
88
|
+
getEntityDataTypeFromCslType,
|
|
89
|
+
getExpression,
|
|
90
|
+
getInputParametersAsCslString,
|
|
91
|
+
showSchema
|
|
92
|
+
}, Symbol.toStringTag, { value: 'Module' }));
|
|
93
|
+
|
|
94
|
+
export { getEntityDataTypeFromCslType as a, getCallName as b, getExpression as c, getInputParametersAsCslString as d, showSchema as e, getCslTypeNameFromClrType as g, schema as s };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as monaco from 'monaco-editor';
|
|
2
|
+
import { editor } from 'monaco-editor';
|
|
3
|
+
import { ClassificationRange } from './types';
|
|
4
|
+
type ClassificationsGetter = (resource: monaco.Uri) => Promise<ClassificationRange[]>;
|
|
5
|
+
export declare class SemanticTokensProvider implements monaco.languages.DocumentSemanticTokensProvider {
|
|
6
|
+
private readonly classificationsGetter;
|
|
7
|
+
constructor(classificationsGetter: ClassificationsGetter);
|
|
8
|
+
getLegend(): {
|
|
9
|
+
tokenTypes: import("./types").Token[];
|
|
10
|
+
tokenModifiers: any[];
|
|
11
|
+
};
|
|
12
|
+
provideDocumentSemanticTokens(model: editor.ITextModel): Promise<{
|
|
13
|
+
data: Uint32Array;
|
|
14
|
+
resultId: string;
|
|
15
|
+
}>;
|
|
16
|
+
releaseDocumentSemanticTokens(): void;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { tokenTypes } from './types';
|
|
38
|
+
var SemanticTokensProvider = /** @class */ (function () {
|
|
39
|
+
function SemanticTokensProvider(classificationsGetter) {
|
|
40
|
+
this.classificationsGetter = classificationsGetter;
|
|
41
|
+
}
|
|
42
|
+
SemanticTokensProvider.prototype.getLegend = function () {
|
|
43
|
+
return { tokenTypes: tokenTypes, tokenModifiers: [] };
|
|
44
|
+
};
|
|
45
|
+
SemanticTokensProvider.prototype.provideDocumentSemanticTokens = function (model) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
47
|
+
var resource, classifications, semanticTokens;
|
|
48
|
+
return __generator(this, function (_a) {
|
|
49
|
+
switch (_a.label) {
|
|
50
|
+
case 0:
|
|
51
|
+
resource = model.uri;
|
|
52
|
+
return [4 /*yield*/, this.classificationsGetter(resource)];
|
|
53
|
+
case 1:
|
|
54
|
+
classifications = _a.sent();
|
|
55
|
+
semanticTokens = classifications.map(function (classification, index) {
|
|
56
|
+
var previousClassification = classifications[index - 1];
|
|
57
|
+
return semanticTokenMaker(classification, previousClassification);
|
|
58
|
+
});
|
|
59
|
+
return [2 /*return*/, {
|
|
60
|
+
data: new Uint32Array(semanticTokens.flat()),
|
|
61
|
+
resultId: model.getVersionId().toString(),
|
|
62
|
+
}];
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
SemanticTokensProvider.prototype.releaseDocumentSemanticTokens = function () { };
|
|
68
|
+
return SemanticTokensProvider;
|
|
69
|
+
}());
|
|
70
|
+
export { SemanticTokensProvider };
|
|
71
|
+
var emptyClassification = { line: 0, character: 0, length: 0, kind: 0 };
|
|
72
|
+
function semanticTokenMaker(classification, previousClassification) {
|
|
73
|
+
if (previousClassification === void 0) { previousClassification = emptyClassification; }
|
|
74
|
+
var line = classification.line, character = classification.character, length = classification.length, kind = classification.kind;
|
|
75
|
+
var deltaLine = line - previousClassification.line;
|
|
76
|
+
var deltaStart = deltaLine ? character : character - previousClassification.character;
|
|
77
|
+
return [deltaLine, deltaStart, length, kind, 0];
|
|
78
|
+
}
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
import { LANGUAGE_ID } from '../globals';
|
|
2
|
+
import { Token } from './types';
|
|
3
|
+
var queryOperators = [
|
|
4
|
+
'as',
|
|
5
|
+
'consume',
|
|
6
|
+
'distinct',
|
|
7
|
+
'evaluate',
|
|
8
|
+
'extend',
|
|
9
|
+
'getschema',
|
|
10
|
+
'graph-match',
|
|
11
|
+
'graph-merge',
|
|
12
|
+
'graph-to-table',
|
|
13
|
+
'invoke',
|
|
14
|
+
'join',
|
|
15
|
+
'limit',
|
|
16
|
+
'lookup',
|
|
17
|
+
'make-graph',
|
|
18
|
+
'make-series',
|
|
19
|
+
'mv-apply',
|
|
20
|
+
'mv-expand',
|
|
21
|
+
'order',
|
|
22
|
+
'parse',
|
|
23
|
+
'parse-kv',
|
|
24
|
+
'parse-where',
|
|
25
|
+
'project',
|
|
26
|
+
'project-away',
|
|
27
|
+
'project-keep',
|
|
28
|
+
'project-rename',
|
|
29
|
+
'project-reorder',
|
|
30
|
+
'range',
|
|
31
|
+
'reduce',
|
|
32
|
+
'render',
|
|
33
|
+
'sample',
|
|
34
|
+
'sample-distinct',
|
|
35
|
+
'scan',
|
|
36
|
+
'serialize',
|
|
37
|
+
'sort',
|
|
38
|
+
'summarize',
|
|
39
|
+
'take',
|
|
40
|
+
'top',
|
|
41
|
+
'top-hitters',
|
|
42
|
+
'top-nested',
|
|
43
|
+
'union',
|
|
44
|
+
'where',
|
|
45
|
+
'filter',
|
|
46
|
+
'fork',
|
|
47
|
+
'facet',
|
|
48
|
+
'range',
|
|
49
|
+
'consume',
|
|
50
|
+
'find',
|
|
51
|
+
'search',
|
|
52
|
+
'print',
|
|
53
|
+
'partition',
|
|
54
|
+
'lookup',
|
|
55
|
+
];
|
|
56
|
+
var queryParameters = ['kind'];
|
|
57
|
+
var types = ['bool', 'datetime', 'decimal', 'double', 'dynamic', 'guid', 'int', 'long', 'real', 'string', 'timespan'];
|
|
58
|
+
var commands = [
|
|
59
|
+
'.add',
|
|
60
|
+
'.alter',
|
|
61
|
+
'.alter-merge',
|
|
62
|
+
'.append',
|
|
63
|
+
'.as',
|
|
64
|
+
'.assert',
|
|
65
|
+
'.attach',
|
|
66
|
+
'.consume',
|
|
67
|
+
'.count',
|
|
68
|
+
'.create',
|
|
69
|
+
'.create-merge',
|
|
70
|
+
'.create-or-alter',
|
|
71
|
+
'.create-set',
|
|
72
|
+
'.datatable',
|
|
73
|
+
'.default',
|
|
74
|
+
'.define',
|
|
75
|
+
'.delete',
|
|
76
|
+
'.detach',
|
|
77
|
+
'.distinct',
|
|
78
|
+
'.drop',
|
|
79
|
+
'.drop-pretend',
|
|
80
|
+
'.dup-next-failed-ingest',
|
|
81
|
+
'.dup-next-ingest',
|
|
82
|
+
'.evaluate',
|
|
83
|
+
'.export',
|
|
84
|
+
'.extend',
|
|
85
|
+
'.externaldata',
|
|
86
|
+
'.filter',
|
|
87
|
+
'.find',
|
|
88
|
+
'.fork',
|
|
89
|
+
'.getschema',
|
|
90
|
+
'.ingest',
|
|
91
|
+
'.join',
|
|
92
|
+
'.limit',
|
|
93
|
+
'.load',
|
|
94
|
+
'.make-series',
|
|
95
|
+
'.materialize',
|
|
96
|
+
'.move',
|
|
97
|
+
'.mv-expand',
|
|
98
|
+
'.order',
|
|
99
|
+
'.parse',
|
|
100
|
+
'.parse-where',
|
|
101
|
+
'.partition',
|
|
102
|
+
'.pivot',
|
|
103
|
+
'.print',
|
|
104
|
+
'.project',
|
|
105
|
+
'.project-away',
|
|
106
|
+
'.project-keep',
|
|
107
|
+
'.project-rename',
|
|
108
|
+
'.reduce',
|
|
109
|
+
'.remove',
|
|
110
|
+
'.rename',
|
|
111
|
+
'.replace',
|
|
112
|
+
'.restrict',
|
|
113
|
+
'.run',
|
|
114
|
+
'.sample',
|
|
115
|
+
'.sample-distinct',
|
|
116
|
+
'.save',
|
|
117
|
+
'.search',
|
|
118
|
+
'.serialize',
|
|
119
|
+
'.set',
|
|
120
|
+
'.set-or-append',
|
|
121
|
+
'.set-or-replace',
|
|
122
|
+
'.show',
|
|
123
|
+
'.sort',
|
|
124
|
+
'.summarize',
|
|
125
|
+
'.take',
|
|
126
|
+
'.top',
|
|
127
|
+
'.top-hitters',
|
|
128
|
+
'.top-nested',
|
|
129
|
+
'.union',
|
|
130
|
+
];
|
|
131
|
+
var functions = [
|
|
132
|
+
'abs',
|
|
133
|
+
'acos',
|
|
134
|
+
'ago',
|
|
135
|
+
'array_concat',
|
|
136
|
+
'array_length',
|
|
137
|
+
'array_slice',
|
|
138
|
+
'array_split',
|
|
139
|
+
'asin',
|
|
140
|
+
'atan',
|
|
141
|
+
'atan2',
|
|
142
|
+
'avg',
|
|
143
|
+
'bag_keys',
|
|
144
|
+
'base64_decodestring',
|
|
145
|
+
'base64_encodestring',
|
|
146
|
+
'bin',
|
|
147
|
+
'bin_at',
|
|
148
|
+
'binary_and',
|
|
149
|
+
'binary_not',
|
|
150
|
+
'binary_or',
|
|
151
|
+
'binary_shift_left',
|
|
152
|
+
'binary_shift_right',
|
|
153
|
+
'binary_xor',
|
|
154
|
+
'case',
|
|
155
|
+
'ceiling',
|
|
156
|
+
'coalesce',
|
|
157
|
+
'columnifexists',
|
|
158
|
+
'cos',
|
|
159
|
+
'count',
|
|
160
|
+
'countof',
|
|
161
|
+
'cot',
|
|
162
|
+
'cursor_after',
|
|
163
|
+
'datatable',
|
|
164
|
+
'datepart',
|
|
165
|
+
'datetime_add',
|
|
166
|
+
'datetime_diff',
|
|
167
|
+
'datetime_part',
|
|
168
|
+
'dayofmonth',
|
|
169
|
+
'dayofweek',
|
|
170
|
+
'dayofyear',
|
|
171
|
+
'dcount',
|
|
172
|
+
'dcount_hll',
|
|
173
|
+
'degrees',
|
|
174
|
+
'endofday',
|
|
175
|
+
'endofmonth',
|
|
176
|
+
'endofweek',
|
|
177
|
+
'endofyear',
|
|
178
|
+
'exp',
|
|
179
|
+
'exp10',
|
|
180
|
+
'exp2',
|
|
181
|
+
'extract',
|
|
182
|
+
'extractall',
|
|
183
|
+
'extractjson',
|
|
184
|
+
'format_datetime',
|
|
185
|
+
'format_timespan',
|
|
186
|
+
'floor',
|
|
187
|
+
'gamma',
|
|
188
|
+
'geo_distance_2points',
|
|
189
|
+
'geo_geohash_to_central_point',
|
|
190
|
+
'geo_point_in_circle',
|
|
191
|
+
'geo_point_in_polygon',
|
|
192
|
+
'geo_point_to_geohash',
|
|
193
|
+
'getmonth',
|
|
194
|
+
'gettype',
|
|
195
|
+
'getyear',
|
|
196
|
+
'hash',
|
|
197
|
+
'hash_sha256',
|
|
198
|
+
'hll_merge',
|
|
199
|
+
'iif',
|
|
200
|
+
'indexof',
|
|
201
|
+
'isempty',
|
|
202
|
+
'isfinite',
|
|
203
|
+
'isinf',
|
|
204
|
+
'isascii',
|
|
205
|
+
'isnan',
|
|
206
|
+
'isnotempty',
|
|
207
|
+
'isnotnull',
|
|
208
|
+
'isnull',
|
|
209
|
+
'isutf8',
|
|
210
|
+
'log',
|
|
211
|
+
'log10',
|
|
212
|
+
'log2',
|
|
213
|
+
'loggamma',
|
|
214
|
+
'make_datetime',
|
|
215
|
+
'make_string',
|
|
216
|
+
'make_timespan',
|
|
217
|
+
'materialize',
|
|
218
|
+
'max',
|
|
219
|
+
'max_of',
|
|
220
|
+
'min',
|
|
221
|
+
'min_of',
|
|
222
|
+
'monthofyear',
|
|
223
|
+
'next',
|
|
224
|
+
'not',
|
|
225
|
+
'pack',
|
|
226
|
+
'pack_array',
|
|
227
|
+
'pack_dictionary',
|
|
228
|
+
'parse_csv',
|
|
229
|
+
'parse_ipv4',
|
|
230
|
+
'parse_json',
|
|
231
|
+
'parse_path',
|
|
232
|
+
'parse_url',
|
|
233
|
+
'parse_urlquery',
|
|
234
|
+
'parse_user_agent',
|
|
235
|
+
'parse_version',
|
|
236
|
+
'parse_xml',
|
|
237
|
+
'parsejson',
|
|
238
|
+
'percentrank_tdigest',
|
|
239
|
+
'percentile_tdigest',
|
|
240
|
+
'pow',
|
|
241
|
+
'prev',
|
|
242
|
+
'radians',
|
|
243
|
+
'rand',
|
|
244
|
+
'rank_tdigest',
|
|
245
|
+
'repeat',
|
|
246
|
+
'replace',
|
|
247
|
+
'reverse',
|
|
248
|
+
'round',
|
|
249
|
+
'row_cumsum',
|
|
250
|
+
'row_window_session',
|
|
251
|
+
'series_add',
|
|
252
|
+
'series_decompose',
|
|
253
|
+
'series_decompose_anomalies',
|
|
254
|
+
'series_decompose_forecast',
|
|
255
|
+
'series_divide',
|
|
256
|
+
'series_equals',
|
|
257
|
+
'series_fill_backward',
|
|
258
|
+
'series_fill_const',
|
|
259
|
+
'series_fill_forward',
|
|
260
|
+
'series_fill_linear',
|
|
261
|
+
'series_fir',
|
|
262
|
+
'series_fit_2lines',
|
|
263
|
+
'series_fit_2lines_dynamic',
|
|
264
|
+
'series_fit_line',
|
|
265
|
+
'series_fit_line_dynamic',
|
|
266
|
+
'series_greater',
|
|
267
|
+
'series_greater_equals',
|
|
268
|
+
'series_iir',
|
|
269
|
+
'series_less',
|
|
270
|
+
'series_less_equals',
|
|
271
|
+
'series_multiply',
|
|
272
|
+
'series_not_equals',
|
|
273
|
+
'series_outliers',
|
|
274
|
+
'series_pearson_correlation',
|
|
275
|
+
'series_periods_detect',
|
|
276
|
+
'series_periods_validate',
|
|
277
|
+
'series_seasonal',
|
|
278
|
+
'series_stats',
|
|
279
|
+
'series_stats_dynamic',
|
|
280
|
+
'series_subtract',
|
|
281
|
+
'sign',
|
|
282
|
+
'sin',
|
|
283
|
+
'split',
|
|
284
|
+
'sqrt',
|
|
285
|
+
'startofday',
|
|
286
|
+
'startofmonth',
|
|
287
|
+
'startofweek',
|
|
288
|
+
'startofyear',
|
|
289
|
+
'strcat',
|
|
290
|
+
'strcat_array',
|
|
291
|
+
'strcat_delim',
|
|
292
|
+
'strcmp',
|
|
293
|
+
'strlen',
|
|
294
|
+
'strrep',
|
|
295
|
+
'string_size',
|
|
296
|
+
'substring',
|
|
297
|
+
'sum',
|
|
298
|
+
'tan',
|
|
299
|
+
'tdigest_merge',
|
|
300
|
+
'tobool',
|
|
301
|
+
'toboolean',
|
|
302
|
+
'todecimal',
|
|
303
|
+
'todouble',
|
|
304
|
+
'todynamic',
|
|
305
|
+
'tofloat',
|
|
306
|
+
'toguid',
|
|
307
|
+
'tohex',
|
|
308
|
+
'toint',
|
|
309
|
+
'tolong',
|
|
310
|
+
'tolower',
|
|
311
|
+
'toobject',
|
|
312
|
+
'toreal',
|
|
313
|
+
'toscalar',
|
|
314
|
+
'tostring',
|
|
315
|
+
'totimespan',
|
|
316
|
+
'toupper',
|
|
317
|
+
'translate',
|
|
318
|
+
'trim',
|
|
319
|
+
'trim_end',
|
|
320
|
+
'trim_start',
|
|
321
|
+
'typeof',
|
|
322
|
+
'url_decode',
|
|
323
|
+
'url_encode',
|
|
324
|
+
'week_of_year',
|
|
325
|
+
'welch_test',
|
|
326
|
+
];
|
|
327
|
+
var keywords = [
|
|
328
|
+
'and',
|
|
329
|
+
'as',
|
|
330
|
+
'asc',
|
|
331
|
+
'between',
|
|
332
|
+
'by',
|
|
333
|
+
'contains',
|
|
334
|
+
'count',
|
|
335
|
+
'desc',
|
|
336
|
+
'extend',
|
|
337
|
+
'false',
|
|
338
|
+
'filter',
|
|
339
|
+
'find',
|
|
340
|
+
'from',
|
|
341
|
+
'has',
|
|
342
|
+
'in',
|
|
343
|
+
'inner',
|
|
344
|
+
'join',
|
|
345
|
+
'leftouter',
|
|
346
|
+
'let',
|
|
347
|
+
'not',
|
|
348
|
+
'on',
|
|
349
|
+
'or',
|
|
350
|
+
'policy',
|
|
351
|
+
'project',
|
|
352
|
+
'project-away',
|
|
353
|
+
'project-rename',
|
|
354
|
+
'project-reorder',
|
|
355
|
+
'project-keep',
|
|
356
|
+
'range',
|
|
357
|
+
'rename',
|
|
358
|
+
'retention',
|
|
359
|
+
'summarize',
|
|
360
|
+
'table',
|
|
361
|
+
'take',
|
|
362
|
+
'to',
|
|
363
|
+
'true',
|
|
364
|
+
'where',
|
|
365
|
+
'with',
|
|
366
|
+
];
|
|
367
|
+
export var kustoLanguageDefinition = {
|
|
368
|
+
name: LANGUAGE_ID,
|
|
369
|
+
mimeTypes: ['text/kusto'],
|
|
370
|
+
displayName: 'Kusto',
|
|
371
|
+
defaultToken: 'invalid',
|
|
372
|
+
queryOperators: queryOperators,
|
|
373
|
+
queryParameters: queryParameters,
|
|
374
|
+
types: types,
|
|
375
|
+
commands: commands,
|
|
376
|
+
functions: functions,
|
|
377
|
+
keywords: keywords,
|
|
378
|
+
tokenizer: {
|
|
379
|
+
root: [
|
|
380
|
+
[/(\/\/.*$)/, Token.Comment],
|
|
381
|
+
[/[\(\)\{\}\|\[\]\:\=\,\<|\.\..]/, Token.Punctuation],
|
|
382
|
+
[/[\+\-\*\/\%\!\<\<=\>\>=\=\==\!=\<>\:\;\,\=~\@\?\=>\!~]/, Token.MathOperator],
|
|
383
|
+
[/"([^"\\]*(\\.[^"\\]*)*)"/, Token.StringLiteral],
|
|
384
|
+
[/'([^"\\]*(\\.[^"\\]*)*)'/, Token.StringLiteral],
|
|
385
|
+
[
|
|
386
|
+
/[\w@#\-$\.]+/,
|
|
387
|
+
{
|
|
388
|
+
cases: {
|
|
389
|
+
'@queryOperators': Token.QueryOperator,
|
|
390
|
+
'@queryParameters': Token.QueryParameter,
|
|
391
|
+
'@types': Token.Type,
|
|
392
|
+
'@commands': Token.Command,
|
|
393
|
+
'@functions': Token.Function,
|
|
394
|
+
'@keywords': Token.Keyword,
|
|
395
|
+
'@default': 'identifier',
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
],
|
|
399
|
+
],
|
|
400
|
+
},
|
|
401
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
|
+
export declare enum ThemeName {
|
|
3
|
+
light = "kusto-light",
|
|
4
|
+
dark = "kusto-dark"
|
|
5
|
+
}
|
|
6
|
+
interface Theme {
|
|
7
|
+
name: ThemeName;
|
|
8
|
+
data: monaco.editor.IStandaloneThemeData;
|
|
9
|
+
}
|
|
10
|
+
export declare const themes: Theme[];
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Token } from './types';
|
|
2
|
+
export var ThemeName;
|
|
3
|
+
(function (ThemeName) {
|
|
4
|
+
ThemeName["light"] = "kusto-light";
|
|
5
|
+
ThemeName["dark"] = "kusto-dark";
|
|
6
|
+
})(ThemeName || (ThemeName = {}));
|
|
7
|
+
var colors = {
|
|
8
|
+
white: '#DCDCDC',
|
|
9
|
+
lightGoldenrodYellow: '#FAFAD2',
|
|
10
|
+
softGold: '#D7BA7D',
|
|
11
|
+
paleChestnut: '#D69D85',
|
|
12
|
+
paleVioletRed: '#DB7093',
|
|
13
|
+
firebrick: '#B22222',
|
|
14
|
+
orangeRed: '#FF4500',
|
|
15
|
+
mediumVioletRed: '#C71585',
|
|
16
|
+
magenta: '#FF00FF', // for debugging
|
|
17
|
+
darkOrchid: '#9932CC',
|
|
18
|
+
darkViolet: '#9400D3',
|
|
19
|
+
midnightBlue: '#191970',
|
|
20
|
+
blue: '#0000FF',
|
|
21
|
+
blueSapphire: '#004E8C',
|
|
22
|
+
tealBlue: '#2B91AF',
|
|
23
|
+
skyBlue: '#569CD6',
|
|
24
|
+
lightSkyBlue: '#92CAF4',
|
|
25
|
+
mediumTurquoise: '#4EC9B0',
|
|
26
|
+
oliveDrab: '#608B4E',
|
|
27
|
+
green: '#008000',
|
|
28
|
+
jetBlack: '#1B1A19',
|
|
29
|
+
black: '#000000',
|
|
30
|
+
};
|
|
31
|
+
var light = {
|
|
32
|
+
base: 'vs',
|
|
33
|
+
inherit: true,
|
|
34
|
+
rules: [
|
|
35
|
+
{ token: '', foreground: colors.black },
|
|
36
|
+
{ token: Token.PlainText, foreground: colors.black },
|
|
37
|
+
{ token: Token.Comment, foreground: colors.green },
|
|
38
|
+
{ token: Token.Punctuation, foreground: colors.black },
|
|
39
|
+
{ token: Token.Directive, foreground: colors.darkViolet },
|
|
40
|
+
{ token: Token.Literal, foreground: colors.black },
|
|
41
|
+
{ token: Token.StringLiteral, foreground: colors.firebrick },
|
|
42
|
+
{ token: Token.Type, foreground: colors.blue },
|
|
43
|
+
{ token: Token.Column, foreground: colors.mediumVioletRed },
|
|
44
|
+
{ token: Token.Table, foreground: colors.darkOrchid },
|
|
45
|
+
{ token: Token.Database, foreground: colors.darkOrchid },
|
|
46
|
+
{ token: Token.Function, foreground: colors.blue },
|
|
47
|
+
{ token: Token.Parameter, foreground: colors.midnightBlue },
|
|
48
|
+
{ token: Token.Variable, foreground: colors.midnightBlue },
|
|
49
|
+
{ token: Token.Identifier, foreground: colors.black },
|
|
50
|
+
{ token: Token.ClientParameter, foreground: colors.tealBlue },
|
|
51
|
+
{ token: Token.QueryParameter, foreground: colors.tealBlue },
|
|
52
|
+
{ token: Token.ScalarParameter, foreground: colors.blue },
|
|
53
|
+
{ token: Token.MathOperator, foreground: colors.black },
|
|
54
|
+
{ token: Token.QueryOperator, foreground: colors.orangeRed },
|
|
55
|
+
{ token: Token.Command, foreground: colors.blue },
|
|
56
|
+
{ token: Token.Keyword, foreground: colors.blue },
|
|
57
|
+
{ token: Token.MaterializedView, foreground: colors.darkOrchid },
|
|
58
|
+
{ token: Token.SchemaMember, foreground: colors.black },
|
|
59
|
+
{ token: Token.SignatureParameter, foreground: colors.black },
|
|
60
|
+
{ token: Token.Option, foreground: colors.black },
|
|
61
|
+
],
|
|
62
|
+
colors: {},
|
|
63
|
+
};
|
|
64
|
+
var dark = {
|
|
65
|
+
base: 'vs-dark',
|
|
66
|
+
inherit: true,
|
|
67
|
+
rules: [
|
|
68
|
+
{ token: '', foreground: colors.white },
|
|
69
|
+
{ token: Token.PlainText, foreground: colors.white },
|
|
70
|
+
{ token: Token.Comment, foreground: colors.oliveDrab },
|
|
71
|
+
{ token: Token.Punctuation, foreground: colors.white },
|
|
72
|
+
{ token: Token.Directive, foreground: colors.lightGoldenrodYellow },
|
|
73
|
+
{ token: Token.Literal, foreground: colors.white },
|
|
74
|
+
{ token: Token.StringLiteral, foreground: colors.paleChestnut },
|
|
75
|
+
{ token: Token.Type, foreground: colors.skyBlue },
|
|
76
|
+
{ token: Token.Column, foreground: colors.paleVioletRed },
|
|
77
|
+
{ token: Token.Table, foreground: colors.softGold },
|
|
78
|
+
{ token: Token.Database, foreground: colors.softGold },
|
|
79
|
+
{ token: Token.Function, foreground: colors.skyBlue },
|
|
80
|
+
{ token: Token.Parameter, foreground: colors.lightSkyBlue },
|
|
81
|
+
{ token: Token.Variable, foreground: colors.lightSkyBlue },
|
|
82
|
+
{ token: Token.Identifier, foreground: colors.white },
|
|
83
|
+
{ token: Token.ClientParameter, foreground: colors.tealBlue },
|
|
84
|
+
{ token: Token.QueryParameter, foreground: colors.tealBlue },
|
|
85
|
+
{ token: Token.ScalarParameter, foreground: colors.skyBlue },
|
|
86
|
+
{ token: Token.MathOperator, foreground: colors.white },
|
|
87
|
+
{ token: Token.QueryOperator, foreground: colors.mediumTurquoise },
|
|
88
|
+
{ token: Token.Command, foreground: colors.skyBlue },
|
|
89
|
+
{ token: Token.Keyword, foreground: colors.skyBlue },
|
|
90
|
+
{ token: Token.MaterializedView, foreground: colors.softGold },
|
|
91
|
+
{ token: Token.SchemaMember, foreground: colors.black },
|
|
92
|
+
{ token: Token.SignatureParameter, foreground: colors.black },
|
|
93
|
+
{ token: Token.Option, foreground: colors.black },
|
|
94
|
+
],
|
|
95
|
+
colors: {
|
|
96
|
+
'editor.background': colors.jetBlack,
|
|
97
|
+
'editorSuggestWidget.selectedBackground': colors.blueSapphire,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
export var themes = [
|
|
101
|
+
{ name: ThemeName.light, data: light },
|
|
102
|
+
{ name: ThemeName.dark, data: dark },
|
|
103
|
+
];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/// <reference types="@kusto/language-service-next/Kusto.Language.Bridge" />
|
|
2
|
+
export type ClassificationKind = Kusto.Language.Editor.ClassificationKind;
|
|
3
|
+
export declare enum Token {
|
|
4
|
+
PlainText = "plainText",
|
|
5
|
+
Comment = "comment",
|
|
6
|
+
Punctuation = "punctuation",
|
|
7
|
+
Directive = "directive",
|
|
8
|
+
Literal = "literal",
|
|
9
|
+
StringLiteral = "stringLiteral",
|
|
10
|
+
Type = "type",
|
|
11
|
+
Column = "column",
|
|
12
|
+
Table = "table",
|
|
13
|
+
Database = "database",
|
|
14
|
+
Function = "function",
|
|
15
|
+
Parameter = "parameter",
|
|
16
|
+
Variable = "variable",
|
|
17
|
+
Identifier = "identifier",
|
|
18
|
+
ClientParameter = "clientParameter",
|
|
19
|
+
QueryParameter = "queryParameter",
|
|
20
|
+
ScalarParameter = "scalarParameter",
|
|
21
|
+
MathOperator = "mathOperator",
|
|
22
|
+
QueryOperator = "queryOperator",
|
|
23
|
+
Command = "command",
|
|
24
|
+
Keyword = "keyword",
|
|
25
|
+
MaterializedView = "materializedView",
|
|
26
|
+
SchemaMember = "schemaMember",
|
|
27
|
+
SignatureParameter = "signatureParameter",
|
|
28
|
+
Option = "option"
|
|
29
|
+
}
|
|
30
|
+
export declare const tokenTypes: Token[];
|
|
31
|
+
export interface ClassificationRange {
|
|
32
|
+
line: number;
|
|
33
|
+
character: number;
|
|
34
|
+
length: number;
|
|
35
|
+
kind: ClassificationKind;
|
|
36
|
+
}
|
|
37
|
+
type DeltaLine = number;
|
|
38
|
+
type DeltaStart = number;
|
|
39
|
+
type Length = number;
|
|
40
|
+
export type DocumentSemanticToken = [DeltaLine, DeltaStart, Length, Kusto.Language.Editor.ClassificationKind, 0];
|
|
41
|
+
export {};
|