@kusto/monaco-kusto 11.2.1 → 11.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -4
- package/package.json +1 -1
- package/release/dev/kustoMode.js +23 -12
- package/release/dev/kustoWorker.js +3 -6
- package/release/dev/{main-592671fd.js → main-1587ba64.js} +2 -2
- package/release/dev/monaco.contribution.js +2 -2
- package/release/dev/{schema-43994823.js → schema-a5230652.js} +2 -2
- package/release/esm/kusto.worker.js +3 -6
- package/release/esm/languageFeatures.js +7 -5
- package/release/esm/languageFeatures.utils.d.ts +2 -1
- package/release/esm/languageFeatures.utils.js +13 -5
- package/release/esm/languageServiceManager/kustoLanguageService.js +1 -2
- package/release/esm/{schema-6489c7bc.js → schema-c006895b.js} +1 -1
- package/release/min/kustoMode.js +2 -2
- package/release/min/kustoWorker.js +3 -3
- package/release/min/{main-019ae07e.js → main-75aa3e71.js} +2 -2
- package/release/min/monaco.contribution.js +2 -2
- package/release/min/{schema-cbe966b9.js → schema-192b3175.js} +2 -2
package/README.md
CHANGED
|
@@ -85,19 +85,27 @@ Every PR should come with a test that checks it.
|
|
|
85
85
|
|
|
86
86
|
## Changelog
|
|
87
87
|
|
|
88
|
+
### 11.4.0
|
|
89
|
+
|
|
90
|
+
- feat: IntelliSense completion items now maintain the original order from the language service, with the most relevant option automatically focused based on the user's input.
|
|
91
|
+
|
|
92
|
+
### 11.3.0
|
|
93
|
+
|
|
94
|
+
- fix: Exclude punctuation-only syntax from completion items.
|
|
95
|
+
|
|
88
96
|
### 11.2.1
|
|
89
97
|
|
|
90
|
-
- feat:
|
|
98
|
+
- feat: Upgrade language-service-next to 11.6.1.
|
|
91
99
|
|
|
92
100
|
- ### 11.2.0
|
|
93
101
|
|
|
94
|
-
- feat:
|
|
95
|
-
- feat:
|
|
102
|
+
- feat: Fix bugs related to last version upgrade.
|
|
103
|
+
- feat: Upgrade language-service-next to 11.6.0.
|
|
96
104
|
|
|
97
105
|
### 11.1.0
|
|
98
106
|
|
|
99
107
|
- feat: Modify the ordering of completion items so that columns always appear at the top.
|
|
100
|
-
- feat:
|
|
108
|
+
- feat: Upgrade language-service-next to 11.5.6.
|
|
101
109
|
|
|
102
110
|
### 11.0.0
|
|
103
111
|
|
package/package.json
CHANGED
package/release/dev/kustoMode.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 11.
|
|
3
|
+
* monaco-kusto version: 11.4.0(7572339ea10d5d0fdd55c4a2b813f3663acab903)
|
|
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/kustoMode', ['exports', 'vs/editor/editor.main', './main-
|
|
8
|
+
define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './main-1587ba64'], (function (exports, monaco, main) { 'use strict';
|
|
9
9
|
|
|
10
10
|
function _interopNamespaceDefault(e) {
|
|
11
11
|
var n = Object.create(null);
|
|
@@ -709,11 +709,20 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
|
|
|
709
709
|
};
|
|
710
710
|
};
|
|
711
711
|
|
|
712
|
-
function createCompletionFilteredText(
|
|
713
|
-
if (!
|
|
714
|
-
var containedInFilterText = completionItem.filterText.toLowerCase().includes(
|
|
715
|
-
|
|
716
|
-
return
|
|
712
|
+
function createCompletionFilteredText(userInput, completionItem) {
|
|
713
|
+
if (!userInput) return completionItem.filterText;
|
|
714
|
+
var containedInFilterText = completionItem.filterText.toLowerCase().includes(userInput.toLowerCase());
|
|
715
|
+
if (!containedInFilterText) return completionItem.filterText;
|
|
716
|
+
return "".concat(userInput).concat(completionItem.filterText);
|
|
717
|
+
}
|
|
718
|
+
function getFocusedItem(completionItems, userInput) {
|
|
719
|
+
var firstCompletionItem = completionItems[0];
|
|
720
|
+
if (!userInput) return firstCompletionItem;
|
|
721
|
+
var firstMatchingItem = completionItems.find(function (item) {
|
|
722
|
+
var _item$filterText;
|
|
723
|
+
return (_item$filterText = item.filterText) === null || _item$filterText === void 0 ? void 0 : _item$filterText.toLowerCase().startsWith(userInput.toLowerCase());
|
|
724
|
+
});
|
|
725
|
+
return firstMatchingItem !== null && firstMatchingItem !== void 0 ? firstMatchingItem : firstCompletionItem;
|
|
717
726
|
}
|
|
718
727
|
|
|
719
728
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
@@ -1572,24 +1581,26 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
|
|
|
1572
1581
|
var wordInfo = model.getWordUntilPosition(position);
|
|
1573
1582
|
var wordRange = new monaco__namespace.Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
|
|
1574
1583
|
var resource = model.uri;
|
|
1575
|
-
var
|
|
1584
|
+
var userInput = model === null || model === void 0 || (_model$getWordAtPosit = model.getWordAtPosition(position)) === null || _model$getWordAtPosit === void 0 ? void 0 : _model$getWordAtPosit.word;
|
|
1576
1585
|
var onDidProvideCompletionItems = this.languageSettings.onDidProvideCompletionItems;
|
|
1577
|
-
return this.completionCacheManager.getCompletionItems(
|
|
1586
|
+
return this.completionCacheManager.getCompletionItems(userInput, resource, fromPosition(position)).then(function (info) {
|
|
1578
1587
|
return onDidProvideCompletionItems ? onDidProvideCompletionItems(info) : info;
|
|
1579
1588
|
}).then(function (info) {
|
|
1580
1589
|
if (!info) return;
|
|
1581
|
-
var
|
|
1590
|
+
var selectedItem = getFocusedItem(info.items, userInput);
|
|
1591
|
+
var items = info.items.map(function (entry, index) {
|
|
1582
1592
|
var _entry$documentation;
|
|
1583
1593
|
var item = {
|
|
1584
1594
|
label: entry.label,
|
|
1585
1595
|
insertText: entry.insertText,
|
|
1586
1596
|
sortText: entry.sortText,
|
|
1587
|
-
filterText: createCompletionFilteredText(
|
|
1597
|
+
filterText: createCompletionFilteredText(userInput, entry),
|
|
1588
1598
|
// TODO: Is this cast safe?
|
|
1589
1599
|
documentation: _this7.formatDocLink((_entry$documentation = entry.documentation) === null || _entry$documentation === void 0 ? void 0 : _entry$documentation.value),
|
|
1590
1600
|
detail: entry.detail,
|
|
1591
1601
|
range: wordRange,
|
|
1592
|
-
kind: toCompletionItemKind(entry.kind)
|
|
1602
|
+
kind: toCompletionItemKind(entry.kind),
|
|
1603
|
+
preselect: selectedItem.filterText === entry.filterText
|
|
1593
1604
|
};
|
|
1594
1605
|
if (entry.textEdit) {
|
|
1595
1606
|
// TODO: Where is the "range" property coming from?
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 11.
|
|
3
|
+
* monaco-kusto version: 11.4.0(7572339ea10d5d0fdd55c4a2b813f3663acab903)
|
|
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-1587ba64', './schema-a5230652'], (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."); }
|
|
@@ -3666,7 +3666,7 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-592671fd', './schema
|
|
|
3666
3666
|
value: function configure(languageSettings) {
|
|
3667
3667
|
this._languageSettings = languageSettings;
|
|
3668
3668
|
var includeExtendedSyntax = this._languageSettings.completionOptions.includeExtendedSyntax;
|
|
3669
|
-
this._completionOptions = Kusto.Language.Editor.CompletionOptions.Default.WithIncludeExtendedSyntax(includeExtendedSyntax);
|
|
3669
|
+
this._completionOptions = Kusto.Language.Editor.CompletionOptions.Default.WithIncludeExtendedSyntax(includeExtendedSyntax).WithIncludePunctuationOnlySyntax(false);
|
|
3670
3670
|
|
|
3671
3671
|
// Since we're still reverting to V1 intellisense for control commands, we need to update the rules provider
|
|
3672
3672
|
// (which is a notion of V1 intellisense).
|
|
@@ -3773,9 +3773,6 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-592671fd', './schema
|
|
|
3773
3773
|
value: _this.formatHelpTopic(helpTopic),
|
|
3774
3774
|
kind: main.MarkupKind.Markdown
|
|
3775
3775
|
} : undefined;
|
|
3776
|
-
lsItem.data = {
|
|
3777
|
-
forcePrecedence: kItem.Kind === k2.CompletionKind.Column
|
|
3778
|
-
};
|
|
3779
3776
|
return lsItem;
|
|
3780
3777
|
});
|
|
3781
3778
|
return Promise.resolve(main.CompletionList.create(items));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 11.
|
|
3
|
+
* monaco-kusto version: 11.4.0(7572339ea10d5d0fdd55c4a2b813f3663acab903)
|
|
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-1587ba64', ['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: 11.
|
|
3
|
+
* monaco-kusto version: 11.4.0(7572339ea10d5d0fdd55c4a2b813f3663acab903)
|
|
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', './schema-
|
|
8
|
+
define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/editor/editor.main', './schema-a5230652'], (function (require, exports, monaco, schema) { 'use strict';
|
|
9
9
|
|
|
10
10
|
function _interopNamespaceDefault(e) {
|
|
11
11
|
var n = Object.create(null);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 11.
|
|
3
|
+
* monaco-kusto version: 11.4.0(7572339ea10d5d0fdd55c4a2b813f3663acab903)
|
|
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-a5230652', ['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,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 11.
|
|
3
|
+
* monaco-kusto version: 11.4.0(7572339ea10d5d0fdd55c4a2b813f3663acab903)
|
|
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 { d as getEntityDataTypeFromCslType, a as getCallName, b as getExpression, g as getCslTypeNameFromClrType } from './schema-
|
|
11
|
+
import { d as getEntityDataTypeFromCslType, a as getCallName, b as getExpression, g as getCslTypeNameFromClrType } from './schema-c006895b.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';
|
|
@@ -206,7 +206,7 @@ class KustoLanguageService {
|
|
|
206
206
|
const {
|
|
207
207
|
includeExtendedSyntax
|
|
208
208
|
} = this._languageSettings.completionOptions;
|
|
209
|
-
this._completionOptions = Kusto.Language.Editor.CompletionOptions.Default.WithIncludeExtendedSyntax(includeExtendedSyntax);
|
|
209
|
+
this._completionOptions = Kusto.Language.Editor.CompletionOptions.Default.WithIncludeExtendedSyntax(includeExtendedSyntax).WithIncludePunctuationOnlySyntax(false);
|
|
210
210
|
|
|
211
211
|
// Since we're still reverting to V1 intellisense for control commands, we need to update the rules provider
|
|
212
212
|
// (which is a notion of V1 intellisense).
|
|
@@ -312,9 +312,6 @@ class KustoLanguageService {
|
|
|
312
312
|
value: this.formatHelpTopic(helpTopic),
|
|
313
313
|
kind: ls.MarkupKind.Markdown
|
|
314
314
|
} : undefined;
|
|
315
|
-
lsItem.data = {
|
|
316
|
-
forcePrecedence: kItem.Kind === k2.CompletionKind.Column
|
|
317
|
-
};
|
|
318
315
|
return lsItem;
|
|
319
316
|
});
|
|
320
317
|
return Promise.resolve(ls.CompletionList.create(items));
|
|
@@ -47,7 +47,7 @@ import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
|
47
47
|
import * as ls from 'vscode-languageserver-types';
|
|
48
48
|
import debounce from 'lodash-es/debounce';
|
|
49
49
|
import { createCompletionCacheManager } from './completionCacheManager/completionCacheManager';
|
|
50
|
-
import { createCompletionFilteredText } from './languageFeatures.utils';
|
|
50
|
+
import { createCompletionFilteredText, getFocusedItem } from './languageFeatures.utils';
|
|
51
51
|
var DiagnosticsAdapter = /** @class */ (function () {
|
|
52
52
|
function DiagnosticsAdapter(_monacoInstance, _languageId, _worker, defaults, onSchemaChange) {
|
|
53
53
|
var _this = this;
|
|
@@ -762,26 +762,28 @@ var CompletionAdapter = /** @class */ (function () {
|
|
|
762
762
|
var wordInfo = model.getWordUntilPosition(position);
|
|
763
763
|
var wordRange = new monaco.Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
|
|
764
764
|
var resource = model.uri;
|
|
765
|
-
var
|
|
765
|
+
var userInput = (_a = model === null || model === void 0 ? void 0 : model.getWordAtPosition(position)) === null || _a === void 0 ? void 0 : _a.word;
|
|
766
766
|
var onDidProvideCompletionItems = this.languageSettings.onDidProvideCompletionItems;
|
|
767
767
|
return this.completionCacheManager
|
|
768
|
-
.getCompletionItems(
|
|
768
|
+
.getCompletionItems(userInput, resource, fromPosition(position))
|
|
769
769
|
.then(function (info) { return (onDidProvideCompletionItems ? onDidProvideCompletionItems(info) : info); })
|
|
770
770
|
.then(function (info) {
|
|
771
771
|
if (!info)
|
|
772
772
|
return;
|
|
773
|
-
var
|
|
773
|
+
var selectedItem = getFocusedItem(info.items, userInput);
|
|
774
|
+
var items = info.items.map(function (entry, index) {
|
|
774
775
|
var _a;
|
|
775
776
|
var item = {
|
|
776
777
|
label: entry.label,
|
|
777
778
|
insertText: entry.insertText,
|
|
778
779
|
sortText: entry.sortText,
|
|
779
|
-
filterText: createCompletionFilteredText(
|
|
780
|
+
filterText: createCompletionFilteredText(userInput, entry),
|
|
780
781
|
// TODO: Is this cast safe?
|
|
781
782
|
documentation: _this.formatDocLink((_a = entry.documentation) === null || _a === void 0 ? void 0 : _a.value),
|
|
782
783
|
detail: entry.detail,
|
|
783
784
|
range: wordRange,
|
|
784
785
|
kind: toCompletionItemKind(entry.kind),
|
|
786
|
+
preselect: selectedItem.filterText === entry.filterText,
|
|
785
787
|
};
|
|
786
788
|
if (entry.textEdit) {
|
|
787
789
|
// TODO: Where is the "range" property coming from?
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import * as ls from 'vscode-languageserver-types';
|
|
2
|
-
export declare function createCompletionFilteredText(
|
|
2
|
+
export declare function createCompletionFilteredText(userInput: string | undefined, completionItem: ls.CompletionItem): string;
|
|
3
|
+
export declare function getFocusedItem(completionItems: ls.CompletionItem[], userInput: string): ls.CompletionItem;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
export function createCompletionFilteredText(
|
|
2
|
-
if (!
|
|
1
|
+
export function createCompletionFilteredText(userInput, completionItem) {
|
|
2
|
+
if (!userInput)
|
|
3
3
|
return completionItem.filterText;
|
|
4
|
-
var containedInFilterText = completionItem.filterText.toLowerCase().includes(
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
var containedInFilterText = completionItem.filterText.toLowerCase().includes(userInput.toLowerCase());
|
|
5
|
+
if (!containedInFilterText)
|
|
6
|
+
return completionItem.filterText;
|
|
7
|
+
return "".concat(userInput).concat(completionItem.filterText);
|
|
8
|
+
}
|
|
9
|
+
export function getFocusedItem(completionItems, userInput) {
|
|
10
|
+
var firstCompletionItem = completionItems[0];
|
|
11
|
+
if (!userInput)
|
|
12
|
+
return firstCompletionItem;
|
|
13
|
+
var firstMatchingItem = completionItems.find(function (item) { var _a; return (_a = item.filterText) === null || _a === void 0 ? void 0 : _a.toLowerCase().startsWith(userInput.toLowerCase()); });
|
|
14
|
+
return firstMatchingItem !== null && firstMatchingItem !== void 0 ? firstMatchingItem : firstCompletionItem;
|
|
7
15
|
}
|
|
@@ -324,7 +324,7 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
324
324
|
this._languageSettings = languageSettings;
|
|
325
325
|
var includeExtendedSyntax = this._languageSettings.completionOptions.includeExtendedSyntax;
|
|
326
326
|
this._completionOptions =
|
|
327
|
-
Kusto.Language.Editor.CompletionOptions.Default.WithIncludeExtendedSyntax(includeExtendedSyntax);
|
|
327
|
+
Kusto.Language.Editor.CompletionOptions.Default.WithIncludeExtendedSyntax(includeExtendedSyntax).WithIncludePunctuationOnlySyntax(false);
|
|
328
328
|
// Since we're still reverting to V1 intellisense for control commands, we need to update the rules provider
|
|
329
329
|
// (which is a notion of V1 intellisense).
|
|
330
330
|
this.createRulesProvider(this._kustoJsSchema, this._schema.clusterType);
|
|
@@ -421,7 +421,6 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
421
421
|
lsItem.documentation = helpTopic
|
|
422
422
|
? { value: _this.formatHelpTopic(helpTopic), kind: ls.MarkupKind.Markdown }
|
|
423
423
|
: undefined;
|
|
424
|
-
lsItem.data = { forcePrecedence: kItem.Kind === k2.CompletionKind.Column };
|
|
425
424
|
return lsItem;
|
|
426
425
|
});
|
|
427
426
|
return Promise.resolve(ls.CompletionList.create(items));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 11.
|
|
3
|
+
* monaco-kusto version: 11.4.0(7572339ea10d5d0fdd55c4a2b813f3663acab903)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
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: 11.
|
|
3
|
+
* monaco-kusto version: 11.4.0(7572339ea10d5d0fdd55c4a2b813f3663acab903)
|
|
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","./main-019ae07e"],(function(t,e,n){"use strict";function r(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var o=r(e),i=["onDidProvideCompletionItems"];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)}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,c(r.key),r)}}function c(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==a(e)?e:e+""}var s=function(){return t=function t(e,n){var r=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=n,this._worker=null,this._idleCheckInterval=self.setInterval((function(){return r._checkIfIdle()}),3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange((function(){return r._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 n=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,i);return this._client||(this._worker=this._monacoInstance.editor.createWebWorker({moduleId:"vs/language/kusto/kustoWorker",label:"kusto",createData:{languageSettings:n,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,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this._getClient().then((function(e){t=e})).then((function(t){return e._worker.withSyncedResources(r)})).then((function(e){return t}))}}],e&&u(t.prototype,e),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),l={name:"kusto",mimeTypes:["text/kusto"],displayName:"Kusto",defaultToken:"invalid",brackets:[["[","]","delimiter.square"],["(",")","delimiter.parenthesis"]],wordDefinition:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,promotedOperatorCommandTokens:["where","count","extend","join","limit","order","project","project-away","project-rename","project-reorder","project-keep","render","sort","summarize","distinct","take","top","top-nested","top-hitters","union","mv-expand","mv-apply","reduce","evaluate","parse","parse-where","parse-kv","sample","sample-distinct","make-series","getschema","serialize","invoke","as","scan"],operatorCommandTokens:["filter","fork","facet","range","consume","find","search","print","partition","lookup","where","count","extend","join","limit","order","project","project-away","project-rename","project-reorder","project-keep","render","sort","summarize","distinct","take","top","top-nested","top-hitters","union","mv-expand","mv-apply","reduce","evaluate","parse","parse-where","parse-kv","sample","sample-distinct","make-series","getschema","serialize","invoke","as","scan"],keywords:["by","on","contains","notcontains","containscs","notcontainscs","startswith","has","matches","regex","true","false","and","or","typeof","int","string","date","datetime","time","long","real","boolean","bool"],operators:["+","-","*","/",">","<","==","<>","<=",">=","~","!~"],builtinFunctions:["countof","bin","extentid","extract","extractjson","floor","iif","isnull","isnotnull","notnull","isempty","isnotempty","notempty","now","re2","strcat","strlen","toupper","tostring","count","cnt","sum","min","max","avg"],tokenizer:{root:[{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@dqstrings"},{include:"@literals"},{include:"@comments"},[/[;,.]/,"delimiter"],[/[()\[\]]/,"@brackets"],[/[<>=!%&+\-*/|~^]/,"operator"],[/[\w@#\-$]+/,{cases:{"@keywords":"keyword","@promotedOperatorCommandTokens":"operator.sql","@operatorCommandTokens":"keyword","@operators":"operator","@builtinFunctions":"predefined","@default":"identifier"}}]],whitespace:[[/\s+/,"white"]],comments:[["\\/\\/+.*","comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/H'/,{token:"string.quote",bracket:"@open",next:"@string"}],[/h'/,{token:"string.quote",bracket:"@open",next:"@string"}],[/'/,{token:"string.quote",bracket:"@open",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],dqstrings:[[/H"/,{token:"string.quote",bracket:"@open",next:"@dqstring"}],[/h"/,{token:"string.quote",bracket:"@open",next:"@dqstring"}],[/"/,{token:"string.quote",bracket:"@open",next:"@dqstring"}]],dqstring:[[/[^"]+/,"string"],[/""/,"string"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],literals:[[/datetime\(\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}(:\d{2}(\.\d{0,3})?)?)?\)/,"number"],[/time\((\d+(s(ec(onds?)?)?|m(in(utes?)?)?|h(ours?)?|d(ays?)?)|(\s*(('[^']+')|("[^"]+"))\s*))\)/,"number"],[/guid\([\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}\)/,"number"],[/typeof\((int|string|date|datetime|time|long|real|boolean|bool)\)/,"number"]]}};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 d(t){var e=f(t);return null!=t&&("object"==e||"function"==e)}function h(t){return h="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},h(t)}var p="object"==("undefined"==typeof global?"undefined":h(global))&&global&&global.Object===Object&&global;function m(t){return m="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},m(t)}var g="object"==("undefined"==typeof self?"undefined":m(self))&&self&&self.Object===Object&&self,v=p||g||Function("return this")(),y=function(){return v.Date.now()},b=/\s/;var w=/^\s+/;function k(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 _=v.Symbol,S=Object.prototype,x=S.hasOwnProperty,L=S.toString,C=_?_.toStringTag:void 0;var I=Object.prototype.toString;var O="[object Null]",j="[object Undefined]",P=_?_.toStringTag:void 0;function E(t){return null==t?void 0===t?j:O:P&&P in Object(t)?function(t){var e=x.call(t,C),n=t[C];try{t[C]=void 0;var r=!0}catch(t){}var o=L.call(t);return r&&(e?t[C]=n:delete t[C]),o}(t):function(t){return I.call(t)}(t)}function T(t){return T="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(t)}function D(t){return D="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},D(t)}var A="[object Symbol]";function F(t){return"symbol"==D(t)||function(t){return null!=t&&"object"==T(t)}(t)&&E(t)==A}var M=NaN,N=/^[-+]0x[0-9a-f]+$/i,V=/^0b[01]+$/i,K=/^0o[0-7]+$/i,R=parseInt;function W(t){if("number"==typeof t)return t;if(F(t))return M;if(d(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=d(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=k(t);var n=V.test(t);return n||K.test(t)?R(t.slice(2),n?2:8):N.test(t)?M:+t}var q=Math.max,z=Math.min;function G(t,e,n){var r,o,i,a,u,c,s=0,l=!1,f=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){var n=r,i=o;return r=o=void 0,s=e,a=t.apply(i,n)}function m(t){var n=t-c;return void 0===c||n>=e||n<0||f&&t-s>=i}function g(){var t=y();if(m(t))return v(t);u=setTimeout(g,function(t){var n=e-(t-c);return f?z(n,i-(t-s)):n}(t))}function v(t){return u=void 0,h&&r?p(t):(r=o=void 0,a)}function b(){var t=y(),n=m(t);if(r=arguments,o=this,c=t,n){if(void 0===u)return function(t){return s=t,u=setTimeout(g,e),l?p(t):a}(c);if(f)return clearTimeout(u),u=setTimeout(g,e),p(c)}return void 0===u&&(u=setTimeout(g,e)),a}return e=W(e)||0,d(n)&&(l=!!n.leading,i=(f="maxWait"in n)?q(W(n.maxWait)||0,e):i,h="trailing"in n?!!n.trailing:h),b.cancel=function(){void 0!==u&&clearTimeout(u),s=0,r=c=o=u=void 0},b.flush=function(){return void 0===u?a:v(y())},b}function U(t,e){if(!t)return e.filterText;var n=e.filterText.toLowerCase().includes(t.toLowerCase());return e.data.forcePrecedence&&n?"".concat(t).concat(e.filterText):e.filterText}function B(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Y(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},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(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function H(t){return H="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},H(t)}function $(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||Y(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Q(t){return function(t){if(Array.isArray(t))return X(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Y(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 Y(t,e){if(t){if("string"==typeof t)return X(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?X(t,e):void 0}}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}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={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new P(r||[]);return o(a,"_invoke",{value:C(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",m="completed",g={};function v(){}function y(){}function b(){}var w={};s(w,a,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(E([])));_&&_!==n&&r.call(_,a)&&(w=_);var S=b.prototype=v.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function n(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"==H(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function C(e,n,r){var o=d;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=I(u,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var s=f(e,n,r);if("normal"===s.type){if(o=r.done?m:h,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function I(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,I(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}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 j(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 E(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(H(e)+" is not iterable")}return y.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:y,configurable:!0}),y.displayName=s(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"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(S),t},e.awrap=function(t){return{__await:t}},x(L.prototype),s(L.prototype,u,(function(){return this})),e.AsyncIterator=L,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new L(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(S),s(S,c,"Generator"),s(S,a,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=E,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(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.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=r.call(a,"catchLoc"),s=r.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 n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,g):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),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:E(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function Z(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function tt(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Z(i,r,o,a,u,"next",t)}function u(t){Z(i,r,o,a,u,"throw",t)}a(void 0)}))}}function et(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,it(r.key),r)}}function rt(t,e,n){return e&&nt(t.prototype,e),n&&nt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ot(t,e,n){return(e=it(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function it(t){var e=function(t,e){if("object"!=H(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=H(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==H(e)?e:e+""}var at=function(){return rt((function t(e,n,r,i,a){var u=this;et(this,t),ot(this,"_disposables",[]),ot(this,"_contentListener",Object.create(null)),ot(this,"_configurationListener",Object.create(null)),ot(this,"_schemaListener",Object.create(null)),ot(this,"_cursorListener",Object.create(null)),ot(this,"_debouncedValidations",Object.create(null)),this._monacoInstance=e,this._languageId=n,this._worker=r,this.defaults=i;var c,s=function(t){var e=t.getLanguageId(),n=t.uri.toString();if(e===u._languageId){var r=u.getOrCreateDebouncedValidation(t,e);u._contentListener[n]=t.onDidChangeContent((function(t){var e=ut(t);r(e)})),u._configurationListener[n]=u.defaults.onDidChange((function(){self.setTimeout((function(){return u._doValidate(t,e,[])}),0)})),u._schemaListener[n]=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 n=t.getModel(),r=n.getLanguageId();if(r===u._languageId){var o=n.getOffsetAt(e.selection.getPosition());u.getOrCreateDebouncedValidation(n,r)([{start:o,end:o}])}})))},f=function(t){u._monacoInstance.editor.setModelMarkers(t,u._languageId,[]);var e=t.uri.toString(),n=u._contentListener[e];n&&(n.dispose(),delete u._contentListener[e]);var r=u._configurationListener[e];r&&(r.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(o.languages.registerCodeActionProvider(this._languageId,{provideCodeActions:(c=tt(J().mark((function t(e,n,r,o){var i,a,c,s;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.getOffsetAt(n.getStartPosition()),a=e.getOffsetAt(n.getEndPosition()),c=r.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,n,r){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 n in u._debouncedValidations)u._debouncedValidations[n].cancel()}}),this._monacoInstance.editor.getModels().forEach(s),this._monacoInstance.editor.getEditors().forEach(l)}),[{key:"getMonacoCodeActions",value:(t=tt(J().mark((function t(e,n,r,o){var i,a,u,c,s,l,f,d=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(),n,r);case 7:c=t.sent,s=J().mark((function t(){var n,r,a,u,s;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=c[f]).kind.includes("Extract Function")){t.next=3;break}return t.abrupt("return",0);case 3:if("quickfix"!=(a=null!==(n=d.defaults.languageSettings.quickFixCodeActions)&&void 0!==n&&n.find((function(t){return r.kind.includes(t)}))?"quickfix":"custom")||o){t.next=6;break}return t.abrupt("return",{v:void 0});case 6:u=r.changes,s=u.map((function(t){var n,r=e.getPositionAt(t.start),o=e.getPositionAt(t.start+t.deleteLength);return{resource:e.uri,textEdit:{range:{startLineNumber:r.lineNumber,startColumn:r.column,endLineNumber:o.lineNumber,endColumn:o.column},text:null!==(n=t.insertText)&&void 0!==n?n:""}}})),i.push({title:r.title,diagnostics:[],kind:a,edit:{edits:Q(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,n,r,o){return t.apply(this,arguments)})},{key:"getOrCreateDebouncedValidation",value:function(t,e){var n=this,r=t.uri.toString();return this._debouncedValidations[r]||(this._debouncedValidations[r]=G((function(r){return n._doValidate(t,e,r)}),500)),this._debouncedValidations[r]}},{key:"dispose",value:function(){this._disposables.forEach((function(t){return t&&t.dispose()})),this._disposables=[]}},{key:"_doValidate",value:function(t,e,n){var r=this;if(!t.isDisposed()){var i=t.uri,a=t.getVersionId();this._worker(i).then((function(t){return t.doValidation(i.toString(),n)})).then((function(t){if(r._monacoInstance.editor.getModel(i).getVersionId()===a){var n=t.map((function(t){return n="number"==typeof(e=t).code?String(e.code):e.code,{severity:ct(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:n,source:e.source};var e,n})),u=r._monacoInstance.editor.getModel(i),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=r.defaults.languageSettings.syntaxErrorAsMarkDown;if(s&&s.enableSyntaxErrorAsMarkDown){var l=s.header?"**".concat(s.header,"** \n\n"):"",f=s.icon?""):"",d="".concat(f," ").concat(l),h=n.map((function(t){return{range:{startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn},options:{hoverMessage:{value:d+t.message},className:"squiggly-error",zIndex:100,overviewRuler:{color:"rgb(255, 18, 18, 0.7)",position:o.editor.OverviewRulerLane.Right},minimap:{color:"rgb(255, 18, 18, 0.7)",position:o.editor.MinimapPosition.Inline}}}})),p=o.editor.getModelMarkers({owner:e,resource:i});p&&p.length>0&&(c=[],r._monacoInstance.editor.setModelMarkers(u,e,[])),u.deltaDecorations(c,h)}else u.deltaDecorations(c,[]),r._monacoInstance.editor.setModelMarkers(u,e,n)}}})).then(void 0,(function(t){console.error(t)}))}}}]);var t}();function ut(t){return t.changes.map((function(t){return{start:t.rangeOffset,end:t.rangeOffset+t.text.length}}))}function ct(t){switch(t){case n.DiagnosticSeverity.Error:return o.MarkerSeverity.Error;case n.DiagnosticSeverity.Warning:return o.MarkerSeverity.Warning;case n.DiagnosticSeverity.Information:return o.MarkerSeverity.Info;case n.DiagnosticSeverity.Hint:return o.MarkerSeverity.Hint;default:return o.MarkerSeverity.Info}}for(var st={PlainText:0,Comment:1,Punctuation:2,Directive:3,Literal:4,StringLiteral:5,Type:6,Column:7,Table:8,Database:9,Function:10,Parameter:11,Variable:12,Identifier:13,ClientParameter:14,QueryParameter:15,ScalarOperator:16,MathOperator:17,QueryOperator:18,Command:19,Keyword:20,MaterializedView:21,SchemaMember:22,SignatureParameter:23,Option:24},lt={},ft=0,dt=Object.entries(st);ft<dt.length;ft++){var ht=$(dt[ft],2),pt=ht[0],mt=ht[1];lt[mt]=pt}var gt={Column:"C71585",Comment:"008000",Database:"C71585",Function:"0000FF",Identifier:"000000",Keyword:"0000FF",Literal:"B22222",ScalarOperator:"0000FF",MaterializedView:"C71585",MathOperator:"000000",Command:"0000FF",Parameter:"2B91AF",PlainText:"000000",Punctuation:"000000",QueryOperator:"CC3700",QueryParameter:"CC3700",StringLiteral:"B22222",Table:"C71585",Type:"0000FF",Variable:"191970",Directive:"9400D3",ClientParameter:"b5cea8",SchemaMember:"C71585",SignatureParameter:"2B91AF",Option:"000000"},vt={Column:"4ec9b0",Comment:"6A9B34",Database:"c586c0",Function:"dcdcaa",Identifier:"d4d4d4",Keyword:"569cd6",Literal:"ce9178",ScalarOperator:"569cd6",MaterializedView:"c586c0",MathOperator:"d4d4d4",Command:"d4d4d4",Parameter:"2B91AF",PlainText:"d4d4d4",Punctuation:"d4d4d4",QueryOperator:"9cdcfe",QueryParameter:"9cdcfe",StringLiteral:"ce9178",Table:"c586c0",Type:"569cd6",Variable:"d7ba7d",Directive:"b5cea8",ClientParameter:"b5cea8",SchemaMember:"4ec9b0",SignatureParameter:"2B91AF",Option:"d4d4d4"},yt=function(){return rt((function t(e,n,r,o,i){var a,u,c,s=this;et(this,t),ot(this,"_disposables",[]),ot(this,"_contentListener",Object.create(null)),ot(this,"_configurationListener",Object.create(null)),ot(this,"_schemaListener",Object.create(null)),ot(this,"decorations",[]),this._monacoInstance=e,this._languageId=n,this._worker=r,a=document.getElementsByTagName("head")[0],(u=document.createElement("style")).type="text/css",u.media="screen",a.appendChild(u),u.innerHTML=(c=Object.keys(st).map((function(t){return{classification:t,colorLight:gt[t],colorDark:vt[t]}})),c).map((function(t){return".vs .".concat(t.classification," {color: #").concat(t.colorLight,";} .vs-dark .").concat(t.classification," {color: #").concat(t.colorDark,";}")})).join("\n");var l=function(t){var e=t.getLanguageId();if(e===s._languageId){var n=G((function(n){return s._doColorization(t,e,n)}),500);s._contentListener[t.uri.toString()]=t.onDidChangeContent((function(t){var e=ut(t);n(e)})),s._configurationListener[t.uri.toString()]=o.onDidChange((function(){self.setTimeout((function(){return s._doColorization(t,e,[])}),0)})),s._schemaListener[t.uri.toString()]=i((function(){self.setTimeout((function(){return s._doColorization(t,e,[])}),0)}))}},f=function(t){t.deltaDecorations(s.decorations,[]);var e=t.uri.toString(),n=s._contentListener[e];n&&(n.dispose(),delete s._contentListener[e]);var r=s._configurationListener[e];r&&(r.dispose(),delete s._configurationListener[e]);var o=s._configurationListener[e];o&&(o.dispose(),delete s._schemaListener[e])};this._disposables.push(this._monacoInstance.editor.onDidCreateModel(l)),this._disposables.push(this._monacoInstance.editor.onWillDisposeModel(f)),this._disposables.push(this._monacoInstance.editor.onDidChangeModelLanguage((function(t){f(t.model),l(t.model)}))),this._disposables.push({dispose:function(){for(var t in s._contentListener)s._contentListener[t].dispose()}}),this._monacoInstance.editor.getModels().forEach(l)}),[{key:"dispose",value:function(){this._disposables.forEach((function(t){return t&&t.dispose()})),this._disposables=[]}},{key:"_doColorization",value:function(t,e,n){var r=this;if(!t.isDisposed()){var i=t.uri,a=t.getVersionId();this._worker(i).then((function(e){if(!t.isDisposed())return e.doColorization(i.toString(),n)})).then((function(n){if(!t.isDisposed()&&r._monacoInstance.editor.getModel(t.uri).getVersionId()===a){var i=n.map((function(e){var n=e.classifications.map((function(e){return function(t,e){var n=t.getPositionAt(e.start),r=t.getPositionAt(e.start+e.length),i=new o.Range(n.lineNumber,n.column,r.lineNumber,r.column),a=lt[e.kind];return{range:i,options:{inlineClassName:a,stickiness:o.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}}(t,e)})).filter((function(t){return"PlainText"!==t.options.inlineClassName&&"Identifier"!=t.options.inlineClassName})),r=t.getPositionAt(e.absoluteStart).lineNumber,i=t.getPositionAt(e.absoluteEnd);return{decorations:n,firstImpactedLine:r,lastImpactedLine:1==i.column&&i.lineNumber>1?i.lineNumber-1:i.lineNumber}})),u=i.map((function(e){return t.getLinesDecorations(e.firstImpactedLine,e.lastImpactedLine).filter((function(t){return gt[t.options.inlineClassName]})).map((function(t){return t.id}))})).reduce((function(t,e){return t.concat(e)}),[]),c=i.reduce((function(t,e){return t.concat(e.decorations)}),[]);t&&t.getLanguageId()===e&&(r.decorations=t.deltaDecorations(u,c))}})).catch((function(t){setTimeout((function(){throw t}),0)}))}}}])}();function bt(t){if(t)return{character:t.column-1,line:t.lineNumber-1}}function wt(t){if(t)return new o.Range(t.start.line+1,t.start.character+1,t.end.line+1,t.end.character+1)}function kt(t){var e=o.languages.CompletionItemKind;switch(t){case n.CompletionItemKind.Text:return e.Text;case n.CompletionItemKind.Method:return e.Method;case n.CompletionItemKind.Function:return e.Function;case n.CompletionItemKind.Constructor:return e.Constructor;case n.CompletionItemKind.Field:return e.Field;case n.CompletionItemKind.Variable:return e.Variable;case n.CompletionItemKind.Class:return e.Class;case n.CompletionItemKind.Interface:return e.Interface;case n.CompletionItemKind.Module:return e.Module;case n.CompletionItemKind.Property:return e.Property;case n.CompletionItemKind.Unit:return e.Unit;case n.CompletionItemKind.Value:return e.Value;case n.CompletionItemKind.Enum:return e.Enum;case n.CompletionItemKind.Keyword:return e.Keyword;case n.CompletionItemKind.Snippet:return e.Snippet;case n.CompletionItemKind.Color:return e.Color;case n.CompletionItemKind.File:return e.File;case n.CompletionItemKind.Reference:return e.Reference}return e.Property}function _t(t){if(t)return{range:wt(t.range),text:t.newText}}var St=function(){return rt((function t(e,n){et(this,t),this.languageSettings=n;var r=function(){var t=tt(J().mark((function t(n,r){var o;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e(n);case 2:return o=t.sent,t.abrupt("return",o.doComplete(n.toString(),r));case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}();this.completionCacheManager=function(t){var e,n;return{getCompletionItems:function(r,o,i){return(!n||!r||!(null!=r&&r.includes(n)))&&(e=t(o,i)),n=r,e}}}(r)}),[{key:"triggerCharacters",get:function(){return[" ",".","("]}},{key:"provideCompletionItems",value:function(t,e,r,i){var a,u=this,c=t.getWordUntilPosition(e),s=new o.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,d=this.languageSettings.onDidProvideCompletionItems;return this.completionCacheManager.getCompletionItems(f,l,bt(e)).then((function(t){return d?d(t):t})).then((function(t){if(t)return{incomplete:!0,suggestions:t.items.map((function(t){var e,r={label:t.label,insertText:t.insertText,sortText:t.sortText,filterText:U(f,t),documentation:u.formatDocLink(null===(e=t.documentation)||void 0===e?void 0:e.value),detail:t.detail,range:s,kind:kt(t.kind)};return t.textEdit&&(r.range=wt(t.textEdit.range),r.insertText=t.textEdit.newText),t.insertTextFormat===n.InsertTextFormat.Snippet&&(r.insertTextRules=o.languages.CompletionItemInsertTextRule.InsertAsSnippet),r}))}}))}},{key:"formatDocLink",value:function(t){if(t){var e=this.languageSettings,n=e.documentationBaseUrl,r=void 0===n?"https://learn.microsoft.com/azure/data-explorer/kusto/query":n,i=e.documentationSuffix;return{value:t,isTrusted:!0,uris:new Proxy({},{get:function(t,e,n){var a=e.toString().replace(".md","");a.startsWith("https")||(a="".concat(r,"/").concat(a));var u=o.Uri.parse(a);return i&&(u.toString=function(){return a+i}),u}})}}}}])}();function xt(t){return"string"==typeof t?{value:t}:(e=t)&&"object"===H(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 Lt(t){if(t)return Array.isArray(t)?t.map(xt):[xt(t)]}function Ct(t){return{uri:o.Uri.parse(t.uri),range:wt(t.range)}}var It=function(){return rt((function t(e){et(this,t),this._worker=e}),[{key:"provideDefinition",value:function(t,e,n){var r=t.uri;return this._worker(r).then((function(t){return t.findDefinition(r.toString(),bt(e))})).then((function(t){if(t&&0!=t.length)return[Ct(t[0])]}))}}])}(),Ot=function(){return rt((function t(e){et(this,t),this._worker=e}),[{key:"provideReferences",value:function(t,e,n,r){var o=t.uri;return this._worker(o).then((function(t){return t.findReferences(o.toString(),bt(e))})).then((function(t){if(t)return t.map(Ct)}))}}])}();var jt=function(){return rt((function t(e){et(this,t),this._worker=e}),[{key:"provideRenameEdits",value:function(t,e,n,r){var i=t.uri;return this._worker(i).then((function(t){return t.doRename(i.toString(),bt(e),n)})).then((function(t){return function(t){if(t&&t.changes){var e=[];for(var n in t.changes){var r,i=o.Uri.parse(n),a=B(t.changes[n]);try{for(a.s();!(r=a.n()).done;){var u=r.value;e.push({resource:i,textEdit:{range:wt(u.range),text:u.newText},versionId:void 0})}}catch(t){a.e(t)}finally{a.f()}}return{edits:e}}}(t)}))}}])}(),Pt=function(){return rt((function t(e){et(this,t),this._worker=e}),[{key:"provideDocumentFormattingEdits",value:function(t,e,n){var r=t.uri;return this._worker(r).then((function(t){return t.doDocumentFormat(r.toString()).then((function(t){return t.map((function(t){return _t(t)}))}))}))}}])}(),Et=function(){return rt((function t(e){et(this,t),this._worker=e}),[{key:"provideDocumentRangeFormattingEdits",value:function(t,e,n,r){var o=t.uri;return this._worker(o).then((function(t){return t.doRangeFormat(o.toString(),function(t){if(t)return{start:bt(t.getStartPosition()),end:bt(t.getEndPosition())}}(e)).then((function(t){return t.map((function(t){return _t(t)}))}))}))}}])}(),Tt=function(){return rt((function t(e){et(this,t),this._worker=e}),[{key:"provideFoldingRanges",value:function(t,e,n){var r=t.uri;return this._worker(r).then((function(t){return t.doFolding(r.toString()).then((function(t){return t.map((function(t){return function(t){return{start:t.startLine+1,end:t.endLine+1,kind:o.languages.FoldingRangeKind.Region}}(t)}))}))}))}}])}();var Dt,At,Ft=function(){return rt((function t(e){et(this,t),this._worker=e}),[{key:"provideHover",value:function(t,e,n){var r=t.uri;return this._worker(r).then((function(t){return t.doHover(r.toString(),bt(e))})).then((function(t){if(t)return{range:wt(t.range),contents:Lt(t.contents)}}))}}])}();function Mt(t){return Mt="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},Mt(t)}function Nt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Vt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Nt(Object(n),!0).forEach((function(e){Kt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Kt(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=Mt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Mt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Mt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rt(t){return function(t){if(Array.isArray(t))return Wt(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 Wt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wt(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 Wt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function qt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */qt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new P(r||[]);return o(a,"_invoke",{value:C(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",m="completed",g={};function v(){}function y(){}function b(){}var w={};s(w,a,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(E([])));_&&_!==n&&r.call(_,a)&&(w=_);var S=b.prototype=v.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function n(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"==Mt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function C(e,n,r){var o=d;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=I(u,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var s=f(e,n,r);if("normal"===s.type){if(o=r.done?m:h,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function I(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,I(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}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 j(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 E(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Mt(e)+" is not iterable")}return y.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:y,configurable:!0}),y.displayName=s(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"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(S),t},e.awrap=function(t){return{__await:t}},x(L.prototype),s(L.prototype,u,(function(){return this})),e.AsyncIterator=L,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new L(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(S),s(S,c,"Generator"),s(S,a,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=E,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(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.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=r.call(a,"catchLoc"),s=r.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 n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,g):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),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:E(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function zt(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function Gt(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){zt(i,r,o,a,u,"next",t)}function u(t){zt(i,r,o,a,u,"throw",t)}a(void 0)}))}}var Ut=new Promise((function(t,e){At=t}));t.getKustoWorker=function(){return Ut.then((function(){return Dt}))},t.setupMode=function(t,e){var n,r=new o.Emitter,i=[],a=new s(e,t);i.push(a);var u=function(t){for(var e=function(){var t=Gt(qt().mark((function t(e,n){var o;return qt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=n.setSchema(e),t.next=3,o.then((function(){r.fire(e)}));case 3:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return a.getLanguageServiceWorker.apply(a,Rt([t].concat(o))).then((function(t){return Vt(Vt({},t),{},{setSchema:function(n){return e(n,t)},setSchemaFromShowSchema:function(n,r,o,i,a){return Gt(qt().mark((function u(){return qt().wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,t.normalizeSchema(n,r,o).then((function(n){(i||a)&&(n=Vt(Vt({},n),{},{globalScalarParameters:i,globalTabularParameters:a})),e(n,t)}));case 2:case"end":return u.stop()}}),u)})))()}})}))},c="kusto";return i.push(e.languages.registerCompletionItemProvider(c,new St(u,t.languageSettings))),t.languageSettings.useTokenColorization&&(n=e.languages.setMonarchTokensProvider(c,l)),t.onDidChange((function(t){t.languageSettings.useTokenColorization||void 0===n||(n.dispose(),n=void 0),t.languageSettings.useTokenColorization&&null==n&&(n=e.languages.setMonarchTokensProvider(c,l))})),i.push(new at(e,c,u,t,r.event)),i.push(new yt(e,c,u,t,r.event)),i.push(e.languages.registerDocumentRangeFormattingEditProvider(c,new Et(u))),i.push(e.languages.registerFoldingRangeProvider(c,new Tt(u))),i.push(e.languages.registerDefinitionProvider(c,new It(u))),i.push(e.languages.registerRenameProvider(c,new jt(u))),i.push(e.languages.registerReferenceProvider(c,new Ot(u))),t.languageSettings.enableHover&&i.push(e.languages.registerHoverProvider(c,new Ft(u))),e.languages.registerDocumentFormattingEditProvider(c,new Pt(u)),Dt=u,At(u),e.languages.setLanguageConfiguration(c,{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"]}]}),Dt}}));
|
|
7
|
+
define("vs/language/kusto/kustoMode",["exports","vs/editor/editor.main","./main-75aa3e71"],(function(t,e,n){"use strict";function r(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var o=r(e),i=["onDidProvideCompletionItems"];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)}function u(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,c(r.key),r)}}function c(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==a(e)?e:e+""}var s=function(){return t=function t(e,n){var r=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=n,this._worker=null,this._idleCheckInterval=self.setInterval((function(){return r._checkIfIdle()}),3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange((function(){return r._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 n=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(e,i);return this._client||(this._worker=this._monacoInstance.editor.createWebWorker({moduleId:"vs/language/kusto/kustoWorker",label:"kusto",createData:{languageSettings:n,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,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return this._getClient().then((function(e){t=e})).then((function(t){return e._worker.withSyncedResources(r)})).then((function(e){return t}))}}],e&&u(t.prototype,e),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,n}(),l={name:"kusto",mimeTypes:["text/kusto"],displayName:"Kusto",defaultToken:"invalid",brackets:[["[","]","delimiter.square"],["(",")","delimiter.parenthesis"]],wordDefinition:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,promotedOperatorCommandTokens:["where","count","extend","join","limit","order","project","project-away","project-rename","project-reorder","project-keep","render","sort","summarize","distinct","take","top","top-nested","top-hitters","union","mv-expand","mv-apply","reduce","evaluate","parse","parse-where","parse-kv","sample","sample-distinct","make-series","getschema","serialize","invoke","as","scan"],operatorCommandTokens:["filter","fork","facet","range","consume","find","search","print","partition","lookup","where","count","extend","join","limit","order","project","project-away","project-rename","project-reorder","project-keep","render","sort","summarize","distinct","take","top","top-nested","top-hitters","union","mv-expand","mv-apply","reduce","evaluate","parse","parse-where","parse-kv","sample","sample-distinct","make-series","getschema","serialize","invoke","as","scan"],keywords:["by","on","contains","notcontains","containscs","notcontainscs","startswith","has","matches","regex","true","false","and","or","typeof","int","string","date","datetime","time","long","real","boolean","bool"],operators:["+","-","*","/",">","<","==","<>","<=",">=","~","!~"],builtinFunctions:["countof","bin","extentid","extract","extractjson","floor","iif","isnull","isnotnull","notnull","isempty","isnotempty","notempty","now","re2","strcat","strlen","toupper","tostring","count","cnt","sum","min","max","avg"],tokenizer:{root:[{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@dqstrings"},{include:"@literals"},{include:"@comments"},[/[;,.]/,"delimiter"],[/[()\[\]]/,"@brackets"],[/[<>=!%&+\-*/|~^]/,"operator"],[/[\w@#\-$]+/,{cases:{"@keywords":"keyword","@promotedOperatorCommandTokens":"operator.sql","@operatorCommandTokens":"keyword","@operators":"operator","@builtinFunctions":"predefined","@default":"identifier"}}]],whitespace:[[/\s+/,"white"]],comments:[["\\/\\/+.*","comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/H'/,{token:"string.quote",bracket:"@open",next:"@string"}],[/h'/,{token:"string.quote",bracket:"@open",next:"@string"}],[/'/,{token:"string.quote",bracket:"@open",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string.quote",bracket:"@close",next:"@pop"}]],dqstrings:[[/H"/,{token:"string.quote",bracket:"@open",next:"@dqstring"}],[/h"/,{token:"string.quote",bracket:"@open",next:"@dqstring"}],[/"/,{token:"string.quote",bracket:"@open",next:"@dqstring"}]],dqstring:[[/[^"]+/,"string"],[/""/,"string"],[/"/,{token:"string.quote",bracket:"@close",next:"@pop"}]],literals:[[/datetime\(\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}(:\d{2}(\.\d{0,3})?)?)?\)/,"number"],[/time\((\d+(s(ec(onds?)?)?|m(in(utes?)?)?|h(ours?)?|d(ays?)?)|(\s*(('[^']+')|("[^"]+"))\s*))\)/,"number"],[/guid\([\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}\)/,"number"],[/typeof\((int|string|date|datetime|time|long|real|boolean|bool)\)/,"number"]]}};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 d(t){var e=f(t);return null!=t&&("object"==e||"function"==e)}function h(t){return h="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},h(t)}var p="object"==("undefined"==typeof global?"undefined":h(global))&&global&&global.Object===Object&&global;function m(t){return m="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},m(t)}var g="object"==("undefined"==typeof self?"undefined":m(self))&&self&&self.Object===Object&&self,v=p||g||Function("return this")(),y=function(){return v.Date.now()},b=/\s/;var w=/^\s+/;function k(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 _=v.Symbol,S=Object.prototype,x=S.hasOwnProperty,L=S.toString,C=_?_.toStringTag:void 0;var I=Object.prototype.toString;var O="[object Null]",j="[object Undefined]",P=_?_.toStringTag:void 0;function E(t){return null==t?void 0===t?j:O:P&&P in Object(t)?function(t){var e=x.call(t,C),n=t[C];try{t[C]=void 0;var r=!0}catch(t){}var o=L.call(t);return r&&(e?t[C]=n:delete t[C]),o}(t):function(t){return I.call(t)}(t)}function T(t){return T="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(t)}function D(t){return D="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},D(t)}var A="[object Symbol]";function F(t){return"symbol"==D(t)||function(t){return null!=t&&"object"==T(t)}(t)&&E(t)==A}var M=NaN,N=/^[-+]0x[0-9a-f]+$/i,V=/^0b[01]+$/i,K=/^0o[0-7]+$/i,R=parseInt;function W(t){if("number"==typeof t)return t;if(F(t))return M;if(d(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=d(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=k(t);var n=V.test(t);return n||K.test(t)?R(t.slice(2),n?2:8):N.test(t)?M:+t}var q=Math.max,z=Math.min;function G(t,e,n){var r,o,i,a,u,c,s=0,l=!1,f=!1,h=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){var n=r,i=o;return r=o=void 0,s=e,a=t.apply(i,n)}function m(t){var n=t-c;return void 0===c||n>=e||n<0||f&&t-s>=i}function g(){var t=y();if(m(t))return v(t);u=setTimeout(g,function(t){var n=e-(t-c);return f?z(n,i-(t-s)):n}(t))}function v(t){return u=void 0,h&&r?p(t):(r=o=void 0,a)}function b(){var t=y(),n=m(t);if(r=arguments,o=this,c=t,n){if(void 0===u)return function(t){return s=t,u=setTimeout(g,e),l?p(t):a}(c);if(f)return clearTimeout(u),u=setTimeout(g,e),p(c)}return void 0===u&&(u=setTimeout(g,e)),a}return e=W(e)||0,d(n)&&(l=!!n.leading,i=(f="maxWait"in n)?q(W(n.maxWait)||0,e):i,h="trailing"in n?!!n.trailing:h),b.cancel=function(){void 0!==u&&clearTimeout(u),s=0,r=c=o=u=void 0},b.flush=function(){return void 0===u?a:v(y())},b}function U(t,e){return t&&e.filterText.toLowerCase().includes(t.toLowerCase())?"".concat(t).concat(e.filterText):e.filterText}function B(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Y(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},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(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function H(t){return H="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},H(t)}function $(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(t,e)||Y(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Q(t){return function(t){if(Array.isArray(t))return X(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Y(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 Y(t,e){if(t){if("string"==typeof t)return X(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?X(t,e):void 0}}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}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={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new P(r||[]);return o(a,"_invoke",{value:C(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",m="completed",g={};function v(){}function y(){}function b(){}var w={};s(w,a,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(E([])));_&&_!==n&&r.call(_,a)&&(w=_);var S=b.prototype=v.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function n(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"==H(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function C(e,n,r){var o=d;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=I(u,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var s=f(e,n,r);if("normal"===s.type){if(o=r.done?m:h,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function I(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,I(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}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 j(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 E(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(H(e)+" is not iterable")}return y.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:y,configurable:!0}),y.displayName=s(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"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(S),t},e.awrap=function(t){return{__await:t}},x(L.prototype),s(L.prototype,u,(function(){return this})),e.AsyncIterator=L,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new L(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(S),s(S,c,"Generator"),s(S,a,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=E,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(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.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=r.call(a,"catchLoc"),s=r.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 n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,g):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),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:E(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function Z(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function tt(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){Z(i,r,o,a,u,"next",t)}function u(t){Z(i,r,o,a,u,"throw",t)}a(void 0)}))}}function et(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,it(r.key),r)}}function rt(t,e,n){return e&&nt(t.prototype,e),n&&nt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ot(t,e,n){return(e=it(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function it(t){var e=function(t,e){if("object"!=H(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=H(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==H(e)?e:e+""}var at=function(){return rt((function t(e,n,r,i,a){var u=this;et(this,t),ot(this,"_disposables",[]),ot(this,"_contentListener",Object.create(null)),ot(this,"_configurationListener",Object.create(null)),ot(this,"_schemaListener",Object.create(null)),ot(this,"_cursorListener",Object.create(null)),ot(this,"_debouncedValidations",Object.create(null)),this._monacoInstance=e,this._languageId=n,this._worker=r,this.defaults=i;var c,s=function(t){var e=t.getLanguageId(),n=t.uri.toString();if(e===u._languageId){var r=u.getOrCreateDebouncedValidation(t,e);u._contentListener[n]=t.onDidChangeContent((function(t){var e=ut(t);r(e)})),u._configurationListener[n]=u.defaults.onDidChange((function(){self.setTimeout((function(){return u._doValidate(t,e,[])}),0)})),u._schemaListener[n]=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 n=t.getModel(),r=n.getLanguageId();if(r===u._languageId){var o=n.getOffsetAt(e.selection.getPosition());u.getOrCreateDebouncedValidation(n,r)([{start:o,end:o}])}})))},f=function(t){u._monacoInstance.editor.setModelMarkers(t,u._languageId,[]);var e=t.uri.toString(),n=u._contentListener[e];n&&(n.dispose(),delete u._contentListener[e]);var r=u._configurationListener[e];r&&(r.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(o.languages.registerCodeActionProvider(this._languageId,{provideCodeActions:(c=tt(J().mark((function t(e,n,r,o){var i,a,c,s;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.getOffsetAt(n.getStartPosition()),a=e.getOffsetAt(n.getEndPosition()),c=r.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,n,r){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 n in u._debouncedValidations)u._debouncedValidations[n].cancel()}}),this._monacoInstance.editor.getModels().forEach(s),this._monacoInstance.editor.getEditors().forEach(l)}),[{key:"getMonacoCodeActions",value:(t=tt(J().mark((function t(e,n,r,o){var i,a,u,c,s,l,f,d=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(),n,r);case 7:c=t.sent,s=J().mark((function t(){var n,r,a,u,s;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=c[f]).kind.includes("Extract Function")){t.next=3;break}return t.abrupt("return",0);case 3:if("quickfix"!=(a=null!==(n=d.defaults.languageSettings.quickFixCodeActions)&&void 0!==n&&n.find((function(t){return r.kind.includes(t)}))?"quickfix":"custom")||o){t.next=6;break}return t.abrupt("return",{v:void 0});case 6:u=r.changes,s=u.map((function(t){var n,r=e.getPositionAt(t.start),o=e.getPositionAt(t.start+t.deleteLength);return{resource:e.uri,textEdit:{range:{startLineNumber:r.lineNumber,startColumn:r.column,endLineNumber:o.lineNumber,endColumn:o.column},text:null!==(n=t.insertText)&&void 0!==n?n:""}}})),i.push({title:r.title,diagnostics:[],kind:a,edit:{edits:Q(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,n,r,o){return t.apply(this,arguments)})},{key:"getOrCreateDebouncedValidation",value:function(t,e){var n=this,r=t.uri.toString();return this._debouncedValidations[r]||(this._debouncedValidations[r]=G((function(r){return n._doValidate(t,e,r)}),500)),this._debouncedValidations[r]}},{key:"dispose",value:function(){this._disposables.forEach((function(t){return t&&t.dispose()})),this._disposables=[]}},{key:"_doValidate",value:function(t,e,n){var r=this;if(!t.isDisposed()){var i=t.uri,a=t.getVersionId();this._worker(i).then((function(t){return t.doValidation(i.toString(),n)})).then((function(t){if(r._monacoInstance.editor.getModel(i).getVersionId()===a){var n=t.map((function(t){return n="number"==typeof(e=t).code?String(e.code):e.code,{severity:ct(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:n,source:e.source};var e,n})),u=r._monacoInstance.editor.getModel(i),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=r.defaults.languageSettings.syntaxErrorAsMarkDown;if(s&&s.enableSyntaxErrorAsMarkDown){var l=s.header?"**".concat(s.header,"** \n\n"):"",f=s.icon?""):"",d="".concat(f," ").concat(l),h=n.map((function(t){return{range:{startLineNumber:t.startLineNumber,startColumn:t.startColumn,endLineNumber:t.endLineNumber,endColumn:t.endColumn},options:{hoverMessage:{value:d+t.message},className:"squiggly-error",zIndex:100,overviewRuler:{color:"rgb(255, 18, 18, 0.7)",position:o.editor.OverviewRulerLane.Right},minimap:{color:"rgb(255, 18, 18, 0.7)",position:o.editor.MinimapPosition.Inline}}}})),p=o.editor.getModelMarkers({owner:e,resource:i});p&&p.length>0&&(c=[],r._monacoInstance.editor.setModelMarkers(u,e,[])),u.deltaDecorations(c,h)}else u.deltaDecorations(c,[]),r._monacoInstance.editor.setModelMarkers(u,e,n)}}})).then(void 0,(function(t){console.error(t)}))}}}]);var t}();function ut(t){return t.changes.map((function(t){return{start:t.rangeOffset,end:t.rangeOffset+t.text.length}}))}function ct(t){switch(t){case n.DiagnosticSeverity.Error:return o.MarkerSeverity.Error;case n.DiagnosticSeverity.Warning:return o.MarkerSeverity.Warning;case n.DiagnosticSeverity.Information:return o.MarkerSeverity.Info;case n.DiagnosticSeverity.Hint:return o.MarkerSeverity.Hint;default:return o.MarkerSeverity.Info}}for(var st={PlainText:0,Comment:1,Punctuation:2,Directive:3,Literal:4,StringLiteral:5,Type:6,Column:7,Table:8,Database:9,Function:10,Parameter:11,Variable:12,Identifier:13,ClientParameter:14,QueryParameter:15,ScalarOperator:16,MathOperator:17,QueryOperator:18,Command:19,Keyword:20,MaterializedView:21,SchemaMember:22,SignatureParameter:23,Option:24},lt={},ft=0,dt=Object.entries(st);ft<dt.length;ft++){var ht=$(dt[ft],2),pt=ht[0],mt=ht[1];lt[mt]=pt}var gt={Column:"C71585",Comment:"008000",Database:"C71585",Function:"0000FF",Identifier:"000000",Keyword:"0000FF",Literal:"B22222",ScalarOperator:"0000FF",MaterializedView:"C71585",MathOperator:"000000",Command:"0000FF",Parameter:"2B91AF",PlainText:"000000",Punctuation:"000000",QueryOperator:"CC3700",QueryParameter:"CC3700",StringLiteral:"B22222",Table:"C71585",Type:"0000FF",Variable:"191970",Directive:"9400D3",ClientParameter:"b5cea8",SchemaMember:"C71585",SignatureParameter:"2B91AF",Option:"000000"},vt={Column:"4ec9b0",Comment:"6A9B34",Database:"c586c0",Function:"dcdcaa",Identifier:"d4d4d4",Keyword:"569cd6",Literal:"ce9178",ScalarOperator:"569cd6",MaterializedView:"c586c0",MathOperator:"d4d4d4",Command:"d4d4d4",Parameter:"2B91AF",PlainText:"d4d4d4",Punctuation:"d4d4d4",QueryOperator:"9cdcfe",QueryParameter:"9cdcfe",StringLiteral:"ce9178",Table:"c586c0",Type:"569cd6",Variable:"d7ba7d",Directive:"b5cea8",ClientParameter:"b5cea8",SchemaMember:"4ec9b0",SignatureParameter:"2B91AF",Option:"d4d4d4"},yt=function(){return rt((function t(e,n,r,o,i){var a,u,c,s=this;et(this,t),ot(this,"_disposables",[]),ot(this,"_contentListener",Object.create(null)),ot(this,"_configurationListener",Object.create(null)),ot(this,"_schemaListener",Object.create(null)),ot(this,"decorations",[]),this._monacoInstance=e,this._languageId=n,this._worker=r,a=document.getElementsByTagName("head")[0],(u=document.createElement("style")).type="text/css",u.media="screen",a.appendChild(u),u.innerHTML=(c=Object.keys(st).map((function(t){return{classification:t,colorLight:gt[t],colorDark:vt[t]}})),c).map((function(t){return".vs .".concat(t.classification," {color: #").concat(t.colorLight,";} .vs-dark .").concat(t.classification," {color: #").concat(t.colorDark,";}")})).join("\n");var l=function(t){var e=t.getLanguageId();if(e===s._languageId){var n=G((function(n){return s._doColorization(t,e,n)}),500);s._contentListener[t.uri.toString()]=t.onDidChangeContent((function(t){var e=ut(t);n(e)})),s._configurationListener[t.uri.toString()]=o.onDidChange((function(){self.setTimeout((function(){return s._doColorization(t,e,[])}),0)})),s._schemaListener[t.uri.toString()]=i((function(){self.setTimeout((function(){return s._doColorization(t,e,[])}),0)}))}},f=function(t){t.deltaDecorations(s.decorations,[]);var e=t.uri.toString(),n=s._contentListener[e];n&&(n.dispose(),delete s._contentListener[e]);var r=s._configurationListener[e];r&&(r.dispose(),delete s._configurationListener[e]);var o=s._configurationListener[e];o&&(o.dispose(),delete s._schemaListener[e])};this._disposables.push(this._monacoInstance.editor.onDidCreateModel(l)),this._disposables.push(this._monacoInstance.editor.onWillDisposeModel(f)),this._disposables.push(this._monacoInstance.editor.onDidChangeModelLanguage((function(t){f(t.model),l(t.model)}))),this._disposables.push({dispose:function(){for(var t in s._contentListener)s._contentListener[t].dispose()}}),this._monacoInstance.editor.getModels().forEach(l)}),[{key:"dispose",value:function(){this._disposables.forEach((function(t){return t&&t.dispose()})),this._disposables=[]}},{key:"_doColorization",value:function(t,e,n){var r=this;if(!t.isDisposed()){var i=t.uri,a=t.getVersionId();this._worker(i).then((function(e){if(!t.isDisposed())return e.doColorization(i.toString(),n)})).then((function(n){if(!t.isDisposed()&&r._monacoInstance.editor.getModel(t.uri).getVersionId()===a){var i=n.map((function(e){var n=e.classifications.map((function(e){return function(t,e){var n=t.getPositionAt(e.start),r=t.getPositionAt(e.start+e.length),i=new o.Range(n.lineNumber,n.column,r.lineNumber,r.column),a=lt[e.kind];return{range:i,options:{inlineClassName:a,stickiness:o.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges}}}(t,e)})).filter((function(t){return"PlainText"!==t.options.inlineClassName&&"Identifier"!=t.options.inlineClassName})),r=t.getPositionAt(e.absoluteStart).lineNumber,i=t.getPositionAt(e.absoluteEnd);return{decorations:n,firstImpactedLine:r,lastImpactedLine:1==i.column&&i.lineNumber>1?i.lineNumber-1:i.lineNumber}})),u=i.map((function(e){return t.getLinesDecorations(e.firstImpactedLine,e.lastImpactedLine).filter((function(t){return gt[t.options.inlineClassName]})).map((function(t){return t.id}))})).reduce((function(t,e){return t.concat(e)}),[]),c=i.reduce((function(t,e){return t.concat(e.decorations)}),[]);t&&t.getLanguageId()===e&&(r.decorations=t.deltaDecorations(u,c))}})).catch((function(t){setTimeout((function(){throw t}),0)}))}}}])}();function bt(t){if(t)return{character:t.column-1,line:t.lineNumber-1}}function wt(t){if(t)return new o.Range(t.start.line+1,t.start.character+1,t.end.line+1,t.end.character+1)}function kt(t){var e=o.languages.CompletionItemKind;switch(t){case n.CompletionItemKind.Text:return e.Text;case n.CompletionItemKind.Method:return e.Method;case n.CompletionItemKind.Function:return e.Function;case n.CompletionItemKind.Constructor:return e.Constructor;case n.CompletionItemKind.Field:return e.Field;case n.CompletionItemKind.Variable:return e.Variable;case n.CompletionItemKind.Class:return e.Class;case n.CompletionItemKind.Interface:return e.Interface;case n.CompletionItemKind.Module:return e.Module;case n.CompletionItemKind.Property:return e.Property;case n.CompletionItemKind.Unit:return e.Unit;case n.CompletionItemKind.Value:return e.Value;case n.CompletionItemKind.Enum:return e.Enum;case n.CompletionItemKind.Keyword:return e.Keyword;case n.CompletionItemKind.Snippet:return e.Snippet;case n.CompletionItemKind.Color:return e.Color;case n.CompletionItemKind.File:return e.File;case n.CompletionItemKind.Reference:return e.Reference}return e.Property}function _t(t){if(t)return{range:wt(t.range),text:t.newText}}var St=function(){return rt((function t(e,n){et(this,t),this.languageSettings=n;var r=function(){var t=tt(J().mark((function t(n,r){var o;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e(n);case 2:return o=t.sent,t.abrupt("return",o.doComplete(n.toString(),r));case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}();this.completionCacheManager=function(t){var e,n;return{getCompletionItems:function(r,o,i){return(!n||!r||!(null!=r&&r.includes(n)))&&(e=t(o,i)),n=r,e}}}(r)}),[{key:"triggerCharacters",get:function(){return[" ",".","("]}},{key:"provideCompletionItems",value:function(t,e,r,i){var a,u=this,c=t.getWordUntilPosition(e),s=new o.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,d=this.languageSettings.onDidProvideCompletionItems;return this.completionCacheManager.getCompletionItems(f,l,bt(e)).then((function(t){return d?d(t):t})).then((function(t){if(t){var e=function(t,e){var n=t[0];if(!e)return n;var r=t.find((function(t){var n;return null===(n=t.filterText)||void 0===n?void 0:n.toLowerCase().startsWith(e.toLowerCase())}));return null!=r?r:n}(t.items,f);return{incomplete:!0,suggestions:t.items.map((function(t,r){var i,a={label:t.label,insertText:t.insertText,sortText:t.sortText,filterText:U(f,t),documentation:u.formatDocLink(null===(i=t.documentation)||void 0===i?void 0:i.value),detail:t.detail,range:s,kind:kt(t.kind),preselect:e.filterText===t.filterText};return t.textEdit&&(a.range=wt(t.textEdit.range),a.insertText=t.textEdit.newText),t.insertTextFormat===n.InsertTextFormat.Snippet&&(a.insertTextRules=o.languages.CompletionItemInsertTextRule.InsertAsSnippet),a}))}}}))}},{key:"formatDocLink",value:function(t){if(t){var e=this.languageSettings,n=e.documentationBaseUrl,r=void 0===n?"https://learn.microsoft.com/azure/data-explorer/kusto/query":n,i=e.documentationSuffix;return{value:t,isTrusted:!0,uris:new Proxy({},{get:function(t,e,n){var a=e.toString().replace(".md","");a.startsWith("https")||(a="".concat(r,"/").concat(a));var u=o.Uri.parse(a);return i&&(u.toString=function(){return a+i}),u}})}}}}])}();function xt(t){return"string"==typeof t?{value:t}:(e=t)&&"object"===H(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 Lt(t){if(t)return Array.isArray(t)?t.map(xt):[xt(t)]}function Ct(t){return{uri:o.Uri.parse(t.uri),range:wt(t.range)}}var It=function(){return rt((function t(e){et(this,t),this._worker=e}),[{key:"provideDefinition",value:function(t,e,n){var r=t.uri;return this._worker(r).then((function(t){return t.findDefinition(r.toString(),bt(e))})).then((function(t){if(t&&0!=t.length)return[Ct(t[0])]}))}}])}(),Ot=function(){return rt((function t(e){et(this,t),this._worker=e}),[{key:"provideReferences",value:function(t,e,n,r){var o=t.uri;return this._worker(o).then((function(t){return t.findReferences(o.toString(),bt(e))})).then((function(t){if(t)return t.map(Ct)}))}}])}();var jt=function(){return rt((function t(e){et(this,t),this._worker=e}),[{key:"provideRenameEdits",value:function(t,e,n,r){var i=t.uri;return this._worker(i).then((function(t){return t.doRename(i.toString(),bt(e),n)})).then((function(t){return function(t){if(t&&t.changes){var e=[];for(var n in t.changes){var r,i=o.Uri.parse(n),a=B(t.changes[n]);try{for(a.s();!(r=a.n()).done;){var u=r.value;e.push({resource:i,textEdit:{range:wt(u.range),text:u.newText},versionId:void 0})}}catch(t){a.e(t)}finally{a.f()}}return{edits:e}}}(t)}))}}])}(),Pt=function(){return rt((function t(e){et(this,t),this._worker=e}),[{key:"provideDocumentFormattingEdits",value:function(t,e,n){var r=t.uri;return this._worker(r).then((function(t){return t.doDocumentFormat(r.toString()).then((function(t){return t.map((function(t){return _t(t)}))}))}))}}])}(),Et=function(){return rt((function t(e){et(this,t),this._worker=e}),[{key:"provideDocumentRangeFormattingEdits",value:function(t,e,n,r){var o=t.uri;return this._worker(o).then((function(t){return t.doRangeFormat(o.toString(),function(t){if(t)return{start:bt(t.getStartPosition()),end:bt(t.getEndPosition())}}(e)).then((function(t){return t.map((function(t){return _t(t)}))}))}))}}])}(),Tt=function(){return rt((function t(e){et(this,t),this._worker=e}),[{key:"provideFoldingRanges",value:function(t,e,n){var r=t.uri;return this._worker(r).then((function(t){return t.doFolding(r.toString()).then((function(t){return t.map((function(t){return function(t){return{start:t.startLine+1,end:t.endLine+1,kind:o.languages.FoldingRangeKind.Region}}(t)}))}))}))}}])}();var Dt,At,Ft=function(){return rt((function t(e){et(this,t),this._worker=e}),[{key:"provideHover",value:function(t,e,n){var r=t.uri;return this._worker(r).then((function(t){return t.doHover(r.toString(),bt(e))})).then((function(t){if(t)return{range:wt(t.range),contents:Lt(t.contents)}}))}}])}();function Mt(t){return Mt="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},Mt(t)}function Nt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Vt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Nt(Object(n),!0).forEach((function(e){Kt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Kt(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=Mt(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=Mt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Mt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Rt(t){return function(t){if(Array.isArray(t))return Wt(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 Wt(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wt(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 Wt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function qt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */qt=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function l(t,e,n,r){var i=e&&e.prototype instanceof v?e:v,a=Object.create(i.prototype),u=new P(r||[]);return o(a,"_invoke",{value:C(t,n,u)}),a}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var d="suspendedStart",h="suspendedYield",p="executing",m="completed",g={};function v(){}function y(){}function b(){}var w={};s(w,a,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(E([])));_&&_!==n&&r.call(_,a)&&(w=_);var S=b.prototype=v.prototype=Object.create(w);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function n(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"==Mt(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return i=i?i.then(o,o):o()}})}function C(e,n,r){var o=d;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:t,done:!0}}for(r.method=i,r.arg=a;;){var u=r.delegate;if(u){var c=I(u,r);if(c){if(c===g)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===d)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var s=f(e,n,r);if("normal"===s.type){if(o=r.done?m:h,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function I(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,I(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}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 j(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 E(e){if(e||""===e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}throw new TypeError(Mt(e)+" is not iterable")}return y.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:y,configurable:!0}),y.displayName=s(b,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"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(S),t},e.awrap=function(t){return{__await:t}},x(L.prototype),s(L.prototype,u,(function(){return this})),e.AsyncIterator=L,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new L(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(S),s(S,c,"Generator"),s(S,a,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=E,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(j),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function o(r,o){return u.type="throw",u.arg=e,n.next=r,o&&(n.method="next",n.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=r.call(a,"catchLoc"),s=r.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 n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.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,g):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),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),j(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:E(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}function zt(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function Gt(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){zt(i,r,o,a,u,"next",t)}function u(t){zt(i,r,o,a,u,"throw",t)}a(void 0)}))}}var Ut=new Promise((function(t,e){At=t}));t.getKustoWorker=function(){return Ut.then((function(){return Dt}))},t.setupMode=function(t,e){var n,r=new o.Emitter,i=[],a=new s(e,t);i.push(a);var u=function(t){for(var e=function(){var t=Gt(qt().mark((function t(e,n){var o;return qt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=n.setSchema(e),t.next=3,o.then((function(){r.fire(e)}));case 3:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return a.getLanguageServiceWorker.apply(a,Rt([t].concat(o))).then((function(t){return Vt(Vt({},t),{},{setSchema:function(n){return e(n,t)},setSchemaFromShowSchema:function(n,r,o,i,a){return Gt(qt().mark((function u(){return qt().wrap((function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,t.normalizeSchema(n,r,o).then((function(n){(i||a)&&(n=Vt(Vt({},n),{},{globalScalarParameters:i,globalTabularParameters:a})),e(n,t)}));case 2:case"end":return u.stop()}}),u)})))()}})}))},c="kusto";return i.push(e.languages.registerCompletionItemProvider(c,new St(u,t.languageSettings))),t.languageSettings.useTokenColorization&&(n=e.languages.setMonarchTokensProvider(c,l)),t.onDidChange((function(t){t.languageSettings.useTokenColorization||void 0===n||(n.dispose(),n=void 0),t.languageSettings.useTokenColorization&&null==n&&(n=e.languages.setMonarchTokensProvider(c,l))})),i.push(new at(e,c,u,t,r.event)),i.push(new yt(e,c,u,t,r.event)),i.push(e.languages.registerDocumentRangeFormattingEditProvider(c,new Et(u))),i.push(e.languages.registerFoldingRangeProvider(c,new Tt(u))),i.push(e.languages.registerDefinitionProvider(c,new It(u))),i.push(e.languages.registerRenameProvider(c,new jt(u))),i.push(e.languages.registerReferenceProvider(c,new Ot(u))),t.languageSettings.enableHover&&i.push(e.languages.registerHoverProvider(c,new Ft(u))),e.languages.registerDocumentFormattingEditProvider(c,new Pt(u)),Dt=u,At(u),e.languages.setLanguageConfiguration(c,{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"]}]}),Dt}}));
|