@kusto/monaco-kusto 7.3.1 → 7.5.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.
@@ -1,11 +1,11 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
3
+ * monaco-kusto version: 7.5.0(c5ab1d042fcce27f3e01cfde648d4f09d3666977)
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-bd46c9da'], (function (exports, monaco, main) { 'use strict';
8
+ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './main-aca53293'], (function (exports, monaco, main) { 'use strict';
9
9
 
10
10
  function _interopNamespaceDefault(e) {
11
11
  var n = Object.create(null);
@@ -1578,15 +1578,20 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1578
1578
  if (!docString) {
1579
1579
  return undefined;
1580
1580
  }
1581
- var _this$languageSetting = this.languageSettings.documentationBaseUrl,
1582
- documentationBaseUrl = _this$languageSetting === void 0 ? DEFAULT_DOCS_BASE_URL : _this$languageSetting;
1581
+ var _this$languageSetting = this.languageSettings,
1582
+ _this$languageSetting2 = _this$languageSetting.documentationBaseUrl,
1583
+ documentationBaseUrl = _this$languageSetting2 === void 0 ? DEFAULT_DOCS_BASE_URL : _this$languageSetting2,
1584
+ documentationSuffix = _this$languageSetting.documentationSuffix;
1583
1585
  var urisProxy = new Proxy({}, {
1584
1586
  get: function get(_target, prop, _receiver) {
1585
1587
  // The link comes with a postfix of ".md" that we want to remove
1586
- var linkWithoutPostfix = prop.toString().replace('.md', '');
1588
+ var url = prop.toString().replace('.md', '');
1587
1589
  // Sometimes we get the link as a full URL. For example in the main doc link of the item
1588
- var fullURL = linkWithoutPostfix.startsWith('https') ? linkWithoutPostfix : "".concat(documentationBaseUrl, "/").concat(linkWithoutPostfix);
1589
- return monaco__namespace.Uri.parse(fullURL);
1590
+ if (!url.startsWith('https')) {
1591
+ url = "".concat(documentationBaseUrl, "/").concat(url);
1592
+ }
1593
+ url += documentationSuffix || '';
1594
+ return monaco__namespace.Uri.parse(url);
1590
1595
  }
1591
1596
  });
1592
1597
  return {
@@ -1,11 +1,11 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
3
+ * monaco-kusto version: 7.5.0(c5ab1d042fcce27f3e01cfde648d4f09d3666977)
4
4
  * Released under the MIT license
5
5
  * https://https://github.com/Azure/monaco-kusto/blob/master/README.md
6
6
  *-----------------------------------------------------------------------------*/
7
7
 
8
- define('vs/language/kusto/kustoWorker', ['exports', './main-bd46c9da', './schema-4f7dc09d'], (function (exports, main, schema) { 'use strict';
8
+ define('vs/language/kusto/kustoWorker', ['exports', './main-aca53293', './schema-aa8a3973'], (function (exports, main, schema) { 'use strict';
9
9
 
10
10
  function _slicedToArray$2(arr, i) { return _arrayWithHoles$2(arr) || _iterableToArrayLimit$2(arr, i) || _unsupportedIterableToArray$3(arr, i) || _nonIterableRest$2(); }
11
11
  function _nonIterableRest$2() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -3438,14 +3438,18 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-bd46c9da', './schema
3438
3438
  // we need to manually load dependencies that are not explicit- meaning our non-module dependencies
3439
3439
  // generated by Bridge.Net
3440
3440
  if (typeof document == 'undefined') {
3441
- // monaco will run the worker from vs/base/worker so the relative path needs
3442
- // to be from there (hence going up 2 dirs) This stinks because we're
3443
- // requiring the host app to put files in specific locations
3441
+ // Match how monaco defines the base url when inside a web worker: https://github.com/microsoft/vscode/blob/dbeea39df4ac933fe6d5395ad457dad4b494838b/src/vs/base/worker/workerMain.ts#L16
3442
+ //
3443
+ // MonacoEnvironment.baseUrl is conditional because monaco only sets it when the url is of a different origin.
3444
+ // Related monaco code: https://github.com/microsoft/vscode/blob/dbeea39df4ac933fe6d5395ad457dad4b494838b/src/vs/base/browser/defaultWorkerFactory.ts#L47
3445
+ //
3446
+ // It's not clear if MonacoEnvironment in a worker is meant to be a public api or not, so this may break
3447
+ const baseUrl = (self.MonacoEnvironment?.baseUrl || '../../../') + 'vs/language/kusto/';
3444
3448
  importScripts(
3445
- '../../language/kusto/bridge.min.js',
3446
- '../../language/kusto/kusto.javascript.client.min.js',
3447
- '../../language/kusto/newtonsoft.json.min.js',
3448
- '../../language/kusto/Kusto.Language.Bridge.min.js'
3449
+ baseUrl + 'bridge.min.js',
3450
+ baseUrl + 'kusto.javascript.client.min.js',
3451
+ baseUrl + 'newtonsoft.json.min.js',
3452
+ baseUrl + 'Kusto.Language.Bridge.min.js'
3449
3453
  );
3450
3454
  }
3451
3455
 
@@ -3546,7 +3550,7 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-bd46c9da', './schema
3546
3550
  * colorization data for specific line range.
3547
3551
  */
3548
3552
 
3549
- var symbolKindToName = (_symbolKindToName = {}, _defineProperty(_symbolKindToName, sym.SymbolKind.Cluster, 'Cluster'), _defineProperty(_symbolKindToName, sym.SymbolKind.Column, 'Column'), _defineProperty(_symbolKindToName, sym.SymbolKind.Command, 'Command'), _defineProperty(_symbolKindToName, sym.SymbolKind.Database, 'Database'), _defineProperty(_symbolKindToName, sym.SymbolKind.EntityGroup, 'EntityGroup'), _defineProperty(_symbolKindToName, sym.SymbolKind.EntityGroupElement, 'EntityGroupElement'), _defineProperty(_symbolKindToName, sym.SymbolKind.Error, 'Error'), _defineProperty(_symbolKindToName, sym.SymbolKind.Function, 'Function'), _defineProperty(_symbolKindToName, sym.SymbolKind.Graph, 'Graph'), _defineProperty(_symbolKindToName, sym.SymbolKind.Group, 'Group'), _defineProperty(_symbolKindToName, sym.SymbolKind.MaterializedView, 'MaterializedView'), _defineProperty(_symbolKindToName, sym.SymbolKind.None, 'None'), _defineProperty(_symbolKindToName, sym.SymbolKind.Operator, 'Operator'), _defineProperty(_symbolKindToName, sym.SymbolKind.Option, 'Option'), _defineProperty(_symbolKindToName, sym.SymbolKind.Parameter, 'Parameter'), _defineProperty(_symbolKindToName, sym.SymbolKind.Pattern, 'Pattern'), _defineProperty(_symbolKindToName, sym.SymbolKind.QueryOperatorParameter, 'QueryOperatorParameter'), _defineProperty(_symbolKindToName, sym.SymbolKind.Scalar, 'Scalar'), _defineProperty(_symbolKindToName, sym.SymbolKind.Table, 'Table'), _defineProperty(_symbolKindToName, sym.SymbolKind.Tuple, 'Tuple'), _defineProperty(_symbolKindToName, sym.SymbolKind.Variable, 'Variable'), _defineProperty(_symbolKindToName, sym.SymbolKind.Void, 'Void'), _symbolKindToName);
3553
+ var symbolKindToName = (_symbolKindToName = {}, _defineProperty(_symbolKindToName, sym.SymbolKind.Cluster, 'Cluster'), _defineProperty(_symbolKindToName, sym.SymbolKind.Column, 'Column'), _defineProperty(_symbolKindToName, sym.SymbolKind.Command, 'Command'), _defineProperty(_symbolKindToName, sym.SymbolKind.Database, 'Database'), _defineProperty(_symbolKindToName, sym.SymbolKind.EntityGroup, 'EntityGroup'), _defineProperty(_symbolKindToName, sym.SymbolKind.EntityGroupElement, 'EntityGroupElement'), _defineProperty(_symbolKindToName, sym.SymbolKind.Error, 'Error'), _defineProperty(_symbolKindToName, sym.SymbolKind.Function, 'Function'), _defineProperty(_symbolKindToName, sym.SymbolKind.Graph, 'Graph'), _defineProperty(_symbolKindToName, sym.SymbolKind.Group, 'Group'), _defineProperty(_symbolKindToName, sym.SymbolKind.MaterializedView, 'MaterializedView'), _defineProperty(_symbolKindToName, sym.SymbolKind.None, 'None'), _defineProperty(_symbolKindToName, sym.SymbolKind.Operator, 'Operator'), _defineProperty(_symbolKindToName, sym.SymbolKind.Option, 'Option'), _defineProperty(_symbolKindToName, sym.SymbolKind.Parameter, 'Parameter'), _defineProperty(_symbolKindToName, sym.SymbolKind.Pattern, 'Pattern'), _defineProperty(_symbolKindToName, sym.SymbolKind.QueryOperatorParameter, 'QueryOperatorParameter'), _defineProperty(_symbolKindToName, sym.SymbolKind.Primitive, 'Primitive'), _defineProperty(_symbolKindToName, sym.SymbolKind.Table, 'Table'), _defineProperty(_symbolKindToName, sym.SymbolKind.Tuple, 'Tuple'), _defineProperty(_symbolKindToName, sym.SymbolKind.Variable, 'Variable'), _defineProperty(_symbolKindToName, sym.SymbolKind.Void, 'Void'), _symbolKindToName);
3550
3554
  /**
3551
3555
  * Kusto Language service translates the kusto object model (transpiled from C# by Bridge.Net)
3552
3556
  * to the vscode language server types, which are used by vscode language extensions.
@@ -4820,7 +4824,7 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-bd46c9da', './schema
4820
4824
  return {
4821
4825
  name: sym.Name,
4822
4826
  kind: (_symbolKindToName$sym = symbolKindToName[sym.Kind]) !== null && _symbolKindToName$sym !== void 0 ? _symbolKindToName$sym : "".concat(sym.Kind),
4823
- display: sym.Display
4827
+ display: "".concat(sym.Name, " (").concat(sym.AlternateName, ")")
4824
4828
  };
4825
4829
  });
4826
4830
  return Promise.resolve(result);
@@ -1,11 +1,11 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
3
+ * monaco-kusto version: 7.5.0(c5ab1d042fcce27f3e01cfde648d4f09d3666977)
4
4
  * Released under the MIT license
5
5
  * https://https://github.com/Azure/monaco-kusto/blob/master/README.md
6
6
  *-----------------------------------------------------------------------------*/
7
7
 
8
- define('vs/language/kusto/main-bd46c9da', ['exports'], (function (exports) { 'use strict';
8
+ define('vs/language/kusto/main-aca53293', ['exports'], (function (exports) { 'use strict';
9
9
 
10
10
  /* --------------------------------------------------------------------------------------------
11
11
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,11 +1,11 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
3
+ * monaco-kusto version: 7.5.0(c5ab1d042fcce27f3e01cfde648d4f09d3666977)
4
4
  * Released under the MIT license
5
5
  * https://https://github.com/Azure/monaco-kusto/blob/master/README.md
6
6
  *-----------------------------------------------------------------------------*/
7
7
 
8
- define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/editor/editor.main', './schema-4f7dc09d'], (function (require, exports, monaco, schema) { 'use strict';
8
+ define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/editor/editor.main', './schema-aa8a3973'], (function (require, exports, monaco, schema) { 'use strict';
9
9
 
10
10
  function _interopNamespaceDefault(e) {
11
11
  var n = Object.create(null);
@@ -1,11 +1,11 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
3
+ * monaco-kusto version: 7.5.0(c5ab1d042fcce27f3e01cfde648d4f09d3666977)
4
4
  * Released under the MIT license
5
5
  * https://https://github.com/Azure/monaco-kusto/blob/master/README.md
6
6
  *-----------------------------------------------------------------------------*/
7
7
 
8
- define('vs/language/kusto/schema-4f7dc09d', ['exports'], (function (exports) { 'use strict';
8
+ define('vs/language/kusto/schema-aa8a3973', ['exports'], (function (exports) { 'use strict';
9
9
 
10
10
  // Definition of schema object in the context of language services. This model is exposed to consumers of this library.
11
11
 
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
3
+ * monaco-kusto version: 7.5.0(c5ab1d042fcce27f3e01cfde648d4f09d3666977)
4
4
  * Released under the MIT license
5
5
  * https://https://github.com/Azure/monaco-kusto/blob/master/README.md
6
6
  *-----------------------------------------------------------------------------*/
@@ -8,7 +8,7 @@
8
8
  import * as worker from 'monaco-editor/esm/vs/editor/editor.worker';
9
9
  import * as ls from 'vscode-languageserver-types';
10
10
  import XRegExp from 'xregexp';
11
- import { d as getEntityDataTypeFromCslType, a as getCallName, b as getExpression, g as getCslTypeNameFromClrType } from './schema-3d1d888f.js';
11
+ import { d as getEntityDataTypeFromCslType, a as getCallName, b as getExpression, g as getCslTypeNameFromClrType } from './schema-dc382300.js';
12
12
  import '@kusto/language-service/bridge.min';
13
13
  import '@kusto/language-service/Kusto.JavaScript.Client.min';
14
14
  import '@kusto/language-service/newtonsoft.json.min';
@@ -102,7 +102,7 @@ const symbolKindToName = {
102
102
  [sym.SymbolKind.Parameter]: 'Parameter',
103
103
  [sym.SymbolKind.Pattern]: 'Pattern',
104
104
  [sym.SymbolKind.QueryOperatorParameter]: 'QueryOperatorParameter',
105
- [sym.SymbolKind.Scalar]: 'Scalar',
105
+ [sym.SymbolKind.Primitive]: 'Primitive',
106
106
  [sym.SymbolKind.Table]: 'Table',
107
107
  [sym.SymbolKind.Tuple]: 'Tuple',
108
108
  [sym.SymbolKind.Variable]: 'Variable',
@@ -1222,7 +1222,7 @@ class KustoLanguageService {
1222
1222
  const result = referencedSymbols.map(sym => ({
1223
1223
  name: sym.Name,
1224
1224
  kind: symbolKindToName[sym.Kind] ?? `${sym.Kind}`,
1225
- display: sym.Display
1225
+ display: `${sym.Name} (${sym.AlternateName})`
1226
1226
  }));
1227
1227
  return Promise.resolve(result);
1228
1228
  }
@@ -1,7 +1,7 @@
1
1
  import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
2
2
  import type { KustoWorker, LanguageServiceDefaults } from './monaco.contribution';
3
3
  import type { IKustoWorkerImpl } from './kustoWorker';
4
- export interface AugmentedWorker extends KustoWorker, Omit<IKustoWorkerImpl, 'setSchemaFromShowSchema'> {
4
+ export interface AugmentedWorker extends KustoWorker, Omit<IKustoWorkerImpl, 'setSchemaFromShowSchema' | 'getReferencedSymbols'> {
5
5
  }
6
6
  export interface AugmentedWorkerAccessor {
7
7
  (first: monaco.Uri, ...more: monaco.Uri[]): Promise<AugmentedWorker>;
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
3
+ * monaco-kusto version: 7.5.0(c5ab1d042fcce27f3e01cfde648d4f09d3666977)
4
4
  * Released under the MIT license
5
5
  * https://https://github.com/Azure/monaco-kusto/blob/master/README.md
6
6
  *-----------------------------------------------------------------------------*/
@@ -869,15 +869,19 @@ class CompletionAdapter {
869
869
  return undefined;
870
870
  }
871
871
  const {
872
- documentationBaseUrl = DEFAULT_DOCS_BASE_URL
872
+ documentationBaseUrl = DEFAULT_DOCS_BASE_URL,
873
+ documentationSuffix
873
874
  } = this.languageSettings;
874
875
  const urisProxy = new Proxy({}, {
875
876
  get(_target, prop, _receiver) {
876
877
  // The link comes with a postfix of ".md" that we want to remove
877
- const linkWithoutPostfix = prop.toString().replace('.md', '');
878
+ let url = prop.toString().replace('.md', '');
878
879
  // Sometimes we get the link as a full URL. For example in the main doc link of the item
879
- const fullURL = linkWithoutPostfix.startsWith('https') ? linkWithoutPostfix : `${documentationBaseUrl}/${linkWithoutPostfix}`;
880
- return monaco.Uri.parse(fullURL);
880
+ if (!url.startsWith('https')) {
881
+ url = `${documentationBaseUrl}/${url}`;
882
+ }
883
+ url += documentationSuffix || '';
884
+ return monaco.Uri.parse(url);
881
885
  }
882
886
  });
883
887
  return {
@@ -17,6 +17,7 @@ export interface LanguageSettings {
17
17
  quickFixCodeActions?: QuickFixCodeActionOptions[];
18
18
  enableQuickFixes?: boolean;
19
19
  documentationBaseUrl?: boolean;
20
+ documentationSuffix?: string;
20
21
  }
21
22
  export interface FormatterOptions {
22
23
  indentationSize?: number;
@@ -1,13 +1,13 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
3
+ * monaco-kusto version: 7.5.0(c5ab1d042fcce27f3e01cfde648d4f09d3666977)
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
8
  import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
9
- import { g as getCslTypeNameFromClrType, a as getCallName, b as getExpression, c as getInputParametersAsCslString, d as getEntityDataTypeFromCslType } from './schema-3d1d888f.js';
10
- export { s as showSchema } from './schema-3d1d888f.js';
9
+ import { g as getCslTypeNameFromClrType, a as getCallName, b as getExpression, c as getInputParametersAsCslString, d as getEntityDataTypeFromCslType } from './schema-dc382300.js';
10
+ export { s as showSchema } from './schema-dc382300.js';
11
11
 
12
12
  function getCurrentCommandRange(editor, cursorPosition) {
13
13
  const zeroBasedCursorLineNumber = cursorPosition.lineNumber - 1;
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
3
+ * monaco-kusto version: 7.5.0(c5ab1d042fcce27f3e01cfde648d4f09d3666977)
4
4
  * Released under the MIT license
5
5
  * https://https://github.com/Azure/monaco-kusto/blob/master/README.md
6
6
  *-----------------------------------------------------------------------------*/
@@ -73,7 +73,6 @@ export interface KustoWorker {
73
73
  getReferencedSymbols(uri: string, cursorOffset?: number): Promise<{
74
74
  name: string;
75
75
  kind: string;
76
- display: string;
77
76
  }[]>;
78
77
  /**
79
78
  * Get visualization options in render command if present (null otherwise).