@kusto/monaco-kusto 11.3.0 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +23 -1
  2. package/package.json +3 -1
  3. package/release/dev/globals-0aacfe72.js +46 -0
  4. package/release/dev/kustoMode.js +235 -507
  5. package/release/dev/kustoWorker.js +49 -93
  6. package/release/dev/{main-80b384b2.js → main-b690e47e.js} +2 -2
  7. package/release/dev/monaco.contribution.js +235 -201
  8. package/release/dev/{schema-89d23a07.js → schema-957f5e9b.js} +13 -2
  9. package/release/esm/extendedGlobalApi/getRangeHtml.d.ts +2 -0
  10. package/release/esm/extendedGlobalApi/getRangeHtml.js +11 -0
  11. package/release/esm/extendedGlobalApi/index.d.ts +1 -0
  12. package/release/esm/extendedGlobalApi/index.js +1 -0
  13. package/release/esm/globals-88d92b64.js +40 -0
  14. package/release/esm/globals.d.ts +1 -0
  15. package/release/esm/globals.js +1 -0
  16. package/release/esm/kusto.worker.js +39 -94
  17. package/release/esm/kustoMode.js +39 -29
  18. package/release/esm/kustoWorker.d.ts +2 -5
  19. package/release/esm/kustoWorker.js +2 -5
  20. package/release/esm/languageFeatures.d.ts +0 -13
  21. package/release/esm/languageFeatures.js +7 -304
  22. package/release/esm/languageFeatures.utils.d.ts +2 -1
  23. package/release/esm/languageFeatures.utils.js +13 -5
  24. package/release/esm/languageServiceManager/kustoLanguageService.d.ts +2 -4
  25. package/release/esm/languageServiceManager/kustoLanguageService.js +58 -72
  26. package/release/esm/languageServiceManager/settings.d.ts +0 -2
  27. package/release/esm/monaco.contribution.d.ts +1 -6
  28. package/release/esm/monaco.contribution.js +22 -79
  29. package/release/esm/{schema-aeb83929.js → schema-66580db4.js} +12 -2
  30. package/release/esm/syntaxHighlighting/SemanticTokensProvider.d.ts +18 -0
  31. package/release/esm/syntaxHighlighting/SemanticTokensProvider.js +78 -0
  32. package/release/esm/syntaxHighlighting/kustoMonarchLanguageDefinition.d.ts +2 -0
  33. package/release/esm/syntaxHighlighting/kustoMonarchLanguageDefinition.js +401 -0
  34. package/release/esm/syntaxHighlighting/themes.d.ts +11 -0
  35. package/release/esm/syntaxHighlighting/themes.js +103 -0
  36. package/release/esm/syntaxHighlighting/types.d.ts +41 -0
  37. package/release/esm/syntaxHighlighting/types.js +55 -0
  38. package/release/min/globals-cce7b304.js +7 -0
  39. package/release/min/kustoMode.js +2 -2
  40. package/release/min/kustoWorker.js +4 -4
  41. package/release/min/{main-b6454357.js → main-13659fc4.js} +2 -2
  42. package/release/min/monaco.contribution.js +2 -2
  43. package/release/min/schema-ab3cbb28.js +7 -0
  44. package/release/esm/languageServiceManager/kustoMonarchLanguageDefinition.d.ts +0 -2
  45. package/release/esm/languageServiceManager/kustoMonarchLanguageDefinition.js +0 -211
  46. package/release/min/schema-1c89ac80.js +0 -7
@@ -1,11 +1,11 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 11.3.0(1980c071675308de7c009d1dcaeec2f7be442a6e)
3
+ * monaco-kusto version: 12.0.0(2f1838c12bdb98562467acf51b6fd3e396182e86)
4
4
  * Released under the MIT license
5
5
  * https://https://github.com/Azure/monaco-kusto/blob/master/README.md
6
6
  *-----------------------------------------------------------------------------*/
7
7
 
