@kusto/monaco-kusto 12.0.0 → 12.0.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.
- package/README.md +10 -0
- package/package.json +1 -1
- package/release/dev/kustoMode.js +131 -117
- package/release/dev/kustoWorker.js +2 -2
- package/release/dev/{main-b690e47e.js → main-de9bc066.js} +2 -2
- package/release/dev/monaco.contribution.js +53 -53
- package/release/dev/{schema-957f5e9b.js → schema-ea01b133.js} +2 -2
- package/release/dev/{globals-0aacfe72.js → types-8a990554.js} +4 -4
- package/release/esm/{globals-88d92b64.js → globals-0865238a.js} +1 -1
- package/release/esm/kusto.worker.js +2 -2
- package/release/esm/kustoMode.js +4 -27
- package/release/esm/{schema-66580db4.js → schema-a96574e6.js} +1 -1
- package/release/esm/syntaxHighlighting/semanticTokensProviderRegistrar.d.ts +6 -0
- package/release/esm/syntaxHighlighting/semanticTokensProviderRegistrar.js +71 -0
- package/release/min/kustoMode.js +2 -2
- package/release/min/kustoWorker.js +2 -2
- package/release/min/{main-13659fc4.js → main-b1d46c4f.js} +2 -2
- package/release/min/monaco.contribution.js +2 -2
- package/release/min/{schema-ab3cbb28.js → schema-0d256352.js} +2 -2
- package/release/min/types-0c686717.js +7 -0
- package/release/min/globals-cce7b304.js +0 -7
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 12.0.
|
|
3
|
+
* monaco-kusto version: 12.0.2(ba4a7496a706f790046400993d1050040ea93494)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
7
7
|
|
|
8
|
-
define('vs/language/kusto/kustoWorker', ['exports', './main-
|
|
8
|
+
define('vs/language/kusto/kustoWorker', ['exports', './main-de9bc066', './schema-ea01b133'], (function (exports, main, schema) { 'use strict';
|
|
9
9
|
|
|
10
10
|
function _slicedToArray$2(r, e) { return _arrayWithHoles$2(r) || _iterableToArrayLimit$2(r, e) || _unsupportedIterableToArray$3(r, e) || _nonIterableRest$2(); }
|
|
11
11
|
function _nonIterableRest$2() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 12.0.
|
|
3
|
+
* monaco-kusto version: 12.0.2(ba4a7496a706f790046400993d1050040ea93494)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
7
7
|
|
|
8
|
-
define('vs/language/kusto/main-
|
|
8
|
+
define('vs/language/kusto/main-de9bc066', ['exports'], (function (exports) { 'use strict';
|
|
9
9
|
|
|
10
10
|
/* --------------------------------------------------------------------------------------------
|
|
11
11
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 12.0.
|
|
3
|
+
* monaco-kusto version: 12.0.2(ba4a7496a706f790046400993d1050040ea93494)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
7
7
|
|
|
8
|
-
define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/editor/editor.main', './
|
|
8
|
+
define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/editor/editor.main', './types-8a990554', './schema-ea01b133'], (function (require, exports, monaco, types, schema) { 'use strict';
|
|
9
9
|
|
|
10
10
|
function _interopNamespaceDefault(e) {
|
|
11
11
|
var n = Object.create(null);
|
|
@@ -218,79 +218,79 @@ define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/edito
|
|
|
218
218
|
token: '',
|
|
219
219
|
foreground: colors.black
|
|
220
220
|
}, {
|
|
221
|
-
token:
|
|
221
|
+
token: types.Token.PlainText,
|
|
222
222
|
foreground: colors.black
|
|
223
223
|
}, {
|
|
224
|
-
token:
|
|
224
|
+
token: types.Token.Comment,
|
|
225
225
|
foreground: colors.green
|
|
226
226
|
}, {
|
|
227
|
-
token:
|
|
227
|
+
token: types.Token.Punctuation,
|
|
228
228
|
foreground: colors.black
|
|
229
229
|
}, {
|
|
230
|
-
token:
|
|
230
|
+
token: types.Token.Directive,
|
|
231
231
|
foreground: colors.darkViolet
|
|
232
232
|
}, {
|
|
233
|
-
token:
|
|
233
|
+
token: types.Token.Literal,
|
|
234
234
|
foreground: colors.black
|
|
235
235
|
}, {
|
|
236
|
-
token:
|
|
236
|
+
token: types.Token.StringLiteral,
|
|
237
237
|
foreground: colors.firebrick
|
|
238
238
|
}, {
|
|
239
|
-
token:
|
|
239
|
+
token: types.Token.Type,
|
|
240
240
|
foreground: colors.blue
|
|
241
241
|
}, {
|
|
242
|
-
token:
|
|
242
|
+
token: types.Token.Column,
|
|
243
243
|
foreground: colors.mediumVioletRed
|
|
244
244
|
}, {
|
|
245
|
-
token:
|
|
245
|
+
token: types.Token.Table,
|
|
246
246
|
foreground: colors.darkOrchid
|
|
247
247
|
}, {
|
|
248
|
-
token:
|
|
248
|
+
token: types.Token.Database,
|
|
249
249
|
foreground: colors.darkOrchid
|
|
250
250
|
}, {
|
|
251
|
-
token:
|
|
251
|
+
token: types.Token.Function,
|
|
252
252
|
foreground: colors.blue
|
|
253
253
|
}, {
|
|
254
|
-
token:
|
|
254
|
+
token: types.Token.Parameter,
|
|
255
255
|
foreground: colors.midnightBlue
|
|
256
256
|
}, {
|
|
257
|
-
token:
|
|
257
|
+
token: types.Token.Variable,
|
|
258
258
|
foreground: colors.midnightBlue
|
|
259
259
|
}, {
|
|
260
|
-
token:
|
|
260
|
+
token: types.Token.Identifier,
|
|
261
261
|
foreground: colors.black
|
|
262
262
|
}, {
|
|
263
|
-
token:
|
|
263
|
+
token: types.Token.ClientParameter,
|
|
264
264
|
foreground: colors.tealBlue
|
|
265
265
|
}, {
|
|
266
|
-
token:
|
|
266
|
+
token: types.Token.QueryParameter,
|
|
267
267
|
foreground: colors.tealBlue
|
|
268
268
|
}, {
|
|
269
|
-
token:
|
|
269
|
+
token: types.Token.ScalarParameter,
|
|
270
270
|
foreground: colors.blue
|
|
271
271
|
}, {
|
|
272
|
-
token:
|
|
272
|
+
token: types.Token.MathOperator,
|
|
273
273
|
foreground: colors.black
|
|
274
274
|
}, {
|
|
275
|
-
token:
|
|
275
|
+
token: types.Token.QueryOperator,
|
|
276
276
|
foreground: colors.orangeRed
|
|
277
277
|
}, {
|
|
278
|
-
token:
|
|
278
|
+
token: types.Token.Command,
|
|
279
279
|
foreground: colors.blue
|
|
280
280
|
}, {
|
|
281
|
-
token:
|
|
281
|
+
token: types.Token.Keyword,
|
|
282
282
|
foreground: colors.blue
|
|
283
283
|
}, {
|
|
284
|
-
token:
|
|
284
|
+
token: types.Token.MaterializedView,
|
|
285
285
|
foreground: colors.darkOrchid
|
|
286
286
|
}, {
|
|
287
|
-
token:
|
|
287
|
+
token: types.Token.SchemaMember,
|
|
288
288
|
foreground: colors.black
|
|
289
289
|
}, {
|
|
290
|
-
token:
|
|
290
|
+
token: types.Token.SignatureParameter,
|
|
291
291
|
foreground: colors.black
|
|
292
292
|
}, {
|
|
293
|
-
token:
|
|
293
|
+
token: types.Token.Option,
|
|
294
294
|
foreground: colors.black
|
|
295
295
|
}],
|
|
296
296
|
colors: {}
|
|
@@ -302,79 +302,79 @@ define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/edito
|
|
|
302
302
|
token: '',
|
|
303
303
|
foreground: colors.white
|
|
304
304
|
}, {
|
|
305
|
-
token:
|
|
305
|
+
token: types.Token.PlainText,
|
|
306
306
|
foreground: colors.white
|
|
307
307
|
}, {
|
|
308
|
-
token:
|
|
308
|
+
token: types.Token.Comment,
|
|
309
309
|
foreground: colors.oliveDrab
|
|
310
310
|
}, {
|
|
311
|
-
token:
|
|
311
|
+
token: types.Token.Punctuation,
|
|
312
312
|
foreground: colors.white
|
|
313
313
|
}, {
|
|
314
|
-
token:
|
|
314
|
+
token: types.Token.Directive,
|
|
315
315
|
foreground: colors.lightGoldenrodYellow
|
|
316
316
|
}, {
|
|
317
|
-
token:
|
|
317
|
+
token: types.Token.Literal,
|
|
318
318
|
foreground: colors.white
|
|
319
319
|
}, {
|
|
320
|
-
token:
|
|
320
|
+
token: types.Token.StringLiteral,
|
|
321
321
|
foreground: colors.paleChestnut
|
|
322
322
|
}, {
|
|
323
|
-
token:
|
|
323
|
+
token: types.Token.Type,
|
|
324
324
|
foreground: colors.skyBlue
|
|
325
325
|
}, {
|
|
326
|
-
token:
|
|
326
|
+
token: types.Token.Column,
|
|
327
327
|
foreground: colors.paleVioletRed
|
|
328
328
|
}, {
|
|
329
|
-
token:
|
|
329
|
+
token: types.Token.Table,
|
|
330
330
|
foreground: colors.softGold
|
|
331
331
|
}, {
|
|
332
|
-
token:
|
|
332
|
+
token: types.Token.Database,
|
|
333
333
|
foreground: colors.softGold
|
|
334
334
|
}, {
|
|
335
|
-
token:
|
|
335
|
+
token: types.Token.Function,
|
|
336
336
|
foreground: colors.skyBlue
|
|
337
337
|
}, {
|
|
338
|
-
token:
|
|
338
|
+
token: types.Token.Parameter,
|
|
339
339
|
foreground: colors.lightSkyBlue
|
|
340
340
|
}, {
|
|
341
|
-
token:
|
|
341
|
+
token: types.Token.Variable,
|
|
342
342
|
foreground: colors.lightSkyBlue
|
|
343
343
|
}, {
|
|
344
|
-
token:
|
|
344
|
+
token: types.Token.Identifier,
|
|
345
345
|
foreground: colors.white
|
|
346
346
|
}, {
|
|
347
|
-
token:
|
|
347
|
+
token: types.Token.ClientParameter,
|
|
348
348
|
foreground: colors.tealBlue
|
|
349
349
|
}, {
|
|
350
|
-
token:
|
|
350
|
+
token: types.Token.QueryParameter,
|
|
351
351
|
foreground: colors.tealBlue
|
|
352
352
|
}, {
|
|
353
|
-
token:
|
|
353
|
+
token: types.Token.ScalarParameter,
|
|
354
354
|
foreground: colors.skyBlue
|
|
355
355
|
}, {
|
|
356
|
-
token:
|
|
356
|
+
token: types.Token.MathOperator,
|
|
357
357
|
foreground: colors.white
|
|
358
358
|
}, {
|
|
359
|
-
token:
|
|
359
|
+
token: types.Token.QueryOperator,
|
|
360
360
|
foreground: colors.mediumTurquoise
|
|
361
361
|
}, {
|
|
362
|
-
token:
|
|
362
|
+
token: types.Token.Command,
|
|
363
363
|
foreground: colors.skyBlue
|
|
364
364
|
}, {
|
|
365
|
-
token:
|
|
365
|
+
token: types.Token.Keyword,
|
|
366
366
|
foreground: colors.skyBlue
|
|
367
367
|
}, {
|
|
368
|
-
token:
|
|
368
|
+
token: types.Token.MaterializedView,
|
|
369
369
|
foreground: colors.softGold
|
|
370
370
|
}, {
|
|
371
|
-
token:
|
|
371
|
+
token: types.Token.SchemaMember,
|
|
372
372
|
foreground: colors.black
|
|
373
373
|
}, {
|
|
374
|
-
token:
|
|
374
|
+
token: types.Token.SignatureParameter,
|
|
375
375
|
foreground: colors.black
|
|
376
376
|
}, {
|
|
377
|
-
token:
|
|
377
|
+
token: types.Token.Option,
|
|
378
378
|
foreground: colors.black
|
|
379
379
|
}],
|
|
380
380
|
colors: {
|
|
@@ -497,7 +497,7 @@ define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/edito
|
|
|
497
497
|
});
|
|
498
498
|
});
|
|
499
499
|
monaco__namespace.languages.register({
|
|
500
|
-
id:
|
|
500
|
+
id: types.LANGUAGE_ID,
|
|
501
501
|
extensions: ['.csl', '.kql']
|
|
502
502
|
});
|
|
503
503
|
themes.forEach(function (_ref) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 12.0.
|
|
3
|
+
* monaco-kusto version: 12.0.2(ba4a7496a706f790046400993d1050040ea93494)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
7
7
|
|
|
8
|
-
define('vs/language/kusto/schema-
|
|
8
|
+
define('vs/language/kusto/schema-ea01b133', ['exports'], (function (exports) { 'use strict';
|
|
9
9
|
|
|
10
10
|
// Definition of schema object in the context of language services. This model is exposed to consumers of this library.
|
|
11
11
|
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 12.0.
|
|
3
|
+
* monaco-kusto version: 12.0.2(ba4a7496a706f790046400993d1050040ea93494)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
7
7
|
|
|
8
|
-
define('vs/language/kusto/
|
|
8
|
+
define('vs/language/kusto/types-8a990554', ['exports'], (function (exports) { 'use strict';
|
|
9
|
+
|
|
10
|
+
var LANGUAGE_ID = 'kusto';
|
|
9
11
|
|
|
10
12
|
var Token = /*#__PURE__*/function (Token) {
|
|
11
13
|
Token["PlainText"] = "plainText";
|
|
@@ -37,8 +39,6 @@ define('vs/language/kusto/globals-0aacfe72', ['exports'], (function (exports) {
|
|
|
37
39
|
}({});
|
|
38
40
|
var tokenTypes = [Token.PlainText, Token.Comment, Token.Punctuation, Token.Directive, Token.Literal, Token.StringLiteral, Token.Type, Token.Column, Token.Table, Token.Database, Token.Function, Token.Parameter, Token.Variable, Token.Identifier, Token.ClientParameter, Token.QueryParameter, Token.ScalarParameter, Token.MathOperator, Token.QueryOperator, Token.Command, Token.Keyword, Token.MaterializedView, Token.SchemaMember, Token.SignatureParameter, Token.Option];
|
|
39
41
|
|
|
40
|
-
var LANGUAGE_ID = 'kusto';
|
|
41
|
-
|
|
42
42
|
exports.LANGUAGE_ID = LANGUAGE_ID;
|
|
43
43
|
exports.Token = Token;
|
|
44
44
|
exports.tokenTypes = tokenTypes;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 12.0.
|
|
3
|
+
* monaco-kusto version: 12.0.2(ba4a7496a706f790046400993d1050040ea93494)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 12.0.
|
|
3
|
+
* monaco-kusto version: 12.0.2(ba4a7496a706f790046400993d1050040ea93494)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import * as worker from 'monaco-editor/esm/vs/editor/editor.worker';
|
|
9
9
|
import * as ls from 'vscode-languageserver-types';
|
|
10
10
|
import XRegExp from 'xregexp';
|
|
11
|
-
import { a as getEntityDataTypeFromCslType, b as getCallName, c as getExpression, g as getCslTypeNameFromClrType } from './schema-
|
|
11
|
+
import { a as getEntityDataTypeFromCslType, b as getCallName, c as getExpression, g as getCslTypeNameFromClrType } from './schema-a96574e6.js';
|
|
12
12
|
import '@kusto/language-service/bridge.min';
|
|
13
13
|
import '@kusto/language-service/Kusto.JavaScript.Client.min';
|
|
14
14
|
import '@kusto/language-service/newtonsoft.json.min';
|
package/release/esm/kustoMode.js
CHANGED
|
@@ -48,9 +48,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
48
|
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
49
49
|
import { WorkerManager } from './workerManager';
|
|
50
50
|
import * as languageFeatures from './languageFeatures';
|
|
51
|
-
import { SemanticTokensProvider } from './syntaxHighlighting/SemanticTokensProvider';
|
|
52
51
|
import { kustoLanguageDefinition } from './syntaxHighlighting/kustoMonarchLanguageDefinition';
|
|
53
52
|
import { LANGUAGE_ID } from './globals';
|
|
53
|
+
import { semanticTokensProviderRegistrarCreator } from './syntaxHighlighting/semanticTokensProviderRegistrar';
|
|
54
54
|
var kustoWorker;
|
|
55
55
|
var resolveWorker;
|
|
56
56
|
var rejectWorker;
|
|
@@ -67,6 +67,7 @@ export function setupMode(defaults, monacoInstance) {
|
|
|
67
67
|
var onSchemaChange = new monaco.Emitter();
|
|
68
68
|
// TODO: when should we dispose of these? seems like monaco-css and monaco-typescript don't dispose of these.
|
|
69
69
|
var disposables = [];
|
|
70
|
+
var semanticTokensProviderRegistrar = semanticTokensProviderRegistrarCreator();
|
|
70
71
|
var client = new WorkerManager(monacoInstance, defaults);
|
|
71
72
|
disposables.push(client);
|
|
72
73
|
var workerAccessor = function (first) {
|
|
@@ -85,6 +86,7 @@ export function setupMode(defaults, monacoInstance) {
|
|
|
85
86
|
})];
|
|
86
87
|
case 1:
|
|
87
88
|
_a.sent();
|
|
89
|
+
semanticTokensProviderRegistrar(monacoInstance, workerAccessor);
|
|
88
90
|
return [2 /*return*/];
|
|
89
91
|
}
|
|
90
92
|
});
|
|
@@ -109,8 +111,7 @@ export function setupMode(defaults, monacoInstance) {
|
|
|
109
111
|
} })); });
|
|
110
112
|
};
|
|
111
113
|
disposables.push(monacoInstance.languages.registerCompletionItemProvider(LANGUAGE_ID, new languageFeatures.CompletionAdapter(workerAccessor, defaults.languageSettings)));
|
|
112
|
-
setMonarchTokensProvider(
|
|
113
|
-
registerDocumentSemanticTokensProvider(workerAccessor, monacoInstance);
|
|
114
|
+
var monarchTokensProvider = monacoInstance.languages.setMonarchTokensProvider(LANGUAGE_ID, kustoLanguageDefinition);
|
|
114
115
|
disposables.push(new languageFeatures.DiagnosticsAdapter(monacoInstance, LANGUAGE_ID, workerAccessor, defaults, onSchemaChange.event));
|
|
115
116
|
disposables.push(monacoInstance.languages.registerDocumentRangeFormattingEditProvider(LANGUAGE_ID, new languageFeatures.FormatAdapter(workerAccessor)));
|
|
116
117
|
disposables.push(monacoInstance.languages.registerFoldingRangeProvider(LANGUAGE_ID, new languageFeatures.FoldingAdapter(workerAccessor)));
|
|
@@ -145,27 +146,3 @@ export function setupMode(defaults, monacoInstance) {
|
|
|
145
146
|
export function getKustoWorker() {
|
|
146
147
|
return workerPromise.then(function () { return kustoWorker; });
|
|
147
148
|
}
|
|
148
|
-
// This function sets the Monarch token provider,
|
|
149
|
-
// enabling fast syntax highlighting before the language service is called for semantic coloring.
|
|
150
|
-
function setMonarchTokensProvider(monacoInstance, disposables) {
|
|
151
|
-
var monarchTokensProvider = monacoInstance.languages.setMonarchTokensProvider(LANGUAGE_ID, kustoLanguageDefinition);
|
|
152
|
-
disposables.push(monarchTokensProvider);
|
|
153
|
-
}
|
|
154
|
-
// This function registers a semantic token provider that utilizes the language service
|
|
155
|
-
// for more context-relevant syntax highlighting.
|
|
156
|
-
function registerDocumentSemanticTokensProvider(workerAccessor, monacoInstance) {
|
|
157
|
-
var _this = this;
|
|
158
|
-
var classificationsGetter = function (resource) { return __awaiter(_this, void 0, void 0, function () {
|
|
159
|
-
var worker;
|
|
160
|
-
return __generator(this, function (_a) {
|
|
161
|
-
switch (_a.label) {
|
|
162
|
-
case 0: return [4 /*yield*/, workerAccessor(resource)];
|
|
163
|
-
case 1:
|
|
164
|
-
worker = _a.sent();
|
|
165
|
-
return [2 /*return*/, worker.getClassifications(resource.toString())];
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
}); };
|
|
169
|
-
var semanticTokenProvider = new SemanticTokensProvider(classificationsGetter);
|
|
170
|
-
monacoInstance.languages.registerDocumentSemanticTokensProvider(LANGUAGE_ID, semanticTokenProvider);
|
|
171
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 12.0.
|
|
3
|
+
* monaco-kusto version: 12.0.2(ba4a7496a706f790046400993d1050040ea93494)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
|
+
import { SemanticTokensProvider } from './SemanticTokensProvider';
|
|
3
|
+
import { AugmentedWorkerAccessor } from '../kustoMode';
|
|
4
|
+
export type SemanticTokensProviderRegistrar = (monacoInstance: typeof monaco, semanticTokensProvider: SemanticTokensProvider) => void;
|
|
5
|
+
export declare function semanticTokensProviderRegistrarCreator(): (monacoInstance: typeof monaco, workerAccessor: AugmentedWorkerAccessor) => void;
|
|
6
|
+
export declare function semanticTokensProviderRegistrarCreatorForTest(): (monacoInstance: typeof monaco, semanticTokensProvider: SemanticTokensProvider) => void;
|
|
@@ -0,0 +1,71 @@
|
|
|
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 { LANGUAGE_ID } from '../globals';
|
|
38
|
+
import { SemanticTokensProvider } from './SemanticTokensProvider';
|
|
39
|
+
// Registers semantic token provider that utilizes the language service
|
|
40
|
+
// for more context-relevant syntax highlighting.
|
|
41
|
+
export function semanticTokensProviderRegistrarCreator() {
|
|
42
|
+
var semanticTokensProviderRegistrar = semanticTokensProviderRegistrarCreatorForTest();
|
|
43
|
+
return function (monacoInstance, workerAccessor) {
|
|
44
|
+
var semanticTokensProvider = semanticTokensProviderMaker(workerAccessor);
|
|
45
|
+
semanticTokensProviderRegistrar(monacoInstance, semanticTokensProvider);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function semanticTokensProviderRegistrarCreatorForTest() {
|
|
49
|
+
var semanticTokensDisposable;
|
|
50
|
+
return function (monacoInstance, semanticTokensProvider) {
|
|
51
|
+
if (semanticTokensDisposable) {
|
|
52
|
+
semanticTokensDisposable.dispose();
|
|
53
|
+
}
|
|
54
|
+
semanticTokensDisposable = monacoInstance.languages.registerDocumentSemanticTokensProvider(LANGUAGE_ID, semanticTokensProvider);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function semanticTokensProviderMaker(workerAccessor) {
|
|
58
|
+
var _this = this;
|
|
59
|
+
var classificationsGetter = function (resource) { return __awaiter(_this, void 0, void 0, function () {
|
|
60
|
+
var worker;
|
|
61
|
+
return __generator(this, function (_a) {
|
|
62
|
+
switch (_a.label) {
|
|
63
|
+
case 0: return [4 /*yield*/, workerAccessor(resource)];
|
|
64
|
+
case 1:
|
|
65
|
+
worker = _a.sent();
|
|
66
|
+
return [2 /*return*/, worker.getClassifications(resource.toString())];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}); };
|
|
70
|
+
return new SemanticTokensProvider(classificationsGetter);
|
|
71
|
+
}
|