@kusto/monaco-kusto 7.2.1 → 7.3.1

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.2.1(b1d17bbed02ccac9d22a492d16d5e01efa6a263d)
3
+ * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
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-919033b0'], (function (exports, monaco, main) { 'use strict';
8
+ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './main-bd46c9da'], (function (exports, monaco, main) { 'use strict';
9
9
 
10
10
  function _interopNamespaceDefault(e) {
11
11
  var n = Object.create(null);
@@ -1514,28 +1514,7 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1514
1514
  text: textEdit.newText
1515
1515
  };
1516
1516
  }
1517
- var DOCS_BASE_URL = 'https://learn.microsoft.com/azure/data-explorer/kusto/query';
1518
- function formatDocLink(docString) {
1519
- // If the docString is empty, we want to return undefined to prevent an empty documentation popup.
1520
- if (!docString) {
1521
- return undefined;
1522
- }
1523
- var target = {};
1524
- var urisProxy = new Proxy(target, {
1525
- get: function get(_target, prop, _receiver) {
1526
- // The link comes with a postfix of ".md" that we want to remove
1527
- var linkWithoutPostfix = prop.toString().replace('.md', '');
1528
- // Sometimes we get the link as a full URL. For example in the main doc link of the item
1529
- var fullURL = linkWithoutPostfix.startsWith('https') ? linkWithoutPostfix : "".concat(DOCS_BASE_URL, "/").concat(linkWithoutPostfix);
1530
- return monaco__namespace.Uri.parse(fullURL);
1531
- }
1532
- });
1533
- return {
1534
- value: docString,
1535
- isTrusted: true,
1536
- uris: urisProxy
1537
- };
1538
- }
1517
+ var DEFAULT_DOCS_BASE_URL = 'https://learn.microsoft.com/azure/data-explorer/kusto/query';
1539
1518
  var CompletionAdapter = /*#__PURE__*/function () {
1540
1519
  function CompletionAdapter(_worker, languageSettings) {
1541
1520
  _classCallCheck(this, CompletionAdapter);
@@ -1550,6 +1529,7 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1550
1529
  }, {
1551
1530
  key: "provideCompletionItems",
1552
1531
  value: function provideCompletionItems(model, position, context, token) {
1532
+ var _this7 = this;
1553
1533
  var wordInfo = model.getWordUntilPosition(position);
1554
1534
  var wordRange = new monaco__namespace.Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
1555
1535
  var resource = model.uri;
@@ -1570,7 +1550,7 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1570
1550
  sortText: entry.sortText,
1571
1551
  filterText: entry.filterText,
1572
1552
  // TODO: Is this cast safe?
1573
- documentation: formatDocLink((_entry$documentation = entry.documentation) === null || _entry$documentation === void 0 ? void 0 : _entry$documentation.value),
1553
+ documentation: _this7.formatDocLink((_entry$documentation = entry.documentation) === null || _entry$documentation === void 0 ? void 0 : _entry$documentation.value),
1574
1554
  detail: entry.detail,
1575
1555
  range: wordRange,
1576
1556
  kind: toCompletionItemKind(entry.kind)
@@ -1591,6 +1571,30 @@ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './ma
1591
1571
  };
1592
1572
  });
1593
1573
  }
1574
+ }, {
1575
+ key: "formatDocLink",
1576
+ value: function formatDocLink(docString) {
1577
+ // If the docString is empty, we want to return undefined to prevent an empty documentation popup.
1578
+ if (!docString) {
1579
+ return undefined;
1580
+ }
1581
+ var _this$languageSetting = this.languageSettings.documentationBaseUrl,
1582
+ documentationBaseUrl = _this$languageSetting === void 0 ? DEFAULT_DOCS_BASE_URL : _this$languageSetting;
1583
+ var urisProxy = new Proxy({}, {
1584
+ get: function get(_target, prop, _receiver) {
1585
+ // The link comes with a postfix of ".md" that we want to remove
1586
+ var linkWithoutPostfix = prop.toString().replace('.md', '');
1587
+ // 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
+ }
1591
+ });
1592
+ return {
1593
+ value: docString,
1594
+ isTrusted: true,
1595
+ uris: urisProxy
1596
+ };
1597
+ }
1594
1598
  }]);
1595
1599
  return CompletionAdapter;
1596
1600
  }();