8
- define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './main-80b384b2'], (function (exports, monaco, main) { 'use strict';
8
+ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './main-b690e47e', './globals-0aacfe72'], (function (exports, monaco, main, globals) { 'use strict';
9
9
 
10
10
  function _interopNamespaceDefault(e) {
11
11
  var n = Object.create(null);
@@ -27,18 +27,18 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
27
27
  var monaco__namespace = /*#__PURE__*/_interopNamespaceDefault(monaco);
28
28
 
29
29
  var _excluded = ["onDidProvideCompletionItems"];
30
- function _typeof$7(o) { "@babel/helpers - typeof"; return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$7(o); }
30
+ function _typeof$8(o) { "@babel/helpers - typeof"; return _typeof$8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$8(o); }
31
31
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
32
32
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
33
- function _classCallCheck$1(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
34
- function _defineProperties$1(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey$2(o.key), o); } }
35
- function _createClass$1(e, r, t) { return r && _defineProperties$1(e.prototype, r), t && _defineProperties$1(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
36
- function _toPropertyKey$2(t) { var i = _toPrimitive$2(t, "string"); return "symbol" == _typeof$7(i) ? i : i + ""; }
37
- function _toPrimitive$2(t, r) { if ("object" != _typeof$7(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof$7(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
33
+ function _classCallCheck$2(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
34
+ function _defineProperties$2(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey$3(o.key), o); } }
35
+ function _createClass$2(e, r, t) { return r && _defineProperties$2(e.prototype, r), t && _defineProperties$2(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
36
+ function _toPropertyKey$3(t) { var i = _toPrimitive$3(t, "string"); return "symbol" == _typeof$8(i) ? i : i + ""; }
37
+ function _toPrimitive$3(t, r) { if ("object" != _typeof$8(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof$8(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
38
38
  var WorkerManager = /*#__PURE__*/function () {
39
39
  function WorkerManager(_monacoInstance, defaults) {
40
40
  var _this = this;
41
- _classCallCheck$1(this, WorkerManager);
41
+ _classCallCheck$2(this, WorkerManager);
42
42
  this._monacoInstance = _monacoInstance;
43
43
  this._defaults = defaults;
44
44
  this._worker = null;
@@ -50,7 +50,7 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
50
50
  return _this._saveStateAndStopWorker();
51
51
  });
52
52
  }
53
- return _createClass$1(WorkerManager, [{
53
+ return _createClass$2(WorkerManager, [{
54
54
  key: "_stopWorker",
55
55
  value: function _stopWorker() {
56
56
  if (this._worker) {
@@ -147,89 +147,7 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
147
147
  }]);
148
148
  }();
149
149
 
150
- var KustoLanguageDefinition = {
151
- name: 'kusto',
152
- mimeTypes: ['text/kusto'],
153
- displayName: 'Kusto',
154
- defaultToken: 'invalid',
155
- brackets: [['[', ']', 'delimiter.square'], ['(', ')', 'delimiter.parenthesis']],
156
- // types are wrong
157
- wordDefinition: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
158
- // .slice() call is for creating a shallow copy of the array since bridge.net shoves a $type property on the array which monaco doesn't like.
159
- // Kusto.Data.IntelliSense.CslCommandParser.PromotedOperatorCommandTokens.slice(0),
160
- 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'],
161
- // Kusto.Data.IntelliSense.CslCommandParser.OperatorCommandTokens.slice(0),
162
- 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'],
163
- 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'],
164
- operators: ['+', '-', '*', '/', '>', '<', '==', '<>', '<=', '>=', '~', '!~'],
165
- 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'],
166
- tokenizer: {
167
- root: [{
168
- include: '@whitespace'
169
- }, {
170
- include: '@numbers'
171
- }, {
172
- include: '@strings'
173
- }, {
174
- include: '@dqstrings'
175
- }, {
176
- include: '@literals'
177
- }, {
178
- include: '@comments'
179
- }, [/[;,.]/, 'delimiter'], [/[()\[\]]/, '@brackets'], [/[<>=!%&+\-*/|~^]/, 'operator'], [/[\w@#\-$]+/, {
180
- cases: {
181
- '@keywords': 'keyword',
182
- '@promotedOperatorCommandTokens': 'operator.sql',
183
- '@operatorCommandTokens': 'keyword',
184
- '@operators': 'operator',
185
- '@builtinFunctions': 'predefined',
186
- '@default': 'identifier'
187
- }
188
- }]],
189
- whitespace: [[/\s+/, 'white']],
190
- comments: [['\\/\\/+.*', 'comment']],
191
- numbers: [[/0[xX][0-9a-fA-F]*/, 'number'], [/[$][+-]*\d*(\.\d*)?/, 'number'], [/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/, 'number']],
192
- strings: [[/H'/, {
193
- token: 'string.quote',
194
- bracket: '@open',
195
- next: '@string'
196
- }], [/h'/, {
197
- token: 'string.quote',
198
- bracket: '@open',
199
- next: '@string'
200
- }], [/'/, {
201
- token: 'string.quote',
202
- bracket: '@open',
203
- next: '@string'
204
- }]],
205
- string: [[/[^']+/, 'string'], [/''/, 'string'], [/'/, {
206
- token: 'string.quote',
207
- bracket: '@close',
208
- next: '@pop'
209
- }]],
210
- dqstrings: [[/H"/, {
211
- token: 'string.quote',
212
- bracket: '@open',
213
- next: '@dqstring'
214
- }], [/h"/, {
215
- token: 'string.quote',
216
- bracket: '@open',
217
- next: '@dqstring'
218
- }], [/"/, {
219
- token: 'string.quote',
220
- bracket: '@open',
221
- next: '@dqstring'
222
- }]],
223
- dqstring: [[/[^"]+/, 'string'], [/""/, 'string'], [/"/, {
224
- token: 'string.quote',
225
- bracket: '@close',
226
- next: '@pop'
227
- }]],
228
- 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']]
229
- }
230
- };
231
-
232
- function _typeof$6(o) { "@babel/helpers - typeof"; return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$6(o); }
150
+ function _typeof$7(o) { "@babel/helpers - typeof"; return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$7(o); }
233
151
  /**
234
152
  * Checks if `value` is the
235
153
  * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
@@ -256,19 +174,19 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
256
174
  * // => false
257
175
  */
258
176
  function isObject(value) {
259
- var type = _typeof$6(value);
177
+ var type = _typeof$7(value);
260
178
  return value != null && (type == 'object' || type == 'function');
261
179
  }
262
180
 
263
- function _typeof$5(o) { "@babel/helpers - typeof"; return _typeof$5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$5(o); }
181
+ function _typeof$6(o) { "@babel/helpers - typeof"; return _typeof$6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$6(o); }
264
182
  /** Detect free variable `global` from Node.js. */
265
- var freeGlobal = (typeof global === "undefined" ? "undefined" : _typeof$5(global)) == 'object' && global && global.Object === Object && global;
183
+ var freeGlobal = (typeof global === "undefined" ? "undefined" : _typeof$6(global)) == 'object' && global && global.Object === Object && global;
266
184
  var freeGlobal$1 = freeGlobal;
267
185
 
268
- function _typeof$4(o) { "@babel/helpers - typeof"; return _typeof$4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$4(o); }
186
+ function _typeof$5(o) { "@babel/helpers - typeof"; return _typeof$5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$5(o); }
269
187
 
270
188
  /** Detect free variable `self`. */
271
- var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof$4(self)) == 'object' && self && self.Object === Object && self;
189
+ var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof$5(self)) == 'object' && self && self.Object === Object && self;
272
190
 
273
191
  /** Used as a reference to the global object. */
274
192
  var root = freeGlobal$1 || freeSelf || Function('return this')();
@@ -413,7 +331,7 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
413
331
  return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
414
332
  }
415
333
 
416
- function _typeof$3(o) { "@babel/helpers - typeof"; return _typeof$3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$3(o); }
334
+ function _typeof$4(o) { "@babel/helpers - typeof"; return _typeof$4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$4(o); }
417
335
  /**
418
336
  * Checks if `value` is object-like. A value is object-like if it's not `null`
419
337
  * and has a `typeof` result of "object".
@@ -439,10 +357,10 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
439
357
  * // => false
440
358
  */
441
359
  function isObjectLike(value) {
442
- return value != null && _typeof$3(value) == 'object';
360
+ return value != null && _typeof$4(value) == 'object';
443
361
  }
444
362
 
445
- function _typeof$2(o) { "@babel/helpers - typeof"; return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$2(o); }
363
+ function _typeof$3(o) { "@babel/helpers - typeof"; return _typeof$3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$3(o); }
446
364
 
447
365
  /** `Object#toString` result references. */
448
366
  var symbolTag = '[object Symbol]';
@@ -465,7 +383,7 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
465
383
  * // => false
466
384
  */
467
385
  function isSymbol(value) {
468
- return _typeof$2(value) == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag;
386
+ return _typeof$3(value) == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag;
469
387
  }
470
388
 
471
389
  /** Used as references for various `Number` constants. */
@@ -709,41 +627,46 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
709
627
  };
710
628
  };
711
629
 
712
- function createCompletionFilteredText(searchWord, completionItem) {
713
- if (!searchWord) return completionItem.filterText;
714
- var containedInFilterText = completionItem.filterText.toLowerCase().includes(searchWord.toLowerCase());
715
- var shouldPrependSearchWord = completionItem.data.forcePrecedence && containedInFilterText;
716
- return shouldPrependSearchWord ? "".concat(searchWord).concat(completionItem.filterText) : completionItem.filterText;
630
+ function createCompletionFilteredText(userInput, completionItem) {
631
+ if (!userInput) return completionItem.filterText;
632
+ var containedInFilterText = completionItem.filterText.toLowerCase().includes(userInput.toLowerCase());
633
+ if (!containedInFilterText) return completionItem.filterText;
634
+ return "".concat(userInput).concat(completionItem.filterText);
635
+ }
636
+ function getFocusedItem(completionItems, userInput) {
637
+ var firstCompletionItem = completionItems[0];
638
+ if (!userInput) return firstCompletionItem;
639
+ var firstMatchingItem = completionItems.find(function (item) {
640
+ var _item$filterText;
641
+ return (_item$filterText = item.filterText) === null || _item$filterText === void 0 ? void 0 : _item$filterText.toLowerCase().startsWith(userInput.toLowerCase());
642
+ });
643
+ return firstMatchingItem !== null && firstMatchingItem !== void 0 ? firstMatchingItem : firstCompletionItem;
717
644
  }
718
645
 
719
646
  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; } } }; }
720
- function _typeof$1(o) { "@babel/helpers - typeof"; return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$1(o); }
721
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$1(r, e) || _nonIterableRest(); }
722
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
723
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
724
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
647
+ function _typeof$2(o) { "@babel/helpers - typeof"; return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$2(o); }
725
648
  function _toConsumableArray$1(r) { return _arrayWithoutHoles$1(r) || _iterableToArray$1(r) || _unsupportedIterableToArray$1(r) || _nonIterableSpread$1(); }
726
649
  function _nonIterableSpread$1() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
727
650
  function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; } }
728
651
  function _iterableToArray$1(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
729
652
  function _arrayWithoutHoles$1(r) { if (Array.isArray(r)) return _arrayLikeToArray$1(r); }
730
653
  function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
731
- function _regeneratorRuntime$1() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime$1 = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof$1(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(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 resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof$1(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(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(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(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), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
732
- function asyncGeneratorStep$1(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
733
- function _asyncToGenerator$1(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep$1(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep$1(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
734
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
735
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey$1(o.key), o); } }
736
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
737
- function _defineProperty$1(e, r, t) { return (r = _toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
738
- function _toPropertyKey$1(t) { var i = _toPrimitive$1(t, "string"); return "symbol" == _typeof$1(i) ? i : i + ""; }
739
- function _toPrimitive$1(t, r) { if ("object" != _typeof$1(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof$1(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
654
+ function _regeneratorRuntime$2() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime$2 = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof$2(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(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 resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof$2(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(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(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(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), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
655
+ function asyncGeneratorStep$2(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
656
+ function _asyncToGenerator$2(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep$2(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep$2(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
657
+ function _classCallCheck$1(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
658
+ function _defineProperties$1(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey$2(o.key), o); } }
659
+ function _createClass$1(e, r, t) { return r && _defineProperties$1(e.prototype, r), t && _defineProperties$1(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
660
+ function _defineProperty$1(e, r, t) { return (r = _toPropertyKey$2(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
661
+ function _toPropertyKey$2(t) { var i = _toPrimitive$2(t, "string"); return "symbol" == _typeof$2(i) ? i : i + ""; }
662
+ function _toPrimitive$2(t, r) { if ("object" != _typeof$2(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof$2(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
740
663
 
741
664
  // --- diagnostics ---
742
665
 
743
666
  var DiagnosticsAdapter = /*#__PURE__*/function () {
744
667
  function DiagnosticsAdapter(_monacoInstance, _languageId, _worker, defaults, onSchemaChange) {
745
668
  var _this = this;
746
- _classCallCheck(this, DiagnosticsAdapter);
669
+ _classCallCheck$1(this, DiagnosticsAdapter);
747
670
  _defineProperty$1(this, "_disposables", []);
748
671
  _defineProperty$1(this, "_contentListener", Object.create(null));
749
672
  _defineProperty$1(this, "_configurationListener", Object.create(null));
@@ -826,9 +749,9 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
826
749
  if (this.defaults.languageSettings.enableQuickFixes) {
827
750
  this._disposables.push(monaco__namespace.languages.registerCodeActionProvider(this._languageId, {
828
751
  provideCodeActions: function () {
829
- var _provideCodeActions = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1().mark(function _callee(model, range, context, _token) {
752
+ var _provideCodeActions = _asyncToGenerator$2( /*#__PURE__*/_regeneratorRuntime$2().mark(function _callee(model, range, context, _token) {
830
753
  var startOffset, endOffset, showQuickFix, actions;
831
- return _regeneratorRuntime$1().wrap(function _callee$(_context) {
754
+ return _regeneratorRuntime$2().wrap(function _callee$(_context) {
832
755
  while (1) switch (_context.prev = _context.next) {
833
756
  case 0:
834
757
  startOffset = model.getOffsetAt(range.getStartPosition());
@@ -878,13 +801,13 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
878
801
  this._monacoInstance.editor.getModels().forEach(onModelAdd);
879
802
  this._monacoInstance.editor.getEditors().forEach(onEditorAdd);
880
803
  }
881
- return _createClass(DiagnosticsAdapter, [{
804
+ return _createClass$1(DiagnosticsAdapter, [{
882
805
  key: "getMonacoCodeActions",
883
806
  value: function () {
884
- var _getMonacoCodeActions = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1().mark(function _callee2(model, startOffset, endOffset, enableQuickFix) {
807
+ var _getMonacoCodeActions = _asyncToGenerator$2( /*#__PURE__*/_regeneratorRuntime$2().mark(function _callee2(model, startOffset, endOffset, enableQuickFix) {
885
808
  var _this2 = this;
886
809
  var actions, worker, resource, codeActions, _loop, _ret, i;
887
- return _regeneratorRuntime$1().wrap(function _callee2$(_context3) {
810
+ return _regeneratorRuntime$2().wrap(function _callee2$(_context3) {
888
811
  while (1) switch (_context3.prev = _context3.next) {
889
812
  case 0:
890
813
  actions = [];
@@ -897,10 +820,10 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
897
820
  return worker.getResultActions(resource.toString(), startOffset, endOffset);
898
821
  case 7:
899
822
  codeActions = _context3.sent;
900
- _loop = /*#__PURE__*/_regeneratorRuntime$1().mark(function _loop() {
823
+ _loop = /*#__PURE__*/_regeneratorRuntime$2().mark(function _loop() {
901
824
  var _this2$defaults$langu;
902
825
  var codeAction, codeActionKind, changes, edits;
903
- return _regeneratorRuntime$1().wrap(function _loop$(_context2) {
826
+ return _regeneratorRuntime$2().wrap(function _loop$(_context2) {
904
827
  while (1) switch (_context2.prev = _context2.next) {
905
828
  case 0:
906
829
  codeAction = codeActions[i];
@@ -1131,329 +1054,7 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1131
1054
  source: diag.source
1132
1055
  };
1133
1056
  }
1134
- /**
1135
- * Copy of Kusto.Language.Editor.ClassificationKind we don't have to depend on it in this file
1136
- */
1137
- var ClassificationKind = {
1138
- PlainText: 0,
1139
- Comment: 1,
1140
- Punctuation: 2,
1141
- Directive: 3,
1142
- Literal: 4,
1143
- StringLiteral: 5,
1144
- Type: 6,
1145
- Column: 7,
1146
- Table: 8,
1147
- Database: 9,
1148
- Function: 10,
1149
- Parameter: 11,
1150
- Variable: 12,
1151
- Identifier: 13,
1152
- ClientParameter: 14,
1153
- QueryParameter: 15,
1154
- ScalarOperator: 16,
1155
- MathOperator: 17,
1156
- QueryOperator: 18,
1157
- Command: 19,
1158
- Keyword: 20,
1159
- MaterializedView: 21,
1160
- SchemaMember: 22,
1161
- SignatureParameter: 23,
1162
- Option: 24
1163
- };
1164
- var ClassificationKindNames = {};
1165
- for (var _i = 0, _Object$entries = Object.entries(ClassificationKind); _i < _Object$entries.length; _i++) {
1166
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
1167
- key = _Object$entries$_i[0],
1168
- value = _Object$entries$_i[1];
1169
- ClassificationKindNames[value] = key;
1170
- }
1171
1057
 
1172
- // commented here is the color definitions are were defined by v1 intellisense terminology:
1173
- // { token: 'comment', foreground: '008000' }, // CommentToken Green
1174
- // { token: 'variable.predefined', foreground: '800080' }, // CalculatedColumnToken Purple
1175
- // { token: 'function', foreground: '0000FF' }, // FunctionNameToken Blue
1176
- // { token: 'operator.sql', foreground: 'FF4500' }, // OperatorToken OrangeRed (now changed to darker color CC3700 because wasn't accessible)
1177
- // { token: 'string', foreground: 'B22222' }, // StringLiteralToken Firebrick
1178
- // { token: 'operator.scss', foreground: '0000FF' }, // SubOperatorToken Blue
1179
- // { token: 'variable', foreground: 'C71585' }, // TableColumnToken MediumVioletRed
1180
- // { token: 'variable.parameter', foreground: '9932CC' }, // TableToken DarkOrchid
1181
- // { token: '', foreground: '000000' }, // UnknownToken, PlainTextToken Black
1182
- // { token: 'type', foreground: '0000FF' }, // DataTypeToken Blue
1183
- // { token: 'tag', foreground: '0000FF' }, // ControlCommandToken Blue
1184
- // { token: 'annotation', foreground: '2B91AF' }, // QueryParametersToken FF2B91AF
1185
- // { token: 'keyword', foreground: '0000FF' }, // CslCommandToken, PluginToken Blue
1186
- // { token: 'number', foreground: '191970' }, // LetVariablesToken MidnightBlue
1187
- // { token: 'annotation', foreground: '9400D3' }, // ClientDirectiveToken DarkViolet
1188
- // { token: 'invalid', background: 'cd3131' },
1189
- var classificationToColorLight = {
1190
- Column: 'C71585',
1191
- Comment: '008000',
1192
- Database: 'C71585',
1193
- Function: '0000FF',
1194
- Identifier: '000000',
1195
- Keyword: '0000FF',
1196
- Literal: 'B22222',
1197
- ScalarOperator: '0000FF',
1198
- MaterializedView: 'C71585',
1199
- MathOperator: '000000',
1200
- Command: '0000FF',
1201
- Parameter: '2B91AF',
1202
- PlainText: '000000',
1203
- Punctuation: '000000',
1204
- QueryOperator: 'CC3700',
1205
- QueryParameter: 'CC3700',
1206
- StringLiteral: 'B22222',
1207
- Table: 'C71585',
1208
- Type: '0000FF',
1209
- Variable: '191970',
1210
- Directive: '9400D3',
1211
- ClientParameter: 'b5cea8',
1212
- SchemaMember: 'C71585',
1213
- SignatureParameter: '2B91AF',
1214
- Option: '000000'
1215
- };
1216
- var classificationToColorDark = {
1217
- Column: '4ec9b0',
1218
- Comment: '6A9B34',
1219
- Database: 'c586c0',
1220
- Function: 'dcdcaa',
1221
- Identifier: 'd4d4d4',
1222
- Keyword: '569cd6',
1223
- Literal: 'ce9178',
1224
- ScalarOperator: '569cd6',
1225
- MaterializedView: 'c586c0',
1226
- MathOperator: 'd4d4d4',
1227
- Command: 'd4d4d4',
1228
- Parameter: '2B91AF',
1229
- PlainText: 'd4d4d4',
1230
- Punctuation: 'd4d4d4',
1231
- QueryOperator: '9cdcfe',
1232
- QueryParameter: '9cdcfe',
1233
- StringLiteral: 'ce9178',
1234
- Table: 'c586c0',
1235
- Type: '569cd6',
1236
- Variable: 'd7ba7d',
1237
- Directive: 'b5cea8',
1238
- ClientParameter: 'b5cea8',
1239
- SchemaMember: '4ec9b0',
1240
- SignatureParameter: '2B91AF',
1241
- Option: 'd4d4d4'
1242
- };
1243
- var ColorizationAdapter = /*#__PURE__*/function () {
1244
- function ColorizationAdapter(_monacoInstance, _languageId, _worker, defaults, onSchemaChange) {
1245
- var _this5 = this;
1246
- _classCallCheck(this, ColorizationAdapter);
1247
- _defineProperty$1(this, "_disposables", []);
1248
- _defineProperty$1(this, "_contentListener", Object.create(null));
1249
- _defineProperty$1(this, "_configurationListener", Object.create(null));
1250
- _defineProperty$1(this, "_schemaListener", Object.create(null));
1251
- _defineProperty$1(this, "decorations", []);
1252
- this._monacoInstance = _monacoInstance;
1253
- this._languageId = _languageId;
1254
- this._worker = _worker;
1255
- injectCss();
1256
- var onModelAdd = function onModelAdd(model) {
1257
- var languageId = model.getLanguageId();
1258
- if (languageId !== _this5._languageId) {
1259
- return;
1260
- }
1261
- var debouncedColorization = debounce(function (intervals) {
1262
- return _this5._doColorization(model, languageId, intervals);
1263
- }, 500);
1264
- _this5._contentListener[model.uri.toString()] = model.onDidChangeContent(function (e) {
1265
- // Changes are represented as a range in doc before change, plus the text that it was replaced with.
1266
- // We are interested in the range _after_ the change (since that's what we need to colorize).
1267
- // following logic calculates that.
1268
- var intervalsToColorize = changeEventToIntervals(e);
1269
- debouncedColorization(intervalsToColorize);
1270
- });
1271
- _this5._configurationListener[model.uri.toString()] = defaults.onDidChange(function () {
1272
- self.setTimeout(function () {
1273
- return _this5._doColorization(model, languageId, []);
1274
- }, 0);
1275
- });
1276
- _this5._schemaListener[model.uri.toString()] = onSchemaChange(function () {
1277
- self.setTimeout(function () {
1278
- return _this5._doColorization(model, languageId, []);
1279
- }, 0);
1280
- });
1281
- };
1282
- var onModelRemoved = function onModelRemoved(model) {
1283
- model.deltaDecorations(_this5.decorations, []);
1284
- var uriStr = model.uri.toString();
1285
- var contentListener = _this5._contentListener[uriStr];
1286
- if (contentListener) {
1287
- contentListener.dispose();
1288
- delete _this5._contentListener[uriStr];
1289
- }
1290
- var configurationListener = _this5._configurationListener[uriStr];
1291
- if (configurationListener) {
1292
- configurationListener.dispose();
1293
- delete _this5._configurationListener[uriStr];
1294
- }
1295
- var schemaListener = _this5._configurationListener[uriStr];
1296
- if (schemaListener) {
1297
- schemaListener.dispose();
1298
- delete _this5._schemaListener[uriStr];
1299
- }
1300
- };
1301
- this._disposables.push(this._monacoInstance.editor.onDidCreateModel(onModelAdd));
1302
- this._disposables.push(this._monacoInstance.editor.onWillDisposeModel(onModelRemoved));
1303
- this._disposables.push(this._monacoInstance.editor.onDidChangeModelLanguage(function (event) {
1304
- onModelRemoved(event.model);
1305
- onModelAdd(event.model);
1306
- }));
1307
- this._disposables.push({
1308
- dispose: function dispose() {
1309
- for (var _key3 in _this5._contentListener) {
1310
- _this5._contentListener[_key3].dispose();
1311
- }
1312
- }
1313
- });
1314
- this._monacoInstance.editor.getModels().forEach(onModelAdd);
1315
- }
1316
- return _createClass(ColorizationAdapter, [{
1317
- key: "dispose",
1318
- value: function dispose() {
1319
- this._disposables.forEach(function (d) {
1320
- return d && d.dispose();
1321
- });
1322
- this._disposables = [];
1323
- }
1324
- }, {
1325
- key: "_doColorization",
1326
- value: function _doColorization(model, languageId, intervals) {
1327
- var _this6 = this;
1328
- if (model.isDisposed()) {
1329
- return;
1330
- }
1331
- var resource = model.uri;
1332
- var versionNumberBeforeColorization = model.getVersionId();
1333
- this._worker(resource).then(function (worker) {
1334
- if (model.isDisposed()) {
1335
- return;
1336
- }
1337
- return worker.doColorization(resource.toString(), intervals);
1338
- }).then(function (colorizationRanges) {
1339
- if (model.isDisposed()) {
1340
- return;
1341
- }
1342
- var newModel = _this6._monacoInstance.editor.getModel(model.uri);
1343
- var versionId = newModel.getVersionId();
1344
-
1345
- // don't colorize an older version of the document.
1346
- if (versionId !== versionNumberBeforeColorization) {
1347
- return;
1348
- }
1349
- var decorationRanges = colorizationRanges.map(function (colorizationRange) {
1350
- var decorations = colorizationRange.classifications.map(function (classification) {
1351
- return toDecoration(model, classification);
1352
- })
1353
- // The following line will prevent things that aren't going to be colorized anyway to get a CSS class.
1354
- // This will prevent the case where the non-semantic colorizer already figured out that a keyword needs
1355
- // to be colorized, but the outdated semantic colorizer still thinks it's a plain text and wants it colored
1356
- // in black.
1357
- .filter(function (d) {
1358
- return d.options.inlineClassName !== 'PlainText' && d.options.inlineClassName != 'Identifier';
1359
- });
1360
- var firstImpactedLine = model.getPositionAt(colorizationRange.absoluteStart).lineNumber;
1361
- var endPosition = model.getPositionAt(colorizationRange.absoluteEnd);
1362
-
1363
- // A token that ends in the first column of the next line is not considered to be part of that line.
1364
- var lastImpactedLine = endPosition.column == 1 && endPosition.lineNumber > 1 ? endPosition.lineNumber - 1 : endPosition.lineNumber;
1365
- return {
1366
- decorations: decorations,
1367
- firstImpactedLine: firstImpactedLine,
1368
- lastImpactedLine: lastImpactedLine
1369
- };
1370
- });
1371
-
1372
- // Compute the previous decorations we want to replace with the new ones.
1373
- var oldDecorations = decorationRanges.map(function (range) {
1374
- return model.getLinesDecorations(range.firstImpactedLine, range.lastImpactedLine).filter(function (d) {
1375
- return classificationToColorLight[d.options.inlineClassName];
1376
- }) // Don't delete any other decorations
1377
- .map(function (d) {
1378
- return d.id;
1379
- });
1380
- }).reduce(function (prev, curr) {
1381
- return prev.concat(curr);
1382
- }, []);
1383
-
1384
- // Flatten decoration groups to an array of decorations
1385
- var newDecorations = decorationRanges.reduce(function (prev, next) {
1386
- return prev.concat(next.decorations);
1387
- }, []);
1388
- if (model && model.getLanguageId() === languageId) {
1389
- _this6.decorations = model.deltaDecorations(oldDecorations, newDecorations);
1390
- }
1391
- }).catch(function (err) {
1392
- // Hack to avoid crashing calling code, while still logging the
1393
- // error. Might be better to just let the error propagate
1394
- // normally, but that would require more investigation.
1395
- setTimeout(function () {
1396
- throw err;
1397
- }, 0);
1398
- });
1399
- }
1400
- }]);
1401
- }();
1402
-
1403
- /**
1404
- * Generates a mapping between ClassificationKind and color.
1405
- */
1406
- function getClassificationColorTriplets() {
1407
- var result = Object.keys(ClassificationKind).map(function (key) {
1408
- return {
1409
- classification: key,
1410
- colorLight: classificationToColorLight[key],
1411
- colorDark: classificationToColorDark[key]
1412
- };
1413
- });
1414
- return result;
1415
- }
1416
-
1417
- /**
1418
- * Returns a string which is a css describing all tokens and their colors.
1419
- * looks a little bit something like this:
1420
- *
1421
- * .vs .Literal {color: '#000000';} .vs-dark .Literal {color: '#FFFFFF';}
1422
- * .vs .Comment {color: '#111111';} .vs-dark .Comment {color: '#EEEEEE';}
1423
- */
1424
- function getCssForClassification() {
1425
- var classificationColorTriplets = getClassificationColorTriplets();
1426
- var cssInnerHtml = classificationColorTriplets.map(function (pair) {
1427
- return ".vs .".concat(pair.classification, " {color: #").concat(pair.colorLight, ";} .vs-dark .").concat(pair.classification, " {color: #").concat(pair.colorDark, ";}");
1428
- }).join('\n');
1429
- return cssInnerHtml;
1430
- }
1431
-
1432
- /**
1433
- * Inject a CSS sheet to the head of document, coloring kusto elements by classification.
1434
- * TODO: make idempotent
1435
- */
1436
- function injectCss() {
1437
- var container = document.getElementsByTagName('head')[0];
1438
- var style = document.createElement('style');
1439
- style.type = 'text/css';
1440
- style.media = 'screen';
1441
- container.appendChild(style);
1442
- style.innerHTML = getCssForClassification();
1443
- }
1444
- function toDecoration(model, classification) {
1445
- var start = model.getPositionAt(classification.start);
1446
- var end = model.getPositionAt(classification.start + classification.length);
1447
- var range = new monaco__namespace.Range(start.lineNumber, start.column, end.lineNumber, end.column);
1448
- var inlineClassName = ClassificationKindNames[classification.kind];
1449
- return {
1450
- range: range,
1451
- options: {
1452
- inlineClassName: inlineClassName,
1453
- stickiness: monaco__namespace.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
1454
- }
1455
- };
1456
- }
1457
1058
  // --- completion ------
1458
1059
 
1459
1060
  function fromPosition(position) {
@@ -1534,12 +1135,12 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1534
1135
  var DEFAULT_DOCS_BASE_URL = 'https://learn.microsoft.com/azure/data-explorer/kusto/query';
1535
1136
  var CompletionAdapter = /*#__PURE__*/function () {
1536
1137
  function CompletionAdapter(workerAccessor, languageSettings) {
1537
- _classCallCheck(this, CompletionAdapter);
1138
+ _classCallCheck$1(this, CompletionAdapter);
1538
1139
  this.languageSettings = languageSettings;
1539
1140
  var getFromLanguageService = /*#__PURE__*/function () {
1540
- var _ref = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1().mark(function _callee3(resource, position) {
1141
+ var _ref = _asyncToGenerator$2( /*#__PURE__*/_regeneratorRuntime$2().mark(function _callee3(resource, position) {
1541
1142
  var worker;
1542
- return _regeneratorRuntime$1().wrap(function _callee3$(_context4) {
1143
+ return _regeneratorRuntime$2().wrap(function _callee3$(_context4) {
1543
1144
  while (1) switch (_context4.prev = _context4.next) {
1544
1145
  case 0:
1545
1146
  _context4.next = 2;
@@ -1559,7 +1160,7 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1559
1160
  }();
1560
1161
  this.completionCacheManager = createCompletionCacheManager(getFromLanguageService);
1561
1162
  }
1562
- return _createClass(CompletionAdapter, [{
1163
+ return _createClass$1(CompletionAdapter, [{
1563
1164
  key: "triggerCharacters",
1564
1165
  get: function get() {
1565
1166
  return [' ', '.', '('];
@@ -1568,28 +1169,30 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1568
1169
  key: "provideCompletionItems",
1569
1170
  value: function provideCompletionItems(model, position, context, token) {
1570
1171
  var _model$getWordAtPosit,
1571
- _this7 = this;
1172
+ _this5 = this;
1572
1173
  var wordInfo = model.getWordUntilPosition(position);
1573
1174
  var wordRange = new monaco__namespace.Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
1574
1175
  var resource = model.uri;
1575
- var word = model === null || model === void 0 || (_model$getWordAtPosit = model.getWordAtPosition(position)) === null || _model$getWordAtPosit === void 0 ? void 0 : _model$getWordAtPosit.word;
1176
+ var userInput = model === null || model === void 0 || (_model$getWordAtPosit = model.getWordAtPosition(position)) === null || _model$getWordAtPosit === void 0 ? void 0 : _model$getWordAtPosit.word;
1576
1177
  var onDidProvideCompletionItems = this.languageSettings.onDidProvideCompletionItems;
1577
- return this.completionCacheManager.getCompletionItems(word, resource, fromPosition(position)).then(function (info) {
1178
+ return this.completionCacheManager.getCompletionItems(userInput, resource, fromPosition(position)).then(function (info) {
1578
1179
  return onDidProvideCompletionItems ? onDidProvideCompletionItems(info) : info;
1579
1180
  }).then(function (info) {
1580
1181
  if (!info) return;
1581
- var items = info.items.map(function (entry) {
1182
+ var selectedItem = getFocusedItem(info.items, userInput);
1183
+ var items = info.items.map(function (entry, index) {
1582
1184
  var _entry$documentation;
1583
1185
  var item = {
1584
1186
  label: entry.label,
1585
1187
  insertText: entry.insertText,
1586
1188
  sortText: entry.sortText,
1587
- filterText: createCompletionFilteredText(word, entry),
1189
+ filterText: createCompletionFilteredText(userInput, entry),
1588
1190
  // TODO: Is this cast safe?
1589
- documentation: _this7.formatDocLink((_entry$documentation = entry.documentation) === null || _entry$documentation === void 0 ? void 0 : _entry$documentation.value),
1191
+ documentation: _this5.formatDocLink((_entry$documentation = entry.documentation) === null || _entry$documentation === void 0 ? void 0 : _entry$documentation.value),
1590
1192
  detail: entry.detail,
1591
1193
  range: wordRange,
1592
- kind: toCompletionItemKind(entry.kind)
1194
+ kind: toCompletionItemKind(entry.kind),
1195
+ preselect: selectedItem.filterText === entry.filterText
1593
1196
  };
1594
1197
  if (entry.textEdit) {
1595
1198
  // TODO: Where is the "range" property coming from?
@@ -1645,7 +1248,7 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1645
1248
  }]);
1646
1249
  }();
1647
1250
  function isMarkupContent(thing) {
1648
- return thing && _typeof$1(thing) === 'object' && typeof thing.kind === 'string';
1251
+ return thing && _typeof$2(thing) === 'object' && typeof thing.kind === 'string';
1649
1252
  }
1650
1253
  function toMarkdownString(entry) {
1651
1254
  if (typeof entry === 'string') {
@@ -1687,10 +1290,10 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1687
1290
  }
1688
1291
  var DefinitionAdapter = /*#__PURE__*/function () {
1689
1292
  function DefinitionAdapter(_worker) {
1690
- _classCallCheck(this, DefinitionAdapter);
1293
+ _classCallCheck$1(this, DefinitionAdapter);
1691
1294
  this._worker = _worker;
1692
1295
  }
1693
- return _createClass(DefinitionAdapter, [{
1296
+ return _createClass$1(DefinitionAdapter, [{
1694
1297
  key: "provideDefinition",
1695
1298
  value: function provideDefinition(model, position, token) {
1696
1299
  var resource = model.uri;
@@ -1710,10 +1313,10 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1710
1313
 
1711
1314
  var ReferenceAdapter = /*#__PURE__*/function () {
1712
1315
  function ReferenceAdapter(_worker) {
1713
- _classCallCheck(this, ReferenceAdapter);
1316
+ _classCallCheck$1(this, ReferenceAdapter);
1714
1317
  this._worker = _worker;
1715
1318
  }
1716
- return _createClass(ReferenceAdapter, [{
1319
+ return _createClass$1(ReferenceAdapter, [{
1717
1320
  key: "provideReferences",
1718
1321
  value: function provideReferences(model, position, context, token) {
1719
1322
  var resource = model.uri;
@@ -1764,10 +1367,10 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1764
1367
  }
1765
1368
  var RenameAdapter = /*#__PURE__*/function () {
1766
1369
  function RenameAdapter(_worker) {
1767
- _classCallCheck(this, RenameAdapter);
1370
+ _classCallCheck$1(this, RenameAdapter);
1768
1371
  this._worker = _worker;
1769
1372
  }
1770
- return _createClass(RenameAdapter, [{
1373
+ return _createClass$1(RenameAdapter, [{
1771
1374
  key: "provideRenameEdits",
1772
1375
  value: function provideRenameEdits(model, position, newName, token) {
1773
1376
  var resource = model.uri;
@@ -1784,10 +1387,10 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1784
1387
 
1785
1388
  var DocumentFormatAdapter = /*#__PURE__*/function () {
1786
1389
  function DocumentFormatAdapter(_worker) {
1787
- _classCallCheck(this, DocumentFormatAdapter);
1390
+ _classCallCheck$1(this, DocumentFormatAdapter);
1788
1391
  this._worker = _worker;
1789
1392
  }
1790
- return _createClass(DocumentFormatAdapter, [{
1393
+ return _createClass$1(DocumentFormatAdapter, [{
1791
1394
  key: "provideDocumentFormattingEdits",
1792
1395
  value: function provideDocumentFormattingEdits(model, options, token) {
1793
1396
  var resource = model.uri;
@@ -1803,10 +1406,10 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1803
1406
  }();
1804
1407
  var FormatAdapter = /*#__PURE__*/function () {
1805
1408
  function FormatAdapter(_worker) {
1806
- _classCallCheck(this, FormatAdapter);
1409
+ _classCallCheck$1(this, FormatAdapter);
1807
1410
  this._worker = _worker;
1808
1411
  }
1809
- return _createClass(FormatAdapter, [{
1412
+ return _createClass$1(FormatAdapter, [{
1810
1413
  key: "provideDocumentRangeFormattingEdits",
1811
1414
  value: function provideDocumentRangeFormattingEdits(model, range, options, token) {
1812
1415
  var resource = model.uri;
@@ -1824,10 +1427,10 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1824
1427
  // --- Folding ---
1825
1428
  var FoldingAdapter = /*#__PURE__*/function () {
1826
1429
  function FoldingAdapter(_worker) {
1827
- _classCallCheck(this, FoldingAdapter);
1430
+ _classCallCheck$1(this, FoldingAdapter);
1828
1431
  this._worker = _worker;
1829
1432
  }
1830
- return _createClass(FoldingAdapter, [{
1433
+ return _createClass$1(FoldingAdapter, [{
1831
1434
  key: "provideFoldingRanges",
1832
1435
  value: function provideFoldingRanges(model, context, token) {
1833
1436
  var resource = model.uri;
@@ -1853,10 +1456,10 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1853
1456
 
1854
1457
  var HoverAdapter = /*#__PURE__*/function () {
1855
1458
  function HoverAdapter(_worker) {
1856
- _classCallCheck(this, HoverAdapter);
1459
+ _classCallCheck$1(this, HoverAdapter);
1857
1460
  this._worker = _worker;
1858
1461
  }
1859
- return _createClass(HoverAdapter, [{
1462
+ return _createClass$1(HoverAdapter, [{
1860
1463
  key: "provideHover",
1861
1464
  value: function provideHover(model, position, token) {
1862
1465
  var resource = model.uri;
@@ -1875,6 +1478,114 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1875
1478
  }]);
1876
1479
  }();
1877
1480
 
1481
+ function _typeof$1(o) { "@babel/helpers - typeof"; return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$1(o); }
1482
+ function _regeneratorRuntime$1() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime$1 = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof$1(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(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 resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof$1(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(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(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(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), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
1483
+ function asyncGeneratorStep$1(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
1484
+ function _asyncToGenerator$1(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep$1(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep$1(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
1485
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
1486
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey$1(o.key), o); } }
1487
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
1488
+ function _toPropertyKey$1(t) { var i = _toPrimitive$1(t, "string"); return "symbol" == _typeof$1(i) ? i : i + ""; }
1489
+ function _toPrimitive$1(t, r) { if ("object" != _typeof$1(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof$1(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1490
+ var SemanticTokensProvider = /*#__PURE__*/function () {
1491
+ function SemanticTokensProvider(classificationsGetter) {
1492
+ _classCallCheck(this, SemanticTokensProvider);
1493
+ this.classificationsGetter = classificationsGetter;
1494
+ }
1495
+ return _createClass(SemanticTokensProvider, [{
1496
+ key: "getLegend",
1497
+ value: function getLegend() {
1498
+ return {
1499
+ tokenTypes: globals.tokenTypes,
1500
+ tokenModifiers: []
1501
+ };
1502
+ }
1503
+ }, {
1504
+ key: "provideDocumentSemanticTokens",
1505
+ value: function () {
1506
+ var _provideDocumentSemanticTokens = _asyncToGenerator$1( /*#__PURE__*/_regeneratorRuntime$1().mark(function _callee(model) {
1507
+ var resource, classifications, semanticTokens;
1508
+ return _regeneratorRuntime$1().wrap(function _callee$(_context) {
1509
+ while (1) switch (_context.prev = _context.next) {
1510
+ case 0:
1511
+ resource = model.uri;
1512
+ _context.next = 3;
1513
+ return this.classificationsGetter(resource);
1514
+ case 3:
1515
+ classifications = _context.sent;
1516
+ semanticTokens = classifications.map(function (classification, index) {
1517
+ var previousClassification = classifications[index - 1];
1518
+ return semanticTokenMaker(classification, previousClassification);
1519
+ });
1520
+ return _context.abrupt("return", {
1521
+ data: new Uint32Array(semanticTokens.flat()),
1522
+ resultId: model.getVersionId().toString()
1523
+ });
1524
+ case 6:
1525
+ case "end":
1526
+ return _context.stop();
1527
+ }
1528
+ }, _callee, this);
1529
+ }));
1530
+ function provideDocumentSemanticTokens(_x) {
1531
+ return _provideDocumentSemanticTokens.apply(this, arguments);
1532
+ }
1533
+ return provideDocumentSemanticTokens;
1534
+ }()
1535
+ }, {
1536
+ key: "releaseDocumentSemanticTokens",
1537
+ value: function releaseDocumentSemanticTokens() {}
1538
+ }]);
1539
+ }();
1540
+ var emptyClassification = {
1541
+ line: 0,
1542
+ character: 0,
1543
+ length: 0,
1544
+ kind: 0
1545
+ };
1546
+ function semanticTokenMaker(classification) {
1547
+ var previousClassification = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : emptyClassification;
1548
+ var line = classification.line,
1549
+ character = classification.character,
1550
+ length = classification.length,
1551
+ kind = classification.kind;
1552
+ var deltaLine = line - previousClassification.line;
1553
+ var deltaStart = deltaLine ? character : character - previousClassification.character;
1554
+ return [deltaLine, deltaStart, length, kind, 0];
1555
+ }
1556
+
1557
+ var queryOperators = ['as', 'consume', 'distinct', 'evaluate', 'extend', 'getschema', 'graph-match', 'graph-merge', 'graph-to-table', 'invoke', 'join', 'limit', 'lookup', 'make-graph', 'make-series', 'mv-apply', 'mv-expand', 'order', 'parse', 'parse-kv', 'parse-where', 'project', 'project-away', 'project-keep', 'project-rename', 'project-reorder', 'range', 'reduce', 'render', 'sample', 'sample-distinct', 'scan', 'serialize', 'sort', 'summarize', 'take', 'top', 'top-hitters', 'top-nested', 'union', 'where', 'filter', 'fork', 'facet', 'range', 'consume', 'find', 'search', 'print', 'partition', 'lookup'];
1558
+ var queryParameters = ['kind'];
1559
+ var types = ['bool', 'datetime', 'decimal', 'double', 'dynamic', 'guid', 'int', 'long', 'real', 'string', 'timespan'];
1560
+ var commands = ['.add', '.alter', '.alter-merge', '.append', '.as', '.assert', '.attach', '.consume', '.count', '.create', '.create-merge', '.create-or-alter', '.create-set', '.datatable', '.default', '.define', '.delete', '.detach', '.distinct', '.drop', '.drop-pretend', '.dup-next-failed-ingest', '.dup-next-ingest', '.evaluate', '.export', '.extend', '.externaldata', '.filter', '.find', '.fork', '.getschema', '.ingest', '.join', '.limit', '.load', '.make-series', '.materialize', '.move', '.mv-expand', '.order', '.parse', '.parse-where', '.partition', '.pivot', '.print', '.project', '.project-away', '.project-keep', '.project-rename', '.reduce', '.remove', '.rename', '.replace', '.restrict', '.run', '.sample', '.sample-distinct', '.save', '.search', '.serialize', '.set', '.set-or-append', '.set-or-replace', '.show', '.sort', '.summarize', '.take', '.top', '.top-hitters', '.top-nested', '.union'];
1561
+ var functions = ['abs', 'acos', 'ago', 'array_concat', 'array_length', 'array_slice', 'array_split', 'asin', 'atan', 'atan2', 'avg', 'bag_keys', 'base64_decodestring', 'base64_encodestring', 'bin', 'bin_at', 'binary_and', 'binary_not', 'binary_or', 'binary_shift_left', 'binary_shift_right', 'binary_xor', 'case', 'ceiling', 'coalesce', 'columnifexists', 'cos', 'count', 'countof', 'cot', 'cursor_after', 'datatable', 'datepart', 'datetime_add', 'datetime_diff', 'datetime_part', 'dayofmonth', 'dayofweek', 'dayofyear', 'dcount', 'dcount_hll', 'degrees', 'endofday', 'endofmonth', 'endofweek', 'endofyear', 'exp', 'exp10', 'exp2', 'extract', 'extractall', 'extractjson', 'format_datetime', 'format_timespan', 'floor', 'gamma', 'geo_distance_2points', 'geo_geohash_to_central_point', 'geo_point_in_circle', 'geo_point_in_polygon', 'geo_point_to_geohash', 'getmonth', 'gettype', 'getyear', 'hash', 'hash_sha256', 'hll_merge', 'iif', 'indexof', 'isempty', 'isfinite', 'isinf', 'isascii', 'isnan', 'isnotempty', 'isnotnull', 'isnull', 'isutf8', 'log', 'log10', 'log2', 'loggamma', 'make_datetime', 'make_string', 'make_timespan', 'materialize', 'max', 'max_of', 'min', 'min_of', 'monthofyear', 'next', 'not', 'pack', 'pack_array', 'pack_dictionary', 'parse_csv', 'parse_ipv4', 'parse_json', 'parse_path', 'parse_url', 'parse_urlquery', 'parse_user_agent', 'parse_version', 'parse_xml', 'parsejson', 'percentrank_tdigest', 'percentile_tdigest', 'pow', 'prev', 'radians', 'rand', 'rank_tdigest', 'repeat', 'replace', 'reverse', 'round', 'row_cumsum', 'row_window_session', 'series_add', 'series_decompose', 'series_decompose_anomalies', 'series_decompose_forecast', 'series_divide', 'series_equals', 'series_fill_backward', 'series_fill_const', 'series_fill_forward', 'series_fill_linear', 'series_fir', 'series_fit_2lines', 'series_fit_2lines_dynamic', 'series_fit_line', 'series_fit_line_dynamic', 'series_greater', 'series_greater_equals', 'series_iir', 'series_less', 'series_less_equals', 'series_multiply', 'series_not_equals', 'series_outliers', 'series_pearson_correlation', 'series_periods_detect', 'series_periods_validate', 'series_seasonal', 'series_stats', 'series_stats_dynamic', 'series_subtract', 'sign', 'sin', 'split', 'sqrt', 'startofday', 'startofmonth', 'startofweek', 'startofyear', 'strcat', 'strcat_array', 'strcat_delim', 'strcmp', 'strlen', 'strrep', 'string_size', 'substring', 'sum', 'tan', 'tdigest_merge', 'tobool', 'toboolean', 'todecimal', 'todouble', 'todynamic', 'tofloat', 'toguid', 'tohex', 'toint', 'tolong', 'tolower', 'toobject', 'toreal', 'toscalar', 'tostring', 'totimespan', 'toupper', 'translate', 'trim', 'trim_end', 'trim_start', 'typeof', 'url_decode', 'url_encode', 'week_of_year', 'welch_test'];
1562
+ var keywords = ['and', 'as', 'asc', 'between', 'by', 'contains', 'count', 'desc', 'extend', 'false', 'filter', 'find', 'from', 'has', 'in', 'inner', 'join', 'leftouter', 'let', 'not', 'on', 'or', 'policy', 'project', 'project-away', 'project-rename', 'project-reorder', 'project-keep', 'range', 'rename', 'retention', 'summarize', 'table', 'take', 'to', 'true', 'where', 'with'];
1563
+ var kustoLanguageDefinition = {
1564
+ name: globals.LANGUAGE_ID,
1565
+ mimeTypes: ['text/kusto'],
1566
+ displayName: 'Kusto',
1567
+ defaultToken: 'invalid',
1568
+ queryOperators: queryOperators,
1569
+ queryParameters: queryParameters,
1570
+ types: types,
1571
+ commands: commands,
1572
+ functions: functions,
1573
+ keywords: keywords,
1574
+ tokenizer: {
1575
+ root: [[/(\/\/.*$)/, globals.Token.Comment], [/[\(\)\{\}\|\[\]\:\=\,\<|\.\..]/, globals.Token.Punctuation], [/[\+\-\*\/\%\!\<\<=\>\>=\=\==\!=\<>\:\;\,\=~\@\?\=>\!~]/, globals.Token.MathOperator], [/"([^"\\]*(\\.[^"\\]*)*)"/, globals.Token.StringLiteral], [/'([^"\\]*(\\.[^"\\]*)*)'/, globals.Token.StringLiteral], [/[\w@#\-$\.]+/, {
1576
+ cases: {
1577
+ '@queryOperators': globals.Token.QueryOperator,
1578
+ '@queryParameters': globals.Token.QueryParameter,
1579
+ '@types': globals.Token.Type,
1580
+ '@commands': globals.Token.Command,
1581
+ '@functions': globals.Token.Function,
1582
+ '@keywords': globals.Token.Keyword,
1583
+ '@default': 'identifier'
1584
+ }
1585
+ }]]
1586
+ }
1587
+ };
1588
+
1878
1589
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1879
1590
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1880
1591
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -1904,7 +1615,6 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1904
1615
  var onSchemaChange = new monaco__namespace.Emitter();
1905
1616
  // TODO: when should we dispose of these? seems like monaco-css and monaco-typescript don't dispose of these.
1906
1617
  var disposables = [];
1907
- var monarchTokensProvider;
1908
1618
  var client = new WorkerManager(monacoInstance, defaults);
1909
1619
  disposables.push(client);
1910
1620
  var workerAccessor = function workerAccessor(first) {
@@ -1963,39 +1673,22 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1963
1673
  });
1964
1674
  });
1965
1675
  };
1966
- var language = 'kusto';
1967
- disposables.push(monacoInstance.languages.registerCompletionItemProvider(language, new CompletionAdapter(workerAccessor, defaults.languageSettings)));
1968
-
1969
- // Monaco tokenization runs in main thread so we're using a quick schema-unaware tokenization.
1970
- // a web worker will run semantic colorization in the background (ColorizationAdapter).
1971
- if (defaults.languageSettings.useTokenColorization) {
1972
- monarchTokensProvider = monacoInstance.languages.setMonarchTokensProvider(language, KustoLanguageDefinition);
1973
- }
1974
-
1975
- // listen to configuration changes and if we're switching from semantic to monarch colorization, do the switch.
1976
- defaults.onDidChange(function (e) {
1977
- if (!e.languageSettings.useTokenColorization && monarchTokensProvider !== undefined) {
1978
- monarchTokensProvider.dispose();
1979
- monarchTokensProvider = undefined;
1980
- }
1981
- if (e.languageSettings.useTokenColorization && monarchTokensProvider == undefined) {
1982
- monarchTokensProvider = monacoInstance.languages.setMonarchTokensProvider(language, KustoLanguageDefinition);
1983
- }
1984
- });
1985
- disposables.push(new DiagnosticsAdapter(monacoInstance, language, workerAccessor, defaults, onSchemaChange.event));
1986
- disposables.push(new ColorizationAdapter(monacoInstance, language, workerAccessor, defaults, onSchemaChange.event));
1987
- disposables.push(monacoInstance.languages.registerDocumentRangeFormattingEditProvider(language, new FormatAdapter(workerAccessor)));
1988
- disposables.push(monacoInstance.languages.registerFoldingRangeProvider(language, new FoldingAdapter(workerAccessor)));
1989
- disposables.push(monacoInstance.languages.registerDefinitionProvider(language, new DefinitionAdapter(workerAccessor)));
1990
- disposables.push(monacoInstance.languages.registerRenameProvider(language, new RenameAdapter(workerAccessor)));
1991
- disposables.push(monacoInstance.languages.registerReferenceProvider(language, new ReferenceAdapter(workerAccessor)));
1676
+ disposables.push(monacoInstance.languages.registerCompletionItemProvider(globals.LANGUAGE_ID, new CompletionAdapter(workerAccessor, defaults.languageSettings)));
1677
+ setMonarchTokensProvider(monacoInstance, disposables);
1678
+ registerDocumentSemanticTokensProvider(workerAccessor, monacoInstance);
1679
+ disposables.push(new DiagnosticsAdapter(monacoInstance, globals.LANGUAGE_ID, workerAccessor, defaults, onSchemaChange.event));
1680
+ disposables.push(monacoInstance.languages.registerDocumentRangeFormattingEditProvider(globals.LANGUAGE_ID, new FormatAdapter(workerAccessor)));
1681
+ disposables.push(monacoInstance.languages.registerFoldingRangeProvider(globals.LANGUAGE_ID, new FoldingAdapter(workerAccessor)));
1682
+ disposables.push(monacoInstance.languages.registerDefinitionProvider(globals.LANGUAGE_ID, new DefinitionAdapter(workerAccessor)));
1683
+ disposables.push(monacoInstance.languages.registerRenameProvider(globals.LANGUAGE_ID, new RenameAdapter(workerAccessor)));
1684
+ disposables.push(monacoInstance.languages.registerReferenceProvider(globals.LANGUAGE_ID, new ReferenceAdapter(workerAccessor)));
1992
1685
  if (defaults.languageSettings.enableHover) {
1993
- disposables.push(monacoInstance.languages.registerHoverProvider(language, new HoverAdapter(workerAccessor)));
1686
+ disposables.push(monacoInstance.languages.registerHoverProvider(globals.LANGUAGE_ID, new HoverAdapter(workerAccessor)));
1994
1687
  }
1995
- monacoInstance.languages.registerDocumentFormattingEditProvider(language, new DocumentFormatAdapter(workerAccessor));
1688
+ monacoInstance.languages.registerDocumentFormattingEditProvider(globals.LANGUAGE_ID, new DocumentFormatAdapter(workerAccessor));
1996
1689
  kustoWorker = workerAccessor;
1997
1690
  resolveWorker(workerAccessor);
1998
- monacoInstance.languages.setLanguageConfiguration(language, {
1691
+ monacoInstance.languages.setLanguageConfiguration(globals.LANGUAGE_ID, {
1999
1692
  folding: {
2000
1693
  offSide: false,
2001
1694
  markers: {
@@ -2034,6 +1727,41 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
2034
1727
  });
2035
1728
  }
2036
1729
 
1730
+ // This function sets the Monarch token provider,
1731
+ // enabling fast syntax highlighting before the language service is called for semantic coloring.
1732
+ function setMonarchTokensProvider(monacoInstance, disposables) {
1733
+ var monarchTokensProvider = monacoInstance.languages.setMonarchTokensProvider(globals.LANGUAGE_ID, kustoLanguageDefinition);
1734
+ disposables.push(monarchTokensProvider);
1735
+ }
1736
+
1737
+ // This function registers a semantic token provider that utilizes the language service
1738
+ // for more context-relevant syntax highlighting.
1739
+ function registerDocumentSemanticTokensProvider(workerAccessor, monacoInstance) {
1740
+ var classificationsGetter = /*#__PURE__*/function () {
1741
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(resource) {
1742
+ var worker;
1743
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1744
+ while (1) switch (_context3.prev = _context3.next) {
1745
+ case 0:
1746
+ _context3.next = 2;
1747
+ return workerAccessor(resource);
1748
+ case 2:
1749
+ worker = _context3.sent;
1750
+ return _context3.abrupt("return", worker.getClassifications(resource.toString()));
1751
+ case 4:
1752
+ case "end":
1753
+ return _context3.stop();
1754
+ }
1755
+ }, _callee3);
1756
+ }));
1757
+ return function classificationsGetter(_x3) {
1758
+ return _ref2.apply(this, arguments);
1759
+ };
1760
+ }();
1761
+ var semanticTokenProvider = new SemanticTokensProvider(classificationsGetter);
1762
+ monacoInstance.languages.registerDocumentSemanticTokensProvider(globals.LANGUAGE_ID, semanticTokenProvider);
1763
+ }
1764
+
2037
1765
  exports.getKustoWorker = getKustoWorker;
2038
1766
  exports.setupMode = setupMode;
2039
1767