@kusto/monaco-kusto 6.1.2 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -23,7 +23,7 @@ Kusto language plugin for the Monaco Editor. It provides the following features
23
23
 
24
24
  ### AMD module system:
25
25
 
26
- Example at ![https://github.com/Azure/monaco-kusto/tree/master/samples/amd]()
26
+ Example at [/samples/amd](https://github.com/Azure/monaco-kusto/tree/master/samples/amd)
27
27
 
28
28
  1. Run `npm run copyMonacoFilesAMD <path>` or `yarn copyMonacoFilesAMD <path>` where <path> is where you want the monaco and kusto amd modules to be. These files will need to be served as-in.
29
29
  2. Using a amd module loader, import `vs/language/kusto/monaco.contribution`
@@ -32,7 +32,7 @@ Example at ![https://github.com/Azure/monaco-kusto/tree/master/samples/amd]()
32
32
 
33
33
  ### ESM
34
34
 
35
- Parcel example at ![https://github.com/Azure/monaco-kusto/tree/master/samples/parcel]()
35
+ Parcel example at [/samples/parcel](https://github.com/Azure/monaco-kusto/tree/master/samples/parcel)
36
36
 
37
37
  1. Configure your bundler so `@kusto/monaco-kusto/release/esm/kusto.worker` has it's own entry point
38
38
  2. Configure monaco with that entry point and to use `globalAPI` using the `MonacoEnvironment`. This global needs to be set _before_ the monaco editor source is parsed so it will create a global api for this package to use.
@@ -65,6 +65,11 @@ There are 2 APIs to set a Kusto schema:
65
65
 
66
66
  ## Changelog
67
67
 
68
+ ### 6.2.0
69
+
70
+ - Esm output not longer requires `self.MonacoEnvironment` to be true
71
+ - `@kusto/monaco-kusto` no exports the same api as `monaco.languages.kusto`
72
+
68
73
  ### 6.0.0
69
74
 
70
75
  - Improved quality of AMD build artifacts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kusto/monaco-kusto",
3
- "version": "6.1.2",
3
+ "version": "6.2.0",
4
4
  "description": "CSL, KQL plugin for the Monaco Editor",
5
5
  "author": {
6
6
  "name": "Microsoft"
@@ -1,11 +1,30 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 6.1.2(4c9ec21ad04b49f9f8e8a8f7fe773fe9a8b47334)
3
+ * monaco-kusto version: 6.2.0(8e26147bc7c3b5a7a3bc6ee55311dfa0b612c10c)
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', './main-1f7cc4fa'], (function (exports, main) { 'use strict';
8
+ define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './main-81df16b2'], (function (exports, monaco, main) { 'use strict';
9
+
10
+ function _interopNamespaceDefault(e) {
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n.default = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var monaco__namespace = /*#__PURE__*/_interopNamespaceDefault(monaco);
9
28
 
10
29
  var _excluded = ["onDidProvideCompletionItems"];
11
30
  function _typeof$7(obj) { "@babel/helpers - typeof"; return _typeof$7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof$7(obj); }
@@ -697,12 +716,9 @@ define('vs/language/kusto/kustoMode', ['exports', './main-1f7cc4fa'], (function
697
716
  function _defineProperty$1(obj, key, value) { key = _toPropertyKey$1(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
698
717
  function _toPropertyKey$1(arg) { var key = _toPrimitive$1(arg, "string"); return _typeof$1(key) === "symbol" ? key : String(key); }
699
718
  function _toPrimitive$1(input, hint) { if (_typeof$1(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof$1(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
700
- var Uri = monaco.Uri;
701
- monaco.Position;
702
- var Range = monaco.Range;
703
- monaco.Thenable;
704
- monaco.CancellationToken;
705
- monaco.IDisposable; // --- diagnostics ---
719
+
720
+ // --- diagnostics ---
721
+
706
722
  var DiagnosticsAdapter = /*#__PURE__*/function () {
707
723
  function DiagnosticsAdapter(_monacoInstance, _languageId, _worker, defaults, onSchemaChange) {
708
724
  var _this = this;
@@ -787,7 +803,7 @@ define('vs/language/kusto/kustoMode', ['exports', './main-1f7cc4fa'], (function
787
803
  }
788
804
  };
789
805
  if (this.defaults.languageSettings.enableQuickFixes) {
790
- this._disposables.push(monaco.languages.registerCodeActionProvider(this._languageId, {
806
+ this._disposables.push(monaco__namespace.languages.registerCodeActionProvider(this._languageId, {
791
807
  provideCodeActions: function () {
792
808
  var _provideCodeActions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(model, range, context, _token) {
793
809
  var startOffset, endOffset, showQuickFix, actions;
@@ -1029,16 +1045,16 @@ define('vs/language/kusto/kustoMode', ['exports', './main-1f7cc4fa'], (function
1029
1045
  overviewRuler: {
1030
1046
  // The color indication on the right ruler
1031
1047
  color: 'rgb(255, 18, 18, 0.7)',
1032
- position: monaco.editor.OverviewRulerLane.Right
1048
+ position: monaco__namespace.editor.OverviewRulerLane.Right
1033
1049
  },
1034
1050
  minimap: {
1035
1051
  color: 'rgb(255, 18, 18, 0.7)',
1036
- position: monaco.editor.MinimapPosition.Inline
1052
+ position: monaco__namespace.editor.MinimapPosition.Inline
1037
1053
  }
1038
1054
  }
1039
1055
  };
1040
1056
  });
1041
- var oldMarkers = monaco.editor.getModelMarkers({
1057
+ var oldMarkers = monaco__namespace.editor.getModelMarkers({
1042
1058
  owner: languageId,
1043
1059
  resource: resource
1044
1060
  });
@@ -1071,15 +1087,15 @@ define('vs/language/kusto/kustoMode', ['exports', './main-1f7cc4fa'], (function
1071
1087
  function toSeverity(lsSeverity) {
1072
1088
  switch (lsSeverity) {
1073
1089
  case main.DiagnosticSeverity.Error:
1074
- return monaco.MarkerSeverity.Error;
1090
+ return monaco__namespace.MarkerSeverity.Error;
1075
1091
  case main.DiagnosticSeverity.Warning:
1076
- return monaco.MarkerSeverity.Warning;
1092
+ return monaco__namespace.MarkerSeverity.Warning;
1077
1093
  case main.DiagnosticSeverity.Information:
1078
- return monaco.MarkerSeverity.Info;
1094
+ return monaco__namespace.MarkerSeverity.Info;
1079
1095
  case main.DiagnosticSeverity.Hint:
1080
- return monaco.MarkerSeverity.Hint;
1096
+ return monaco__namespace.MarkerSeverity.Hint;
1081
1097
  default:
1082
- return monaco.MarkerSeverity.Info;
1098
+ return monaco__namespace.MarkerSeverity.Info;
1083
1099
  }
1084
1100
  }
1085
1101
  function toDiagnostics(resource, diag) {
@@ -1288,7 +1304,7 @@ define('vs/language/kusto/kustoMode', ['exports', './main-1f7cc4fa'], (function
1288
1304
 
1289
1305
  /**
1290
1306
  * Return true if the range doesn't intersect any of the line ranges.
1291
- * @param range Range
1307
+ * @param range monaco.Range
1292
1308
  * @param impactedLineRanges an array of line ranges
1293
1309
  */
1294
1310
  }, {
@@ -1411,13 +1427,13 @@ define('vs/language/kusto/kustoMode', ['exports', './main-1f7cc4fa'], (function
1411
1427
  function toDecoration(model, classification) {
1412
1428
  var start = model.getPositionAt(classification.start);
1413
1429
  var end = model.getPositionAt(classification.start + classification.length);
1414
- var range = new Range(start.lineNumber, start.column, end.lineNumber, end.column);
1430
+ var range = new monaco__namespace.Range(start.lineNumber, start.column, end.lineNumber, end.column);
1415
1431
  var inlineClassName = ClassificationKindNames[classification.kind];
1416
1432
  return {
1417
1433
  range: range,
1418
1434
  options: {
1419
1435
  inlineClassName: inlineClassName,
1420
- stickiness: monaco.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
1436
+ stickiness: monaco__namespace.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
1421
1437
  }
1422
1438
  };
1423
1439
  }
@@ -1445,10 +1461,10 @@ define('vs/language/kusto/kustoMode', ['exports', './main-1f7cc4fa'], (function
1445
1461
  if (!range) {
1446
1462
  return void 0;
1447
1463
  }
1448
- return new Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1);
1464
+ return new monaco__namespace.Range(range.start.line + 1, range.start.character + 1, range.end.line + 1, range.end.character + 1);
1449
1465
  }
1450
1466
  function toCompletionItemKind(kind) {
1451
- var mItemKind = monaco.languages.CompletionItemKind;
1467
+ var mItemKind = monaco__namespace.languages.CompletionItemKind;
1452
1468
  switch (kind) {
1453
1469
  case main.CompletionItemKind.Text:
1454
1470
  return mItemKind.Text;
@@ -1511,7 +1527,7 @@ define('vs/language/kusto/kustoMode', ['exports', './main-1f7cc4fa'], (function
1511
1527
  var linkWithoutPostfix = prop.toString().replace('.md', '');
1512
1528
  // Sometimes we get the link as a full URL. For example in the main doc link of the item
1513
1529
  var fullURL = linkWithoutPostfix.startsWith('https') ? linkWithoutPostfix : "".concat(DOCS_BASE_URL, "/").concat(linkWithoutPostfix);
1514
- return monaco.Uri.parse(fullURL);
1530
+ return monaco__namespace.Uri.parse(fullURL);
1515
1531
  }
1516
1532
  });
1517
1533
  return {
@@ -1535,7 +1551,7 @@ define('vs/language/kusto/kustoMode', ['exports', './main-1f7cc4fa'], (function
1535
1551
  key: "provideCompletionItems",
1536
1552
  value: function provideCompletionItems(model, position, context, token) {
1537
1553
  var wordInfo = model.getWordUntilPosition(position);
1538
- var wordRange = new Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
1554
+ var wordRange = new monaco__namespace.Range(position.lineNumber, wordInfo.startColumn, position.lineNumber, wordInfo.endColumn);
1539
1555
  var resource = model.uri;
1540
1556
  var onDidProvideCompletionItems = this.languageSettings.onDidProvideCompletionItems;
1541
1557
  return this._worker(resource).then(function (worker) {
@@ -1563,7 +1579,7 @@ define('vs/language/kusto/kustoMode', ['exports', './main-1f7cc4fa'], (function
1563
1579
  item.insertText = entry.textEdit.newText;
1564
1580
  }
1565
1581
  if (entry.insertTextFormat === main.InsertTextFormat.Snippet) {
1566
- item.insertTextRules = monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet;
1582
+ item.insertTextRules = monaco__namespace.languages.CompletionItemInsertTextRule.InsertAsSnippet;
1567
1583
  }
1568
1584
  return item;
1569
1585
  });
@@ -1613,7 +1629,7 @@ define('vs/language/kusto/kustoMode', ['exports', './main-1f7cc4fa'], (function
1613
1629
 
1614
1630
  function toLocation(location) {
1615
1631
  return {
1616
- uri: Uri.parse(location.uri),
1632
+ uri: monaco__namespace.Uri.parse(location.uri),
1617
1633
  range: toRange(location.range)
1618
1634
  };
1619
1635
  }
@@ -1671,7 +1687,7 @@ define('vs/language/kusto/kustoMode', ['exports', './main-1f7cc4fa'], (function
1671
1687
  }
1672
1688
  var resourceEdits = [];
1673
1689
  for (var _uri2 in edit.changes) {
1674
- var _uri = Uri.parse(_uri2);
1690
+ var _uri = monaco__namespace.Uri.parse(_uri2);
1675
1691
  var _iterator = _createForOfIteratorHelper(edit.changes[_uri2]),
1676
1692
  _step;
1677
1693
  try {
@@ -1783,7 +1799,7 @@ define('vs/language/kusto/kustoMode', ['exports', './main-1f7cc4fa'], (function
1783
1799
  return {
1784
1800
  start: range.startLine + 1,
1785
1801
  end: range.endLine + 1,
1786
- kind: monaco.languages.FoldingRangeKind.Region
1802
+ kind: monaco__namespace.languages.FoldingRangeKind.Region
1787
1803
  };
1788
1804
  }
1789
1805
 
@@ -1826,8 +1842,6 @@ define('vs/language/kusto/kustoMode', ['exports', './main-1f7cc4fa'], (function
1826
1842
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1827
1843
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1828
1844
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
1829
- monaco.Uri;
1830
- monaco.IDisposable;
1831
1845
  var kustoWorker;
1832
1846
  var resolveWorker;
1833
1847
  var workerPromise = new Promise(function (resolve, reject) {
@@ -1839,7 +1853,7 @@ define('vs/language/kusto/kustoMode', ['exports', './main-1f7cc4fa'], (function
1839
1853
  * @param defaults
1840
1854
  */
1841
1855
  function setupMode(defaults, monacoInstance) {
1842
- var onSchemaChange = new monaco.Emitter();
1856
+ var onSchemaChange = new monaco__namespace.Emitter();
1843
1857
  // TODO: when should we dispose of these? seems like monaco-css and monaco-typescript don't dispose of these.
1844
1858
  var disposables = [];
1845
1859
  var monarchTokensProvider;
@@ -1,11 +1,11 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 6.1.2(4c9ec21ad04b49f9f8e8a8f7fe773fe9a8b47334)
3
+ * monaco-kusto version: 6.2.0(8e26147bc7c3b5a7a3bc6ee55311dfa0b612c10c)
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-1f7cc4fa'], (function (exports, main) { 'use strict';
8
+ define('vs/language/kusto/kustoWorker', ['exports', './main-81df16b2'], (function (exports, main) { '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: 6.1.2(4c9ec21ad04b49f9f8e8a8f7fe773fe9a8b47334)
3
+ * monaco-kusto version: 6.2.0(8e26147bc7c3b5a7a3bc6ee55311dfa0b612c10c)
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-1f7cc4fa', ['exports'], (function (exports) { 'use strict';
8
+ define('vs/language/kusto/main-81df16b2', ['exports'], (function (exports) { 'use strict';
9
9
 
10
10
  /* --------------------------------------------------------------------------------------------
11
11
  * Copyright (c) Microsoft Corporation. All rights reserved.