@kusto/monaco-kusto 12.0.1 → 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 +5 -1
- package/package.json +1 -1
- package/release/dev/kustoMode.js +1771 -4
- package/release/dev/kustoWorker.js +2 -2
- package/release/dev/{main-f36cb42f.js → main-de9bc066.js} +2 -2
- package/release/dev/monaco.contribution.js +66 -72
- package/release/dev/{schema-077630e6.js → schema-ea01b133.js} +2 -2
- package/release/dev/types-8a990554.js +46 -0
- package/release/esm/globals-0865238a.js +40 -0
- package/release/esm/kusto.worker.js +2 -2
- package/release/esm/kustoMode.d.ts +8 -4
- package/release/esm/kustoMode.js +89 -92
- package/release/esm/languageFeatures.d.ts +1 -1
- package/release/esm/languageServiceManager/schema.d.ts +2 -2
- package/release/esm/monaco.contribution.js +9 -42
- package/release/esm/{schema-b8f0ba9b.js → schema-a96574e6.js} +1 -1
- package/release/esm/syntaxHighlighting/SemanticTokensProvider.d.ts +1 -1
- package/release/esm/syntaxHighlighting/SemanticTokensProvider.js +3 -3
- package/release/esm/syntaxHighlighting/semanticTokensProviderRegistrar.d.ts +2 -2
- package/release/esm/syntaxHighlighting/semanticTokensProviderRegistrar.js +52 -4
- package/release/min/kustoMode.js +2 -2
- package/release/min/kustoWorker.js +2 -2
- package/release/min/{main-86d6c837.js → main-b1d46c4f.js} +2 -2
- package/release/min/monaco.contribution.js +2 -2
- package/release/min/{schema-a60c216c.js → schema-0d256352.js} +2 -2
- package/release/min/types-0c686717.js +7 -0
- package/release/dev/kustoMode-d3f9e09a.js +0 -1818
- package/release/esm/kustoMode-349f5467.js +0 -957
- package/release/min/kustoMode-2dd4a01e.js +0 -7
package/release/esm/kustoMode.js
CHANGED
|
@@ -48,104 +48,101 @@ 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 { kustoLanguageDefinition } from './syntaxHighlighting/kustoMonarchLanguageDefinition';
|
|
51
52
|
import { LANGUAGE_ID } from './globals';
|
|
52
53
|
import { semanticTokensProviderRegistrarCreator } from './syntaxHighlighting/semanticTokensProviderRegistrar';
|
|
53
|
-
|
|
54
|
-
var
|
|
54
|
+
var kustoWorker;
|
|
55
|
+
var resolveWorker;
|
|
56
|
+
var rejectWorker;
|
|
57
|
+
var workerPromise = new Promise(function (resolve, reject) {
|
|
58
|
+
resolveWorker = resolve;
|
|
59
|
+
rejectWorker = reject;
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* Called when Kusto language is first needed (a model has the language set)
|
|
63
|
+
* @param defaults
|
|
64
|
+
*/
|
|
55
65
|
export function setupMode(defaults, monacoInstance) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return [4 /*yield*/, augmentedSetSchema(normalizedSchema)];
|
|
93
|
-
case 2:
|
|
94
|
-
_a.sent();
|
|
95
|
-
return [2 /*return*/];
|
|
66
|
+
var _this = this;
|
|
67
|
+
var onSchemaChange = new monaco.Emitter();
|
|
68
|
+
// TODO: when should we dispose of these? seems like monaco-css and monaco-typescript don't dispose of these.
|
|
69
|
+
var disposables = [];
|
|
70
|
+
var semanticTokensProviderRegistrar = semanticTokensProviderRegistrarCreator();
|
|
71
|
+
var client = new WorkerManager(monacoInstance, defaults);
|
|
72
|
+
disposables.push(client);
|
|
73
|
+
var workerAccessor = function (first) {
|
|
74
|
+
var more = [];
|
|
75
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
76
|
+
more[_i - 1] = arguments[_i];
|
|
77
|
+
}
|
|
78
|
+
var augmentedSetSchema = function (schema, worker) { return __awaiter(_this, void 0, void 0, function () {
|
|
79
|
+
var workerPromise;
|
|
80
|
+
return __generator(this, function (_a) {
|
|
81
|
+
switch (_a.label) {
|
|
82
|
+
case 0:
|
|
83
|
+
workerPromise = worker.setSchema(schema);
|
|
84
|
+
return [4 /*yield*/, workerPromise.then(function () {
|
|
85
|
+
onSchemaChange.fire(schema);
|
|
86
|
+
})];
|
|
87
|
+
case 1:
|
|
88
|
+
_a.sent();
|
|
89
|
+
semanticTokensProviderRegistrar(monacoInstance, workerAccessor);
|
|
90
|
+
return [2 /*return*/];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}); };
|
|
94
|
+
var worker = client.getLanguageServiceWorker.apply(client, [first].concat(more));
|
|
95
|
+
return worker.then(function (worker) { return (__assign(__assign({}, worker), { setSchema: function (schema) { return augmentedSetSchema(schema, worker); }, setSchemaFromShowSchema: function (schema, connection, database, globalScalarParameters, globalTabularParameters) {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
+
return __generator(this, function (_a) {
|
|
98
|
+
switch (_a.label) {
|
|
99
|
+
case 0: return [4 /*yield*/, worker.normalizeSchema(schema, connection, database).then(function (schema) {
|
|
100
|
+
if (globalScalarParameters || globalTabularParameters) {
|
|
101
|
+
schema = __assign(__assign({}, schema), { globalScalarParameters: globalScalarParameters, globalTabularParameters: globalTabularParameters });
|
|
96
102
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
103
|
+
augmentedSetSchema(schema, worker);
|
|
104
|
+
})];
|
|
105
|
+
case 1:
|
|
106
|
+
_a.sent();
|
|
107
|
+
return [2 /*return*/];
|
|
108
|
+
}
|
|
109
|
+
});
|
|
101
110
|
});
|
|
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
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
{ open: '[', close: ']' },
|
|
135
|
-
{ open: '(', close: ')' },
|
|
136
|
-
{ open: "'", close: "'", notIn: ['string', 'comment'] },
|
|
137
|
-
{ open: '"', close: '"', notIn: ['string', 'comment'] },
|
|
138
|
-
],
|
|
139
|
-
};
|
|
140
|
-
monacoInstance.languages.setLanguageConfiguration(LANGUAGE_ID, languageConfiguration);
|
|
141
|
-
return [2 /*return*/, workerAccessor];
|
|
142
|
-
});
|
|
111
|
+
} })); });
|
|
112
|
+
};
|
|
113
|
+
disposables.push(monacoInstance.languages.registerCompletionItemProvider(LANGUAGE_ID, new languageFeatures.CompletionAdapter(workerAccessor, defaults.languageSettings)));
|
|
114
|
+
var monarchTokensProvider = monacoInstance.languages.setMonarchTokensProvider(LANGUAGE_ID, kustoLanguageDefinition);
|
|
115
|
+
disposables.push(new languageFeatures.DiagnosticsAdapter(monacoInstance, LANGUAGE_ID, workerAccessor, defaults, onSchemaChange.event));
|
|
116
|
+
disposables.push(monacoInstance.languages.registerDocumentRangeFormattingEditProvider(LANGUAGE_ID, new languageFeatures.FormatAdapter(workerAccessor)));
|
|
117
|
+
disposables.push(monacoInstance.languages.registerFoldingRangeProvider(LANGUAGE_ID, new languageFeatures.FoldingAdapter(workerAccessor)));
|
|
118
|
+
disposables.push(monacoInstance.languages.registerDefinitionProvider(LANGUAGE_ID, new languageFeatures.DefinitionAdapter(workerAccessor)));
|
|
119
|
+
disposables.push(monacoInstance.languages.registerRenameProvider(LANGUAGE_ID, new languageFeatures.RenameAdapter(workerAccessor)));
|
|
120
|
+
disposables.push(monacoInstance.languages.registerReferenceProvider(LANGUAGE_ID, new languageFeatures.ReferenceAdapter(workerAccessor)));
|
|
121
|
+
if (defaults.languageSettings.enableHover) {
|
|
122
|
+
disposables.push(monacoInstance.languages.registerHoverProvider(LANGUAGE_ID, new languageFeatures.HoverAdapter(workerAccessor)));
|
|
123
|
+
}
|
|
124
|
+
monacoInstance.languages.registerDocumentFormattingEditProvider(LANGUAGE_ID, new languageFeatures.DocumentFormatAdapter(workerAccessor));
|
|
125
|
+
kustoWorker = workerAccessor;
|
|
126
|
+
resolveWorker(workerAccessor);
|
|
127
|
+
monacoInstance.languages.setLanguageConfiguration(LANGUAGE_ID, {
|
|
128
|
+
folding: {
|
|
129
|
+
offSide: false,
|
|
130
|
+
markers: { start: /^\s*[\r\n]/gm, end: /^\s*[\r\n]/gm },
|
|
131
|
+
},
|
|
132
|
+
comments: {
|
|
133
|
+
lineComment: '//',
|
|
134
|
+
blockComment: null,
|
|
135
|
+
},
|
|
136
|
+
autoClosingPairs: [
|
|
137
|
+
{ open: '{', close: '}' },
|
|
138
|
+
{ open: '[', close: ']' },
|
|
139
|
+
{ open: '(', close: ')' },
|
|
140
|
+
{ open: "'", close: "'", notIn: ['string', 'comment'] },
|
|
141
|
+
{ open: '"', close: '"', notIn: ['string', 'comment'] },
|
|
142
|
+
],
|
|
143
143
|
});
|
|
144
|
+
return kustoWorker;
|
|
144
145
|
}
|
|
145
146
|
export function getKustoWorker() {
|
|
146
|
-
return
|
|
147
|
-
return __generator(this, function (_a) {
|
|
148
|
-
return [2 /*return*/, workerAccessor];
|
|
149
|
-
});
|
|
150
|
-
});
|
|
147
|
+
return workerPromise.then(function () { return kustoWorker; });
|
|
151
148
|
}
|
|
@@ -13,7 +13,7 @@ export declare class DiagnosticsAdapter {
|
|
|
13
13
|
private _schemaListener;
|
|
14
14
|
private _cursorListener;
|
|
15
15
|
private _debouncedValidations;
|
|
16
|
-
constructor(_monacoInstance: typeof monaco, _languageId: string, _worker: AugmentedWorkerAccessor, defaults: LanguageServiceDefaults, onSchemaChange: monaco.IEvent<Schema>);
|
|
16
|
+
constructor(_monacoInstance: typeof globalThis.monaco, _languageId: string, _worker: AugmentedWorkerAccessor, defaults: LanguageServiceDefaults, onSchemaChange: monaco.IEvent<Schema>);
|
|
17
17
|
private getMonacoCodeActions;
|
|
18
18
|
private getOrCreateDebouncedValidation;
|
|
19
19
|
dispose(): void;
|
|
@@ -62,8 +62,8 @@ export interface EngineSchema {
|
|
|
62
62
|
readonly databases: readonly Database[];
|
|
63
63
|
};
|
|
64
64
|
readonly database: Database | undefined;
|
|
65
|
-
globalScalarParameters?: readonly ScalarParameter[];
|
|
66
|
-
globalTabularParameters?: readonly TabularParameter[];
|
|
65
|
+
readonly globalScalarParameters?: readonly ScalarParameter[];
|
|
66
|
+
readonly globalTabularParameters?: readonly TabularParameter[];
|
|
67
67
|
}
|
|
68
68
|
export type TableEntityType = 'Table' | 'ExternalTable' | 'MaterializedViewTable';
|
|
69
69
|
export interface ClusterMangerSchema {
|
|
@@ -9,44 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
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;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
12
|
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
49
|
-
import * as mode from './kustoMode';
|
|
50
13
|
import KustoCommandHighlighter from './commandHighlighter';
|
|
51
14
|
import KustoCommandFormatter from './commandFormatter';
|
|
52
15
|
import { extend } from './extendedEditor';
|
|
@@ -59,6 +22,7 @@ export * from './languageServiceManager/renderInfo';
|
|
|
59
22
|
export * from './languageServiceManager/settings';
|
|
60
23
|
export * from './types';
|
|
61
24
|
export * from './extendedGlobalApi';
|
|
25
|
+
// --- Kusto configuration and defaults ---------
|
|
62
26
|
var LanguageServiceDefaultsImpl = /** @class */ (function () {
|
|
63
27
|
function LanguageServiceDefaultsImpl(languageSettings) {
|
|
64
28
|
this._onDidChange = new monaco.Emitter();
|
|
@@ -119,15 +83,18 @@ var defaultLanguageSettings = {
|
|
|
119
83
|
completionOptions: { includeExtendedSyntax: false },
|
|
120
84
|
};
|
|
121
85
|
export function getKustoWorker() {
|
|
122
|
-
return
|
|
123
|
-
|
|
124
|
-
|
|
86
|
+
return new Promise(function (resolve, reject) {
|
|
87
|
+
withMode(function (mode) {
|
|
88
|
+
mode.getKustoWorker().then(resolve, reject);
|
|
125
89
|
});
|
|
126
90
|
});
|
|
127
91
|
}
|
|
92
|
+
function withMode(callback) {
|
|
93
|
+
import('./kustoMode').then(callback);
|
|
94
|
+
}
|
|
128
95
|
export var kustoDefaults = new LanguageServiceDefaultsImpl(defaultLanguageSettings);
|
|
129
|
-
monaco.languages.onLanguage(
|
|
130
|
-
mode.setupMode(kustoDefaults, monaco);
|
|
96
|
+
monaco.languages.onLanguage('kusto', function () {
|
|
97
|
+
withMode(function (mode) { return mode.setupMode(kustoDefaults, monaco); });
|
|
131
98
|
});
|
|
132
99
|
monaco.languages.register({
|
|
133
100
|
id: LANGUAGE_ID,
|
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
import type * as monaco from 'monaco-editor';
|
|
2
2
|
import { editor } from 'monaco-editor';
|
|
3
3
|
import { ClassificationRange } from './types';
|
|
4
|
-
type ClassificationsGetter = (
|
|
4
|
+
type ClassificationsGetter = (resource: monaco.Uri) => Promise<ClassificationRange[]>;
|
|
5
5
|
export declare class SemanticTokensProvider implements monaco.languages.DocumentSemanticTokensProvider {
|
|
6
6
|
private readonly classificationsGetter;
|
|
7
7
|
constructor(classificationsGetter: ClassificationsGetter);
|
|
@@ -44,12 +44,12 @@ var SemanticTokensProvider = /** @class */ (function () {
|
|
|
44
44
|
};
|
|
45
45
|
SemanticTokensProvider.prototype.provideDocumentSemanticTokens = function (model) {
|
|
46
46
|
return __awaiter(this, void 0, void 0, function () {
|
|
47
|
-
var
|
|
47
|
+
var resource, classifications, semanticTokens;
|
|
48
48
|
return __generator(this, function (_a) {
|
|
49
49
|
switch (_a.label) {
|
|
50
50
|
case 0:
|
|
51
|
-
|
|
52
|
-
return [4 /*yield*/, this.classificationsGetter(
|
|
51
|
+
resource = model.uri;
|
|
52
|
+
return [4 /*yield*/, this.classificationsGetter(resource)];
|
|
53
53
|
case 1:
|
|
54
54
|
classifications = _a.sent();
|
|
55
55
|
semanticTokens = classifications.map(function (classification, index) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
2
|
import { SemanticTokensProvider } from './SemanticTokensProvider';
|
|
3
|
-
import {
|
|
3
|
+
import { AugmentedWorkerAccessor } from '../kustoMode';
|
|
4
4
|
export type SemanticTokensProviderRegistrar = (monacoInstance: typeof monaco, semanticTokensProvider: SemanticTokensProvider) => void;
|
|
5
|
-
export declare function semanticTokensProviderRegistrarCreator(): (monacoInstance: typeof monaco,
|
|
5
|
+
export declare function semanticTokensProviderRegistrarCreator(): (monacoInstance: typeof monaco, workerAccessor: AugmentedWorkerAccessor) => void;
|
|
6
6
|
export declare function semanticTokensProviderRegistrarCreatorForTest(): (monacoInstance: typeof monaco, semanticTokensProvider: SemanticTokensProvider) => void;
|
|
@@ -1,11 +1,47 @@
|
|
|
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
|
+
};
|
|
1
37
|
import { LANGUAGE_ID } from '../globals';
|
|
2
38
|
import { SemanticTokensProvider } from './SemanticTokensProvider';
|
|
3
39
|
// Registers semantic token provider that utilizes the language service
|
|
4
40
|
// for more context-relevant syntax highlighting.
|
|
5
41
|
export function semanticTokensProviderRegistrarCreator() {
|
|
6
42
|
var semanticTokensProviderRegistrar = semanticTokensProviderRegistrarCreatorForTest();
|
|
7
|
-
return function (monacoInstance,
|
|
8
|
-
var semanticTokensProvider = semanticTokensProviderMaker(
|
|
43
|
+
return function (monacoInstance, workerAccessor) {
|
|
44
|
+
var semanticTokensProvider = semanticTokensProviderMaker(workerAccessor);
|
|
9
45
|
semanticTokensProviderRegistrar(monacoInstance, semanticTokensProvider);
|
|
10
46
|
};
|
|
11
47
|
}
|
|
@@ -18,6 +54,18 @@ export function semanticTokensProviderRegistrarCreatorForTest() {
|
|
|
18
54
|
semanticTokensDisposable = monacoInstance.languages.registerDocumentSemanticTokensProvider(LANGUAGE_ID, semanticTokensProvider);
|
|
19
55
|
};
|
|
20
56
|
}
|
|
21
|
-
function semanticTokensProviderMaker(
|
|
22
|
-
|
|
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);
|
|
23
71
|
}
|
package/release/min/kustoMode.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
|
-
define("vs/language/kusto/kustoMode",["exports","vs/editor/editor.main","./kustoMode-2dd4a01e","./main-86d6c837"],(function(e,o,t,s){"use strict";e.getKustoWorker=t.getKustoWorker,e.setupMode=t.setupMode}));
|
|
7
|
+
define("vs/language/kusto/kustoMode",["exports","vs/editor/editor.main","./main-b1d46c4f","./types-0c686717"],(function(t,e,r,n){"use strict";function o(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})),e.default=t,Object.freeze(e)}var i=o(e),a=["onDidProvideCompletionItems"];function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,s(n.key),n)}}function s(t){var e=function(t,e){if("object"!=u(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==u(e)?e:e+""}var l=function(){return t=function t(e,r){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._monacoInstance=e,this._defaults=r,this._worker=null,this._idleCheckInterval=self.setInterval((function(){return n._checkIfIdle()}),3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange((function(){return n._saveStateAndStopWorker()}))},e=[{key:"_stopWorker",value:function(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}},{key:"_saveStateAndStopWorker",value:function(){var t=this;this._worker&&this._worker.getProxy().then((function(e){e.getSchema().then((function(e){t._storedState={schema:e},t._stopWorker()}))}))}},{key:"dispose",value:function(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}},{key:"_checkIfIdle",value:function(){if(this._worker){var t=this._defaults.getWorkerMaxIdleTime(),e=Date.now()-this._lastUsedTime;t>0&&e>t&&this._saveStateAndStopWorker()}}},{key:"_getClient",value:function(){var t=this;this._lastUsedTime=Date.now();var e=this._defaults.languageSettings;e.onDidProvideCompletionItems;var r=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(e,a);return this._client||(this._worker=this._monacoInstance.editor.createWebWorker({moduleId:"vs/language/kusto/kustoWorker",label:"kusto",createData:{languageSettings:r,languageId:"kusto"}}),this._client=this._worker.getProxy().then((function(e){return t._storedState?e.setSchema(t._storedState.schema).then((function(){return e})):e}))),this._client}},{key:"getLanguageServiceWorker",value:function(){for(var t,e=this,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return this._getClient().then((function(e){t=e})).then((function(t){return e._worker.withSyncedResources(n)})).then((function(e){return t}))}}],e&&c(t.prototype,e),r&&c(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function h(t){var e=f(t);return null!=t&&("object"==e||"function"==e)}function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}var d="object"==("undefined"==typeof global?"undefined":p(global))&&global&&global.Object===Object&&global;function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}var m="object"==("undefined"==typeof self?"undefined":y(self))&&self&&self.Object===Object&&self,v=d||m||Function("return this")(),g=function(){return v.Date.now()},b=/\s/;var w=/^\s+/;function _(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&b.test(t.charAt(e)););return e}(t)+1).replace(w,""):t}var k=v.Symbol,x=Object.prototype,S=x.hasOwnProperty,L=x.toString,E=k?k.toStringTag:void 0;var j=Object.prototype.toString;var O="[object Null]",I="[object Undefined]",P=k?k.toStringTag:void 0;function T(t){return null==t?void 0===t?I:O:P&&P in Object(t)?function(t){var e=S.call(t,E),r=t[E];try{t[E]=void 0;var n=!0}catch(t){}var o=L.call(t);return n&&(e?t[E]=r:delete t[E]),o}(t):function(t){return j.call(t)}(t)}function C(t){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(t)}function A(t){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A(t)}var N="[object Symbol]";function D(t){return"symbol"==A(t)||function(t){return null!=t&&"object"==C(t)}(t)&&T(t)==N}var G=NaN,F=/^[-+]0x[0-9a-f]+$/i,M=/^0b[01]+$/i,U=/^0o[0-7]+$/i,K=parseInt;function R(t){if("number"==typeof t)return t;if(D(t))return G;if(h(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=h(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=_(t);var r=M.test(t);return r||U.test(t)?K(t.slice(2),r?2:8):F.test(t)?G:+t}var V=Math.max,W=Math.min;function q(t,e,r){var n,o,i,a,u,c,s=0,l=!1,f=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(e){var r=n,i=o;return n=o=void 0,s=e,a=t.apply(i,r)}function y(t){var r=t-c;return void 0===c||r>=e||r<0||f&&t-s>=i}function m(){var t=g();if(y(t))return v(t);u=setTimeout(m,function(t){var r=e-(t-c);return f?W(r,i-(t-s)):r}(t))}function v(t){return u=void 0,p&&n?d(t):(n=o=void 0,a)}function b(){var t=g(),r=y(t);if(n=arguments,o=this,c=t,r){if(void 0===u)return function(t){return s=t,u=setTimeout(m,e),l?d(t):a}(c);if(f)return clearTimeout(u),u=setTimeout(m,e),d(c)}return void 0===u&&(u=setTimeout(m,e)),a}return e=R(e)||0,h(r)&&(l=!!r.leading,i=(f="maxWait"in r)?V(R(r.maxWait)||0,e):i,p="trailing"in r?!!r.trailing:p),b.cancel=function(){void 0!==u&&clearTimeout(u),s=0,n=c=o=u=void 0},b.flush=function(){return void 0===u?a:v(g())},b}function z(t,e){return t&&e.filterText.toLowerCase().includes(t.toLowerCase())?"".concat(t).concat(e.filterText):e.filterText}function Y(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Q(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function $(t){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$(t)}function H(t){return function(t){if(Array.isArray(t))return B(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Q(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Q(t,e){if(t){if("string"==typeof t)return B(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?B(t,e):void 0}}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function J(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */J=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new P(n||[]);return o(a,"_invoke",{value:E(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var w={};s(w,a,(function(){return this}));var _=Object.getPrototypeOf,k=_&&_(_(T([])));k&&k!==r&&n.call(k,a)&&(w=k);var x=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==$(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function E(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=j(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?y:p,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError($(e)+" is not iterable")}return g.prototype=b,o(x,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=s(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},S(L.prototype),s(L.prototype,u,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new L(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(x),s(x,c,"Generator"),s(x,a,(function(){return this})),s(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function X(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function Z(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){X(i,n,o,a,u,"next",t)}function u(t){X(i,n,o,a,u,"throw",t)}a(void 0)}))}}function tt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function et(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ot(n.key),n)}}function rt(t,e,r){return e&&et(t.prototype,e),r&&et(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function nt(t,e,r){return(e=ot(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ot(t){var e=function(t,e){if("object"!=$(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=$(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==$(e)?e:e+""}var it=function(){return rt((function t(e,r,n,o,a){var u=this;tt(this,t),nt(this,"_disposables",[]),nt(this,"_contentListener",Object.create(null)),nt(this,"_configurationListener",Object.create(null)),nt(this,"_schemaListener",Object.create(null)),nt(this,"_cursorListener",Object.create(null)),nt(this,"_debouncedValidations",Object.create(null)),this._monacoInstance=e,this._languageId=r,this._worker=n,this.defaults=o;var c,s=function(t){var e=t.getLanguageId(),r=t.uri.toString();if(e===u._languageId){var n=u.getOrCreateDebouncedValidation(t,e);u._contentListener[r]=t.onDidChangeContent((function(t){var e=function(t){return t.changes.map((function(t){return{start:t.rangeOffset,end:t.rangeOffset+t.text.length}}))}(t);n(e)})),u._configurationListener[r]=u.defaults.onDidChange((function(){self.setTimeout((function(){return u._doValidate(t,e,[])}),0)})),u._schemaListener[r]=a((function(){self.setTimeout((function(){return u._doValidate(t,e,[])}),0)}))}},l=function(t){var e=t.getId();u._cursorListener[e]||(t.onDidDispose((function(){var t;null===(t=u._cursorListener[e])||void 0===t||t.dispose(),delete u._cursorListener[e]})),u._cursorListener[e]=t.onDidChangeCursorSelection((function(e){var r=t.getModel(),n=r.getLanguageId();if(n===u._languageId){var o=r.getOffsetAt(e.selection.getPosition());u.getOrCreateDebouncedValidation(r,n)([{start:o,end:o}])}})))},f=function(t){u._monacoInstance.editor.setModelMarkers(t,u._languageId,[]);var e=t.uri.toString(),r=u._contentListener[e];r&&(r.dispose(),delete u._contentListener[e]);var n=u._configurationListener[e];n&&(n.dispose(),delete u._configurationListener[e]);var o=u._schemaListener[e];o&&(o.dispose(),delete u._schemaListener[e]);var i=u._debouncedValidations[e];i&&(i.cancel(),delete u._debouncedValidations[e])};this.defaults.languageSettings.enableQuickFixes&&this._disposables.push(i.languages.registerCodeActionProvider(this._languageId,{provideCodeActions:(c=Z(J().mark((function t(e,r,n,o){var i,a,c,s;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.getOffsetAt(r.getStartPosition()),a=e.getOffsetAt(r.getEndPosition()),c=n.markers.length>0,t.next=5,u.getMonacoCodeActions(e,i,a,c);case 5:return s=t.sent,t.abrupt("return",{actions:s,dispose:function(){}});case 7:case"end":return t.stop()}}),t)}))),function(t,e,r,n){return c.apply(this,arguments)})})),this._disposables.push(this._monacoInstance.editor.onDidCreateEditor(l)),this._disposables.push(this._monacoInstance.editor.onDidCreateModel(s)),this._disposables.push(this._monacoInstance.editor.onWillDisposeModel(f)),this._disposables.push(this._monacoInstance.editor.onDidChangeModelLanguage((function(t){f(t.model),s(t.model)}))),this._disposables.push({dispose:function(){for(var t in u._contentListener)u._contentListener[t].dispose();for(var e in u._cursorListener)u._cursorListener[e].dispose();for(var r in u._debouncedValidations)u._debouncedValidations[r].cancel()}}),this._monacoInstance.editor.getModels().forEach(s),this._monacoInstance.editor.getEditors().forEach(l)}),[{key:"getMonacoCodeActions",value:(t=Z(J().mark((function t(e,r,n,o){var i,a,u,c,s,l,f,h=this;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=[],t.next=3,this._worker(e.uri);case 3:return a=t.sent,u=e.uri,t.next=7,a.getResultActions(u.toString(),r,n);case 7:c=t.sent,s=J().mark((function t(){var r,n,a,u,s;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=c[f]).kind.includes("Extract Function")){t.next=3;break}return t.abrupt("return",0);case 3:if("quickfix"!=(a=null!==(r=h.defaults.languageSettings.quickFixCodeActions)&&void 0!==r&&r.find((function(t){return n.kind.includes(t)}))?"quickfix":"custom")||o){t.next=6;break}return t.abrupt("return",{v:void 0});case 6:u=n.changes,s=u.map((function(t){var r,n=e.getPositionAt(t.start),o=e.getPositionAt(t.start+t.deleteLength);return{resource:e.uri,textEdit:{range:{startLineNumber:n.lineNumber,startColumn:n.column,endLineNumber:o.lineNumber,endColumn:o.column},text:null!==(r=t.insertText)&&void 0!==r?r:""}}})),i.push({title:n.title,diagnostics:[],kind:a,edit:{edits:H(s)}});case 9:case"end":return t.stop()}}),t)})),f=0;case 10:if(!(f<c.length)){t.next=20;break}return t.delegateYield(s(),"t0",12);case 12:if(0!==(l=t.t0)){t.next=15;break}return t.abrupt("continue",17);case 15:if(!l){t.next=17;break}return t.abrupt("return",l.v);case 17:f++,t.next=10;break;case 20:return t.abrupt("return",i);case 21:case"end":return t.stop()}}),t,this)}))),function(e,r,n,o){return t.apply(this,arguments)})},{key:"getOrCreateDebouncedValidation",value:function(t,e){var r=this,n=t.uri.toString();return this._debouncedValidations[n]||(this._debouncedValidations[n]=q((function(n){return r._doValidate(t,e,n)}),500)),this._debouncedValidations[n]}},{key:"dispose",value:function(){this._disposables.forEach((function(t){return t&&t.dispose()})),this._disposables=[]}},{key:"_doValidate",value:function(t,e,r){var n=this;if(!t.isDisposed()){var o=t.uri,a=t.getVersionId();this._worker(o).then((function(t){return t.doValidation(o.toString(),r)})).then((function(t){if(n._monacoInstance.editor.getModel(o).getVersionId()===a){var r=t.map((function(t){return r="number"==typeof(e=t).code?String(e.code):e.code,{severity:at(e.severity),startLineNumber:e.range.start.line+1,startColumn:e.range.start.character+1,endLineNumber:e.range.end.line+1,endColumn:e.range.end.character+1,message:e.message,code:r,source:e.source};var e,r})),u=n._monacoInstance.editor.getModel(o),c=u.getAllDecorations().filter((function(t){return"squiggly-error"==t.options.className})).map((function(t){return t.id}));if(u&&u.getLanguageId()===e){var s=n.defaults.languageSettings.syntaxErrorAsMarkDown;if(s&&s.enableSyntaxErrorAsMarkDown){var l=s.header?"**".concat(s.header,"** \n\n"):"",f=s.icon?""):"",h="".concat(f," ").concat(l),p=r.map((function(t){return{range:{startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn},options:{hoverMessage:{value:h+t.message},className:"squiggly-error",zIndex:100,overviewRuler:{color:"rgb(255, 18, 18, 0.7)",position:i.editor.OverviewRulerLane.Right},minimap:{color:"rgb(255, 18, 18, 0.7)",position:i.editor.MinimapPosition.Inline}}}})),d=i.editor.getModelMarkers({owner:e,resource:o});d&&d.length>0&&(c=[],n._monacoInstance.editor.setModelMarkers(u,e,[])),u.deltaDecorations(c,p)}else u.deltaDecorations(c,[]),n._monacoInstance.editor.setModelMarkers(u,e,r)}}})).then(void 0,(function(t){console.error(t)}))}}}]);var t}();function at(t){switch(t){case r.DiagnosticSeverity.Error:return i.MarkerSeverity.Error;case r.DiagnosticSeverity.Warning:return i.MarkerSeverity.Warning;case r.DiagnosticSeverity.Information:return i.MarkerSeverity.Info;case r.DiagnosticSeverity.Hint:return i.MarkerSeverity.Hint;default:return i.MarkerSeverity.Info}}function ut(t){if(t)return{character:t.column-1,line:t.lineNumber-1}}function ct(t){if(t)return new i.Range(t.start.line+1,t.start.character+1,t.end.line+1,t.end.character+1)}function st(t){var e=i.languages.CompletionItemKind;switch(t){case r.CompletionItemKind.Text:return e.Text;case r.CompletionItemKind.Method:return e.Method;case r.CompletionItemKind.Function:return e.Function;case r.CompletionItemKind.Constructor:return e.Constructor;case r.CompletionItemKind.Field:return e.Field;case r.CompletionItemKind.Variable:return e.Variable;case r.CompletionItemKind.Class:return e.Class;case r.CompletionItemKind.Interface:return e.Interface;case r.CompletionItemKind.Module:return e.Module;case r.CompletionItemKind.Property:return e.Property;case r.CompletionItemKind.Unit:return e.Unit;case r.CompletionItemKind.Value:return e.Value;case r.CompletionItemKind.Enum:return e.Enum;case r.CompletionItemKind.Keyword:return e.Keyword;case r.CompletionItemKind.Snippet:return e.Snippet;case r.CompletionItemKind.Color:return e.Color;case r.CompletionItemKind.File:return e.File;case r.CompletionItemKind.Reference:return e.Reference}return e.Property}function lt(t){if(t)return{range:ct(t.range),text:t.newText}}var ft=function(){return rt((function t(e,r){tt(this,t),this.languageSettings=r;var n=function(){var t=Z(J().mark((function t(r,n){var o;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e(r);case 2:return o=t.sent,t.abrupt("return",o.doComplete(r.toString(),n));case 4:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}();this.completionCacheManager=function(t){var e,r;return{getCompletionItems:function(n,o,i){return(!r||!n||!(null!=n&&n.includes(r)))&&(e=t(o,i)),r=n,e}}}(n)}),[{key:"triggerCharacters",get:function(){return[" ",".","("]}},{key:"provideCompletionItems",value:function(t,e,n,o){var a,u=this,c=t.getWordUntilPosition(e),s=new i.Range(e.lineNumber,c.startColumn,e.lineNumber,c.endColumn),l=t.uri,f=null==t||null===(a=t.getWordAtPosition(e))||void 0===a?void 0:a.word,h=this.languageSettings.onDidProvideCompletionItems;return this.completionCacheManager.getCompletionItems(f,l,ut(e)).then((function(t){return h?h(t):t})).then((function(t){if(t){var e=function(t,e){var r=t[0];if(!e)return r;var n=t.find((function(t){var r;return null===(r=t.filterText)||void 0===r?void 0:r.toLowerCase().startsWith(e.toLowerCase())}));return null!=n?n:r}(t.items,f);return{incomplete:!0,suggestions:t.items.map((function(t,n){var o,a={label:t.label,insertText:t.insertText,sortText:t.sortText,filterText:z(f,t),documentation:u.formatDocLink(null===(o=t.documentation)||void 0===o?void 0:o.value),detail:t.detail,range:s,kind:st(t.kind),preselect:e.filterText===t.filterText};return t.textEdit&&(a.range=ct(t.textEdit.range),a.insertText=t.textEdit.newText),t.insertTextFormat===r.InsertTextFormat.Snippet&&(a.insertTextRules=i.languages.CompletionItemInsertTextRule.InsertAsSnippet),a}))}}}))}},{key:"formatDocLink",value:function(t){if(t){var e=this.languageSettings,r=e.documentationBaseUrl,n=void 0===r?"https://learn.microsoft.com/azure/data-explorer/kusto/query":r,o=e.documentationSuffix;return{value:t,isTrusted:!0,uris:new Proxy({},{get:function(t,e,r){var a=e.toString().replace(".md","");a.startsWith("https")||(a="".concat(n,"/").concat(a));var u=i.Uri.parse(a);return o&&(u.toString=function(){return a+o}),u}})}}}}])}();function ht(t){return"string"==typeof t?{value:t}:(e=t)&&"object"===$(e)&&"string"==typeof e.kind?"plaintext"===t.kind?{value:t.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:t.value}:{value:"```"+t.value+"\n"+t.value+"\n```\n"};var e}function pt(t){if(t)return Array.isArray(t)?t.map(ht):[ht(t)]}function dt(t){return{uri:i.Uri.parse(t.uri),range:ct(t.range)}}var yt=function(){return rt((function t(e){tt(this,t),this._worker=e}),[{key:"provideDefinition",value:function(t,e,r){var n=t.uri;return this._worker(n).then((function(t){return t.findDefinition(n.toString(),ut(e))})).then((function(t){if(t&&0!=t.length)return[dt(t[0])]}))}}])}(),mt=function(){return rt((function t(e){tt(this,t),this._worker=e}),[{key:"provideReferences",value:function(t,e,r,n){var o=t.uri;return this._worker(o).then((function(t){return t.findReferences(o.toString(),ut(e))})).then((function(t){if(t)return t.map(dt)}))}}])}();var vt=function(){return rt((function t(e){tt(this,t),this._worker=e}),[{key:"provideRenameEdits",value:function(t,e,r,n){var o=t.uri;return this._worker(o).then((function(t){return t.doRename(o.toString(),ut(e),r)})).then((function(t){return function(t){if(t&&t.changes){var e=[];for(var r in t.changes){var n,o=i.Uri.parse(r),a=Y(t.changes[r]);try{for(a.s();!(n=a.n()).done;){var u=n.value;e.push({resource:o,textEdit:{range:ct(u.range),text:u.newText},versionId:void 0})}}catch(t){a.e(t)}finally{a.f()}}return{edits:e}}}(t)}))}}])}(),gt=function(){return rt((function t(e){tt(this,t),this._worker=e}),[{key:"provideDocumentFormattingEdits",value:function(t,e,r){var n=t.uri;return this._worker(n).then((function(t){return t.doDocumentFormat(n.toString()).then((function(t){return t.map((function(t){return lt(t)}))}))}))}}])}(),bt=function(){return rt((function t(e){tt(this,t),this._worker=e}),[{key:"provideDocumentRangeFormattingEdits",value:function(t,e,r,n){var o=t.uri;return this._worker(o).then((function(t){return t.doRangeFormat(o.toString(),function(t){if(t)return{start:ut(t.getStartPosition()),end:ut(t.getEndPosition())}}(e)).then((function(t){return t.map((function(t){return lt(t)}))}))}))}}])}(),wt=function(){return rt((function t(e){tt(this,t),this._worker=e}),[{key:"provideFoldingRanges",value:function(t,e,r){var n=t.uri;return this._worker(n).then((function(t){return t.doFolding(n.toString()).then((function(t){return t.map((function(t){return function(t){return{start:t.startLine+1,end:t.endLine+1,kind:i.languages.FoldingRangeKind.Region}}(t)}))}))}))}}])}();var _t=function(){return rt((function t(e){tt(this,t),this._worker=e}),[{key:"provideHover",value:function(t,e,r){var n=t.uri;return this._worker(n).then((function(t){return t.doHover(n.toString(),ut(e))})).then((function(t){if(t)return{range:ct(t.range),contents:pt(t.contents)}}))}}])}(),kt={name:n.LANGUAGE_ID,mimeTypes:["text/kusto"],displayName:"Kusto",defaultToken:"invalid",queryOperators:["as","consume","distinct","evaluate","extend","getschema","graph-match","graph-merge","graph-to-table","invoke","join","limit","lookup","make-graph","make-series","mv-apply","mv-expand","order","parse","parse-kv","parse-where","project","project-away","project-keep","project-rename","project-reorder","range","reduce","render","sample","sample-distinct","scan","serialize","sort","summarize","take","top","top-hitters","top-nested","union","where","filter","fork","facet","range","consume","find","search","print","partition","lookup"],queryParameters:["kind"],types:["bool","datetime","decimal","double","dynamic","guid","int","long","real","string","timespan"],commands:[".add",".alter",".alter-merge",".append",".as",".assert",".attach",".consume",".count",".create",".create-merge",".create-or-alter",".create-set",".datatable",".default",".define",".delete",".detach",".distinct",".drop",".drop-pretend",".dup-next-failed-ingest",".dup-next-ingest",".evaluate",".export",".extend",".externaldata",".filter",".find",".fork",".getschema",".ingest",".join",".limit",".load",".make-series",".materialize",".move",".mv-expand",".order",".parse",".parse-where",".partition",".pivot",".print",".project",".project-away",".project-keep",".project-rename",".reduce",".remove",".rename",".replace",".restrict",".run",".sample",".sample-distinct",".save",".search",".serialize",".set",".set-or-append",".set-or-replace",".show",".sort",".summarize",".take",".top",".top-hitters",".top-nested",".union"],functions:["abs","acos","ago","array_concat","array_length","array_slice","array_split","asin","atan","atan2","avg","bag_keys","base64_decodestring","base64_encodestring","bin","bin_at","binary_and","binary_not","binary_or","binary_shift_left","binary_shift_right","binary_xor","case","ceiling","coalesce","columnifexists","cos","count","countof","cot","cursor_after","datatable","datepart","datetime_add","datetime_diff","datetime_part","dayofmonth","dayofweek","dayofyear","dcount","dcount_hll","degrees","endofday","endofmonth","endofweek","endofyear","exp","exp10","exp2","extract","extractall","extractjson","format_datetime","format_timespan","floor","gamma","geo_distance_2points","geo_geohash_to_central_point","geo_point_in_circle","geo_point_in_polygon","geo_point_to_geohash","getmonth","gettype","getyear","hash","hash_sha256","hll_merge","iif","indexof","isempty","isfinite","isinf","isascii","isnan","isnotempty","isnotnull","isnull","isutf8","log","log10","log2","loggamma","make_datetime","make_string","make_timespan","materialize","max","max_of","min","min_of","monthofyear","next","not","pack","pack_array","pack_dictionary","parse_csv","parse_ipv4","parse_json","parse_path","parse_url","parse_urlquery","parse_user_agent","parse_version","parse_xml","parsejson","percentrank_tdigest","percentile_tdigest","pow","prev","radians","rand","rank_tdigest","repeat","replace","reverse","round","row_cumsum","row_window_session","series_add","series_decompose","series_decompose_anomalies","series_decompose_forecast","series_divide","series_equals","series_fill_backward","series_fill_const","series_fill_forward","series_fill_linear","series_fir","series_fit_2lines","series_fit_2lines_dynamic","series_fit_line","series_fit_line_dynamic","series_greater","series_greater_equals","series_iir","series_less","series_less_equals","series_multiply","series_not_equals","series_outliers","series_pearson_correlation","series_periods_detect","series_periods_validate","series_seasonal","series_stats","series_stats_dynamic","series_subtract","sign","sin","split","sqrt","startofday","startofmonth","startofweek","startofyear","strcat","strcat_array","strcat_delim","strcmp","strlen","strrep","string_size","substring","sum","tan","tdigest_merge","tobool","toboolean","todecimal","todouble","todynamic","tofloat","toguid","tohex","toint","tolong","tolower","toobject","toreal","toscalar","tostring","totimespan","toupper","translate","trim","trim_end","trim_start","typeof","url_decode","url_encode","week_of_year","welch_test"],keywords:["and","as","asc","between","by","contains","count","desc","extend","false","filter","find","from","has","in","inner","join","leftouter","let","not","on","or","policy","project","project-away","project-rename","project-reorder","project-keep","range","rename","retention","summarize","table","take","to","true","where","with"],tokenizer:{root:[[/(\/\/.*$)/,n.Token.Comment],[/[\(\)\{\}\|\[\]\:\=\,\<|\.\..]/,n.Token.Punctuation],[/[\+\-\*\/\%\!\<\<=\>\>=\=\==\!=\<>\:\;\,\=~\@\?\=>\!~]/,n.Token.MathOperator],[/"([^"\\]*(\\.[^"\\]*)*)"/,n.Token.StringLiteral],[/'([^"\\]*(\\.[^"\\]*)*)'/,n.Token.StringLiteral],[/[\w@#\-$\.]+/,{cases:{"@queryOperators":n.Token.QueryOperator,"@queryParameters":n.Token.QueryParameter,"@types":n.Token.Type,"@commands":n.Token.Command,"@functions":n.Token.Function,"@keywords":n.Token.Keyword,"@default":"identifier"}}]]}};function xt(t){return xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xt(t)}function St(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */St=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new P(n||[]);return o(a,"_invoke",{value:E(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var w={};s(w,a,(function(){return this}));var _=Object.getPrototypeOf,k=_&&_(_(T([])));k&&k!==r&&n.call(k,a)&&(w=k);var x=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==xt(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function E(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=j(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?y:p,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(xt(e)+" is not iterable")}return g.prototype=b,o(x,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=s(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},S(L.prototype),s(L.prototype,u,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new L(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(x),s(x,c,"Generator"),s(x,a,(function(){return this})),s(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Lt(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function Et(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,jt(n.key),n)}}function jt(t){var e=function(t,e){if("object"!=xt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=xt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==xt(e)?e:e+""}var Ot,It,Pt=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.classificationsGetter=e},e=[{key:"getLegend",value:function(){return{tokenTypes:n.tokenTypes,tokenModifiers:[]}}},{key:"provideDocumentSemanticTokens",value:(o=St().mark((function t(e){var r,n,o;return St().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.uri,t.next=3,this.classificationsGetter(r);case 3:return n=t.sent,o=n.map((function(t,e){return Ct(t,n[e-1])})),t.abrupt("return",{data:new Uint32Array(o.flat()),resultId:e.getVersionId().toString()});case 6:case"end":return t.stop()}}),t,this)})),i=function(){var t=this,e=arguments;return new Promise((function(r,n){var i=o.apply(t,e);function a(t){Lt(i,r,n,a,u,"next",t)}function u(t){Lt(i,r,n,a,u,"throw",t)}a(void 0)}))},function(t){return i.apply(this,arguments)})},{key:"releaseDocumentSemanticTokens",value:function(){}}],e&&Et(t.prototype,e),r&&Et(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,o,i}(),Tt={line:0,character:0,length:0,kind:0};function Ct(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Tt,r=t.line,n=t.character,o=t.length,i=t.kind,a=r-e.line;return[a,a?n:n-e.character,o,i,0]}function At(t){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(t)}function Nt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Nt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new P(n||[]);return o(a,"_invoke",{value:E(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var w={};s(w,a,(function(){return this}));var _=Object.getPrototypeOf,k=_&&_(_(T([])));k&&k!==r&&n.call(k,a)&&(w=k);var x=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==At(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function E(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=j(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?y:p,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(At(e)+" is not iterable")}return g.prototype=b,o(x,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=s(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},S(L.prototype),s(L.prototype,u,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new L(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(x),s(x,c,"Generator"),s(x,a,(function(){return this})),s(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function Dt(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function Gt(){var t,e=function(e,r){t&&t.dispose(),t=e.languages.registerDocumentSemanticTokensProvider(n.LANGUAGE_ID,r)};return function(t,r){var n=function(t){var e=function(){var e,r=(e=Nt().mark((function e(r){var n;return Nt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t(r);case 2:return n=e.sent,e.abrupt("return",n.getClassifications(r.toString()));case 4:case"end":return e.stop()}}),e)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){Dt(i,n,o,a,u,"next",t)}function u(t){Dt(i,n,o,a,u,"throw",t)}a(void 0)}))});return function(t){return r.apply(this,arguments)}}();return new Pt(e)}(r);e(t,n)}}function Ft(t){return Ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(t)}function Mt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Ut(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Mt(Object(r),!0).forEach((function(e){Kt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Mt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Kt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Ft(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ft(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ft(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rt(t){return function(t){if(Array.isArray(t))return Vt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Vt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Vt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Wt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */Wt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new P(n||[]);return o(a,"_invoke",{value:E(t,r,u)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",m={};function v(){}function g(){}function b(){}var w={};s(w,a,(function(){return this}));var _=Object.getPrototypeOf,k=_&&_(_(T([])));k&&k!==r&&n.call(k,a)&&(w=k);var x=b.prototype=v.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,a,u){var c=f(t[o],t,i);if("throw"!==c.type){var s=c.arg,l=s.value;return l&&"object"==Ft(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function E(e,r,n){var o=h;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=j(u,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?y:p,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(Ft(e)+" is not iterable")}return g.prototype=b,o(x,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=s(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,s(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},S(L.prototype),s(L.prototype,u,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new L(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(x),s(x,c,"Generator"),s(x,a,(function(){return this})),s(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=T,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return u.type="throw",u.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),m}},e}function qt(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function zt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){qt(i,n,o,a,u,"next",t)}function u(t){qt(i,n,o,a,u,"throw",t)}a(void 0)}))}}var Yt=new Promise((function(t,e){It=t}));t.getKustoWorker=function(){return Yt.then((function(){return Ot}))},t.setupMode=function(t,e){var r=new i.Emitter,o=[],a=Gt(),u=new l(e,t);o.push(u);var c=function t(n){for(var o=function(){var n=zt(Wt().mark((function n(o,i){var u;return Wt().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return u=i.setSchema(o),n.next=3,u.then((function(){r.fire(o)}));case 3:a(e,t);case 4:case"end":return n.stop()}}),n)})));return function(t,e){return n.apply(this,arguments)}}(),i=arguments.length,c=new Array(i>1?i-1:0),s=1;s<i;s++)c[s-1]=arguments[s];return u.getLanguageServiceWorker.apply(u,Rt([n].concat(c))).then((function(t){return Ut(Ut({},t),{},{setSchema:function(e){return o(e,t)},setSchemaFromShowSchema:function(e,r,n,i,a){return zt(Wt().mark((function u(){return Wt().wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,t.normalizeSchema(e,r,n).then((function(e){(i||a)&&(e=Ut(Ut({},e),{},{globalScalarParameters:i,globalTabularParameters:a})),o(e,t)}));case 2:case"end":return u.stop()}}),u)})))()}})}))};return o.push(e.languages.registerCompletionItemProvider(n.LANGUAGE_ID,new ft(c,t.languageSettings))),e.languages.setMonarchTokensProvider(n.LANGUAGE_ID,kt),o.push(new it(e,n.LANGUAGE_ID,c,t,r.event)),o.push(e.languages.registerDocumentRangeFormattingEditProvider(n.LANGUAGE_ID,new bt(c))),o.push(e.languages.registerFoldingRangeProvider(n.LANGUAGE_ID,new wt(c))),o.push(e.languages.registerDefinitionProvider(n.LANGUAGE_ID,new yt(c))),o.push(e.languages.registerRenameProvider(n.LANGUAGE_ID,new vt(c))),o.push(e.languages.registerReferenceProvider(n.LANGUAGE_ID,new mt(c))),t.languageSettings.enableHover&&o.push(e.languages.registerHoverProvider(n.LANGUAGE_ID,new _t(c))),e.languages.registerDocumentFormattingEditProvider(n.LANGUAGE_ID,new gt(c)),Ot=c,It(c),e.languages.setLanguageConfiguration(n.LANGUAGE_ID,{folding:{offSide:!1,markers:{start:/^\s*[\r\n]/gm,end:/^\s*[\r\n]/gm}},comments:{lineComment:"//",blockComment:null},autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}]}),Ot}}));
|