@@ -1,11 +1,11 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 7.2.1(b1d17bbed02ccac9d22a492d16d5e01efa6a263d)
3
+ * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
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-919033b0', './schema-ee65b25b'], (function (exports, main, schema) { 'use strict';
8
+ define('vs/language/kusto/kustoWorker', ['exports', './main-bd46c9da', './schema-4f7dc09d'], (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."); }
@@ -1,11 +1,11 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 7.2.1(b1d17bbed02ccac9d22a492d16d5e01efa6a263d)
3
+ * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
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-919033b0', ['exports'], (function (exports) { 'use strict';
8
+ define('vs/language/kusto/main-bd46c9da', ['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.2.1(b1d17bbed02ccac9d22a492d16d5e01efa6a263d)
3
+ * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
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-ee65b25b'], (function (require, exports, monaco, schema) { 'use strict';
8
+ define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/editor/editor.main', './schema-4f7dc09d'], (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.2.1(b1d17bbed02ccac9d22a492d16d5e01efa6a263d)
3
+ * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
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-ee65b25b', ['exports'], (function (exports) { 'use strict';
8
+ define('vs/language/kusto/schema-4f7dc09d', ['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.2.1(b1d17bbed02ccac9d22a492d16d5e01efa6a263d)
3
+ * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
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-cdd9848d.js';
11
+ import { d as getEntityDataTypeFromCslType, a as getCallName, b as getExpression, g as getCslTypeNameFromClrType } from './schema-3d1d888f.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';
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 7.2.1(b1d17bbed02ccac9d22a492d16d5e01efa6a263d)
3
+ * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
4
4
  * Released under the MIT license
5
5
  * https://https://github.com/Azure/monaco-kusto/blob/master/README.md
6
6
  *-----------------------------------------------------------------------------*/
@@ -815,28 +815,7 @@ function toTextEdit(textEdit) {
815
815
  text: textEdit.newText
816
816
  };
817
817
  }
818
- const DOCS_BASE_URL = 'https://learn.microsoft.com/azure/data-explorer/kusto/query';
819
- function formatDocLink(docString) {
820
- // If the docString is empty, we want to return undefined to prevent an empty documentation popup.
821
- if (!docString) {
822
- return undefined;
823
- }
824
- const target = {};
825
- const urisProxy = new Proxy(target, {
826
- get(_target, prop, _receiver) {
827
- // The link comes with a postfix of ".md" that we want to remove
828
- const linkWithoutPostfix = prop.toString().replace('.md', '');
829
- // Sometimes we get the link as a full URL. For example in the main doc link of the item
830
- const fullURL = linkWithoutPostfix.startsWith('https') ? linkWithoutPostfix : `${DOCS_BASE_URL}/${linkWithoutPostfix}`;
831
- return monaco.Uri.parse(fullURL);
832
- }
833
- });
834
- return {
835
- value: docString,
836
- isTrusted: true,
837
- uris: urisProxy
838
- };
839
- }
818
+ const DEFAULT_DOCS_BASE_URL = 'https://learn.microsoft.com/azure/data-explorer/kusto/query';
840
819
  class CompletionAdapter {
841
820
  constructor(_worker, languageSettings) {
842
821
  this._worker = _worker;
@@ -863,7 +842,7 @@ class CompletionAdapter {
863
842
  sortText: entry.sortText,
864
843
  filterText: entry.filterText,
865
844
  // TODO: Is this cast safe?
866
- documentation: formatDocLink(entry.documentation?.value),
845
+ documentation: this.formatDocLink(entry.documentation?.value),
867
846
  detail: entry.detail,
868
847
  range: wordRange,
869
848
  kind: toCompletionItemKind(entry.kind)
@@ -884,6 +863,29 @@ class CompletionAdapter {
884
863
  };
885
864
  });
886
865
  }
866
+ formatDocLink(docString) {
867
+ // If the docString is empty, we want to return undefined to prevent an empty documentation popup.
868
+ if (!docString) {
869
+ return undefined;
870
+ }
871
+ const {
872
+ documentationBaseUrl = DEFAULT_DOCS_BASE_URL
873
+ } = this.languageSettings;
874
+ const urisProxy = new Proxy({}, {
875
+ get(_target, prop, _receiver) {
876
+ // The link comes with a postfix of ".md" that we want to remove
877
+ const linkWithoutPostfix = prop.toString().replace('.md', '');
878
+ // 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);
881
+ }
882
+ });
883
+ return {
884
+ value: docString,
885
+ isTrusted: true,
886
+ uris: urisProxy
887
+ };
888
+ }
887
889
  }
888
890
  function isMarkupContent(thing) {
889
891
  return thing && typeof thing === 'object' && typeof thing.kind === 'string';
@@ -44,6 +44,7 @@ export declare class CompletionAdapter implements monaco.languages.CompletionIte
44
44
  constructor(_worker: AugmentedWorkerAccessor, languageSettings: LanguageSettings);
45
45
  get triggerCharacters(): string[];
46
46
  provideCompletionItems(model: monaco.editor.IReadOnlyModel, position: monaco.Position, context: monaco.languages.CompletionContext, token: monaco.CancellationToken): monaco.Thenable<monaco.languages.CompletionList>;
47
+ private formatDocLink;
47
48
  }
48
49
  export declare class DefinitionAdapter {
49
50
  private _worker;
@@ -16,6 +16,7 @@ export interface LanguageSettings {
16
16
  disabledDiagnosticCodes?: string[];
17
17
  quickFixCodeActions?: QuickFixCodeActionOptions[];
18
18
  enableQuickFixes?: boolean;
19
+ documentationBaseUrl?: boolean;
19
20
  }
20
21
  export interface FormatterOptions {
21
22
  indentationSize?: number;
@@ -1,13 +1,13 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 7.2.1(b1d17bbed02ccac9d22a492d16d5e01efa6a263d)
3
+ * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
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-cdd9848d.js';
10
- export { s as showSchema } from './schema-cdd9848d.js';
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';
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.2.1(b1d17bbed02ccac9d22a492d16d5e01efa6a263d)
3
+ * monaco-kusto version: 7.3.1(09ebc262a890fe768e760dfd26b991c3eab53248)
4
4
  * Released under the MIT license
5
5
  * https://https://github.com/Azure/monaco-kusto/blob/master/README.md
6
6
  *-----------------------------------------------------------------------------*/