@kusto/monaco-kusto 13.0.2 → 13.1.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.
- package/README.md +11 -0
- package/package.json +1 -1
- package/release/dev/kustoMode.js +2 -2
- package/release/dev/kustoWorker.js +2 -2
- package/release/dev/{main-2fc60bf1.js → main-76f3bf84.js} +2 -2
- package/release/dev/monaco.contribution.js +134 -26
- package/release/dev/{schema-4073036d.js → schema-46504958.js} +2 -2
- package/release/dev/{types-142781ba.js → types-7f893d92.js} +2 -2
- package/release/esm/editorExtensions/CaseInvertor.d.ts +19 -0
- package/release/esm/editorExtensions/CaseInvertor.js +71 -0
- package/release/esm/editorExtensions/dateStringWrapper.d.ts +3 -0
- package/release/esm/editorExtensions/dateStringWrapper.js +28 -0
- package/release/esm/{globals-ac8b7ea1.js → globals-ab5bacd5.js} +1 -1
- package/release/esm/kusto.worker.js +2 -2
- package/release/esm/kustoMode.js +2 -2
- package/release/esm/monaco.contribution.js +98 -5
- package/release/esm/{schema-0a4e5e41.js → schema-c46b688b.js} +1 -1
- package/release/esm/syntaxHighlighting/themes.js +1 -1
- package/release/min/kustoMode.js +2 -2
- package/release/min/kustoWorker.js +2 -2
- package/release/min/{main-0cb1ed3d.js → main-e65927ff.js} +2 -2
- package/release/min/monaco.contribution.js +2 -2
- package/release/min/{schema-ba14fa16.js → schema-dc2253f5.js} +2 -2
- package/release/min/{types-48ca9ca8.js → types-53ba09ef.js} +2 -2
package/README.md
CHANGED
|
@@ -91,6 +91,17 @@ Every PR should come with a test that checks it.
|
|
|
91
91
|
|
|
92
92
|
## Changelog
|
|
93
93
|
|
|
94
|
+
## 13.1.1
|
|
95
|
+
|
|
96
|
+
- fix: Update query operator color to adhere to accessibility standards.
|
|
97
|
+
|
|
98
|
+
## 13.1.0
|
|
99
|
+
|
|
100
|
+
- feat: Add keyboard shortcuts for changing case:
|
|
101
|
+
- `Ctrl+Shift+U`: Converts current selection to **uppercase**
|
|
102
|
+
- `Ctrl+Shift+L`: Converts current selection to **lowercase**
|
|
103
|
+
- feat: Wrap pasted bare ISO **date** and **datetime** strings with `datetime()`
|
|
104
|
+
|
|
94
105
|
## 13.0.2
|
|
95
106
|
|
|
96
107
|
- fix: revert the behaviour that closed the IntelliSense/completion menu when pressing `Shift+Enter` (introduced in 13.0.1).
|
package/package.json
CHANGED
package/release/dev/kustoMode.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 13.
|
|
3
|
+
* monaco-kusto version: 13.1.1(178105a761985a9b7c16d45b528f829e1c112ff0)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
7
7
|
|
|
8
|
-
define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './main-
|
|
8
|
+
define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './main-76f3bf84', './types-7f893d92'], (function (exports, monaco, main, types$1) { '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: 13.
|
|
3
|
+
* monaco-kusto version: 13.1.1(178105a761985a9b7c16d45b528f829e1c112ff0)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
7
7
|
|
|
8
|
-
define('vs/language/kusto/kustoWorker', ['exports', './main-
|
|
8
|
+
define('vs/language/kusto/kustoWorker', ['exports', './main-76f3bf84', './schema-46504958'], (function (exports, main, schema) { 'use strict';
|
|
9
9
|
|
|
10
10
|
function _slicedToArray$2(r, e) { return _arrayWithHoles$2(r) || _iterableToArrayLimit$2(r, e) || _unsupportedIterableToArray$3(r, e) || _nonIterableRest$2(); }
|
|
11
11
|
function _nonIterableRest$2() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 13.
|
|
3
|
+
* monaco-kusto version: 13.1.1(178105a761985a9b7c16d45b528f829e1c112ff0)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
7
7
|
|
|
8
|
-
define('vs/language/kusto/main-
|
|
8
|
+
define('vs/language/kusto/main-76f3bf84', ['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: 13.
|
|
3
|
+
* monaco-kusto version: 13.1.1(178105a761985a9b7c16d45b528f829e1c112ff0)
|
|
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', './types-
|
|
8
|
+
define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/editor/editor.main', './types-7f893d92', './schema-46504958'], (function (require, exports, monaco, types, schema) { 'use strict';
|
|
9
9
|
|
|
10
10
|
function _interopNamespaceDefault(e) {
|
|
11
11
|
var n = Object.create(null);
|
|
@@ -76,13 +76,13 @@ define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/edito
|
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
function _typeof$
|
|
80
|
-
function _classCallCheck$
|
|
81
|
-
function _defineProperties$
|
|
82
|
-
function _createClass$
|
|
83
|
-
function _defineProperty$
|
|
84
|
-
function _toPropertyKey$
|
|
85
|
-
function _toPrimitive$
|
|
79
|
+
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); }
|
|
80
|
+
function _classCallCheck$3(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
81
|
+
function _defineProperties$3(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); } }
|
|
82
|
+
function _createClass$3(e, r, t) { return r && _defineProperties$3(e.prototype, r), t && _defineProperties$3(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
83
|
+
function _defineProperty$3(e, r, t) { return (r = _toPropertyKey$3(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
84
|
+
function _toPropertyKey$3(t) { var i = _toPrimitive$3(t, "string"); return "symbol" == _typeof$3(i) ? i : i + ""; }
|
|
85
|
+
function _toPrimitive$3(t, r) { if ("object" != _typeof$3(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof$3(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
88
|
* Highlights the command that surround cursor location
|
|
@@ -94,9 +94,9 @@ define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/edito
|
|
|
94
94
|
*/
|
|
95
95
|
function KustoCommandHighlighter(editor) {
|
|
96
96
|
var _this = this;
|
|
97
|
-
_classCallCheck$
|
|
98
|
-
_defineProperty$
|
|
99
|
-
_defineProperty$
|
|
97
|
+
_classCallCheck$3(this, KustoCommandHighlighter);
|
|
98
|
+
_defineProperty$3(this, "disposables", []);
|
|
99
|
+
_defineProperty$3(this, "decorations", []);
|
|
100
100
|
this.editor = editor;
|
|
101
101
|
// Note that selection update is triggered not only for selection changes, but also just when no text selection is occurring and cursor just moves around.
|
|
102
102
|
// This case is counted as a 0-length selection starting and ending on the cursor position.
|
|
@@ -107,7 +107,7 @@ define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/edito
|
|
|
107
107
|
_this.highlightCommandUnderCursor(changeEvent);
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
|
-
return _createClass$
|
|
110
|
+
return _createClass$3(KustoCommandHighlighter, [{
|
|
111
111
|
key: "getId",
|
|
112
112
|
value: function getId() {
|
|
113
113
|
return KustoCommandHighlighter.ID;
|
|
@@ -137,22 +137,22 @@ define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/edito
|
|
|
137
137
|
}
|
|
138
138
|
}]);
|
|
139
139
|
}();
|
|
140
|
-
_defineProperty$
|
|
141
|
-
_defineProperty$
|
|
140
|
+
_defineProperty$3(KustoCommandHighlighter, "ID", 'editor.contrib.kustoCommandHighlighter');
|
|
141
|
+
_defineProperty$3(KustoCommandHighlighter, "CURRENT_COMMAND_HIGHLIGHT", {
|
|
142
142
|
className: 'selectionHighlight'
|
|
143
143
|
});
|
|
144
144
|
|
|
145
|
-
function _typeof$
|
|
146
|
-
function _defineProperties$
|
|
147
|
-
function _createClass$
|
|
148
|
-
function _classCallCheck$
|
|
149
|
-
function _defineProperty$
|
|
150
|
-
function _toPropertyKey$
|
|
151
|
-
function _toPrimitive$
|
|
152
|
-
var KustoCommandFormatter = /*#__PURE__*/_createClass$
|
|
145
|
+
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); }
|
|
146
|
+
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$2(o.key), o); } }
|
|
147
|
+
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; }
|
|
148
|
+
function _classCallCheck$2(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
149
|
+
function _defineProperty$2(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; }
|
|
150
|
+
function _toPropertyKey$2(t) { var i = _toPrimitive$2(t, "string"); return "symbol" == _typeof$2(i) ? i : i + ""; }
|
|
151
|
+
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); }
|
|
152
|
+
var KustoCommandFormatter = /*#__PURE__*/_createClass$2(function KustoCommandFormatter(editor) {
|
|
153
153
|
var _this = this;
|
|
154
|
-
_classCallCheck$
|
|
155
|
-
_defineProperty$
|
|
154
|
+
_classCallCheck$2(this, KustoCommandFormatter);
|
|
155
|
+
_defineProperty$2(this, "actionAdded", false);
|
|
156
156
|
this.editor = editor;
|
|
157
157
|
// selection also represents no selection - for example the event gets triggered when moving cursor from point
|
|
158
158
|
// a to point b. in the case start position will equal end position.
|
|
@@ -181,6 +181,32 @@ define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/edito
|
|
|
181
181
|
});
|
|
182
182
|
});
|
|
183
183
|
|
|
184
|
+
function dateStringWrapper(editor) {
|
|
185
|
+
editor.onDidPaste(function (event) {
|
|
186
|
+
var range = event.range;
|
|
187
|
+
if (!range) return;
|
|
188
|
+
var model = editor.getModel();
|
|
189
|
+
var pasted = model.getValueInRange(range);
|
|
190
|
+
if (!isBareIsoDate(pasted)) return;
|
|
191
|
+
var wrapped = "datetime(".concat(pasted, ")");
|
|
192
|
+
var edit = {
|
|
193
|
+
range: range,
|
|
194
|
+
text: wrapped,
|
|
195
|
+
forceMoveMarkers: true
|
|
196
|
+
};
|
|
197
|
+
var cursorStateComputer = function cursorStateComputer() {
|
|
198
|
+
var startOffset = model.getOffsetAt(range.getStartPosition());
|
|
199
|
+
var endPos = model.getPositionAt(startOffset + wrapped.length);
|
|
200
|
+
return [new monaco__namespace.Selection(endPos.lineNumber, endPos.column, endPos.lineNumber, endPos.column)];
|
|
201
|
+
};
|
|
202
|
+
editor.executeEdits('paste-date', [edit], cursorStateComputer);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
function isBareIsoDate(text) {
|
|
206
|
+
var s = text.trim();
|
|
207
|
+
return /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}Z)?$/.test(s);
|
|
208
|
+
}
|
|
209
|
+
|
|
184
210
|
var ThemeName = /*#__PURE__*/function (ThemeName) {
|
|
185
211
|
ThemeName["light"] = "kusto-light";
|
|
186
212
|
ThemeName["dark"] = "kusto-dark";
|
|
@@ -193,7 +219,7 @@ define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/edito
|
|
|
193
219
|
paleChestnut: '#D69D85',
|
|
194
220
|
paleVioletRed: '#DB7093',
|
|
195
221
|
firebrick: '#B22222',
|
|
196
|
-
orangeRed: '#
|
|
222
|
+
orangeRed: '#CE3600',
|
|
197
223
|
mediumVioletRed: '#C71585',
|
|
198
224
|
magenta: '#FF00FF',
|
|
199
225
|
// for debugging
|
|
@@ -403,6 +429,86 @@ define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/edito
|
|
|
403
429
|
return colorizedLines.join('<br/>');
|
|
404
430
|
}
|
|
405
431
|
|
|
432
|
+
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); }
|
|
433
|
+
function _classCallCheck$1(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
434
|
+
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$1(o.key), o); } }
|
|
435
|
+
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; }
|
|
436
|
+
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; }
|
|
437
|
+
function _toPropertyKey$1(t) { var i = _toPrimitive$1(t, "string"); return "symbol" == _typeof$1(i) ? i : i + ""; }
|
|
438
|
+
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); }
|
|
439
|
+
/**
|
|
440
|
+
* Registers a Kusto-specific action to close the IntelliSense suggestions popup.
|
|
441
|
+
*
|
|
442
|
+
* Note:
|
|
443
|
+
* We register the action on the first cursor movement, not on editor creation,
|
|
444
|
+
* because Monaco fires 'onDidCreateEditor' before the keybinding service is fully initialized.
|
|
445
|
+
* Waiting for a cursor event guarantees that the editor is fully ready
|
|
446
|
+
* and allows safe registration of actions with keybindings.
|
|
447
|
+
*/
|
|
448
|
+
var CaseInvertor = /*#__PURE__*/function () {
|
|
449
|
+
function CaseInvertor(editor) {
|
|
450
|
+
var _this = this;
|
|
451
|
+
_classCallCheck$1(this, CaseInvertor);
|
|
452
|
+
_defineProperty$1(this, "actionsRegistered", false);
|
|
453
|
+
this.editor = editor;
|
|
454
|
+
this.ctrlKeyMod = this.isMac() ? monaco__namespace.KeyMod.WinCtrl : monaco__namespace.KeyMod.CtrlCmd;
|
|
455
|
+
this.editor.onDidChangeCursorSelection(function () {
|
|
456
|
+
var _this$editor$getModel;
|
|
457
|
+
if (((_this$editor$getModel = _this.editor.getModel()) === null || _this$editor$getModel === void 0 ? void 0 : _this$editor$getModel.getLanguageId()) !== 'kusto') {
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
if (!_this.actionsRegistered) {
|
|
461
|
+
_this.registerUpperCaseHandler();
|
|
462
|
+
_this.registerLowerCaseHandler();
|
|
463
|
+
_this.actionsRegistered = true;
|
|
464
|
+
}
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
return _createClass$1(CaseInvertor, [{
|
|
468
|
+
key: "registerUpperCaseHandler",
|
|
469
|
+
value: function registerUpperCaseHandler() {
|
|
470
|
+
this.editor.addAction({
|
|
471
|
+
id: 'kusto.toUpperCase',
|
|
472
|
+
label: 'To Upper Case',
|
|
473
|
+
keybindings: [this.ctrlKeyMod | monaco__namespace.KeyMod.Shift | monaco__namespace.KeyCode.KeyU],
|
|
474
|
+
run: function run(editor) {
|
|
475
|
+
var selectedRange = editor.getSelection();
|
|
476
|
+
var selectedText = editor.getModel().getValueInRange(selectedRange);
|
|
477
|
+
var upperCaseText = selectedText.toUpperCase();
|
|
478
|
+
editor.executeEdits('toUpperCase', [{
|
|
479
|
+
range: selectedRange,
|
|
480
|
+
text: upperCaseText
|
|
481
|
+
}]);
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
}, {
|
|
486
|
+
key: "registerLowerCaseHandler",
|
|
487
|
+
value: function registerLowerCaseHandler() {
|
|
488
|
+
this.editor.addAction({
|
|
489
|
+
id: 'kusto.toLowerCase',
|
|
490
|
+
label: 'To Lower Case',
|
|
491
|
+
keybindings: [this.ctrlKeyMod | monaco__namespace.KeyMod.Shift | monaco__namespace.KeyCode.KeyL],
|
|
492
|
+
run: function run(editor) {
|
|
493
|
+
var selectedRange = editor.getSelection();
|
|
494
|
+
var selectedText = editor.getModel().getValueInRange(selectedRange);
|
|
495
|
+
var lowerCaseText = selectedText.toLowerCase();
|
|
496
|
+
editor.executeEdits('toLowerCase', [{
|
|
497
|
+
range: selectedRange,
|
|
498
|
+
text: lowerCaseText
|
|
499
|
+
}]);
|
|
500
|
+
}
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
}, {
|
|
504
|
+
key: "isMac",
|
|
505
|
+
value: function isMac() {
|
|
506
|
+
var uaData = navigator.userAgentData;
|
|
507
|
+
return uaData ? uaData.platform === 'macOS' : /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
|
508
|
+
}
|
|
509
|
+
}]);
|
|
510
|
+
}();
|
|
511
|
+
|
|
406
512
|
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); }
|
|
407
513
|
function _regeneratorRuntime() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = 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(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(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; }
|
|
408
514
|
function asyncGeneratorStep(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); }
|
|
@@ -530,8 +636,10 @@ define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/edito
|
|
|
530
636
|
new KustoCommandHighlighter(editor);
|
|
531
637
|
if (isStandaloneCodeEditor(editor)) {
|
|
532
638
|
new KustoCommandFormatter(editor);
|
|
639
|
+
new CaseInvertor(editor);
|
|
533
640
|
}
|
|
534
641
|
triggerSuggestDialogWhenCompletionItemSelected(editor);
|
|
642
|
+
dateStringWrapper(editor);
|
|
535
643
|
});
|
|
536
644
|
function triggerSuggestDialogWhenCompletionItemSelected(editor) {
|
|
537
645
|
editor.onDidChangeCursorSelection(function (event) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 13.
|
|
3
|
+
* monaco-kusto version: 13.1.1(178105a761985a9b7c16d45b528f829e1c112ff0)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
7
7
|
|
|
8
|
-
define('vs/language/kusto/schema-
|
|
8
|
+
define('vs/language/kusto/schema-46504958', ['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,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 13.
|
|
3
|
+
* monaco-kusto version: 13.1.1(178105a761985a9b7c16d45b528f829e1c112ff0)
|
|
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/types-
|
|
8
|
+
define('vs/language/kusto/types-7f893d92', ['exports'], (function (exports) { 'use strict';
|
|
9
9
|
|
|
10
10
|
var LANGUAGE_ID = 'kusto';
|
|
11
11
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
|
+
/**
|
|
3
|
+
* Registers a Kusto-specific action to close the IntelliSense suggestions popup.
|
|
4
|
+
*
|
|
5
|
+
* Note:
|
|
6
|
+
* We register the action on the first cursor movement, not on editor creation,
|
|
7
|
+
* because Monaco fires 'onDidCreateEditor' before the keybinding service is fully initialized.
|
|
8
|
+
* Waiting for a cursor event guarantees that the editor is fully ready
|
|
9
|
+
* and allows safe registration of actions with keybindings.
|
|
10
|
+
*/
|
|
11
|
+
export default class CaseInvertor {
|
|
12
|
+
private editor;
|
|
13
|
+
private actionsRegistered;
|
|
14
|
+
private readonly ctrlKeyMod;
|
|
15
|
+
constructor(editor: monaco.editor.IStandaloneCodeEditor);
|
|
16
|
+
private registerUpperCaseHandler;
|
|
17
|
+
private registerLowerCaseHandler;
|
|
18
|
+
private isMac;
|
|
19
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
|
+
/**
|
|
3
|
+
* Registers a Kusto-specific action to close the IntelliSense suggestions popup.
|
|
4
|
+
*
|
|
5
|
+
* Note:
|
|
6
|
+
* We register the action on the first cursor movement, not on editor creation,
|
|
7
|
+
* because Monaco fires 'onDidCreateEditor' before the keybinding service is fully initialized.
|
|
8
|
+
* Waiting for a cursor event guarantees that the editor is fully ready
|
|
9
|
+
* and allows safe registration of actions with keybindings.
|
|
10
|
+
*/
|
|
11
|
+
var CaseInvertor = /** @class */ (function () {
|
|
12
|
+
function CaseInvertor(editor) {
|
|
13
|
+
var _this = this;
|
|
14
|
+
this.editor = editor;
|
|
15
|
+
this.actionsRegistered = false;
|
|
16
|
+
this.ctrlKeyMod = this.isMac() ? monaco.KeyMod.WinCtrl : monaco.KeyMod.CtrlCmd;
|
|
17
|
+
this.editor.onDidChangeCursorSelection(function () {
|
|
18
|
+
var _a;
|
|
19
|
+
if (((_a = _this.editor.getModel()) === null || _a === void 0 ? void 0 : _a.getLanguageId()) !== 'kusto') {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (!_this.actionsRegistered) {
|
|
23
|
+
_this.registerUpperCaseHandler();
|
|
24
|
+
_this.registerLowerCaseHandler();
|
|
25
|
+
_this.actionsRegistered = true;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
CaseInvertor.prototype.registerUpperCaseHandler = function () {
|
|
30
|
+
this.editor.addAction({
|
|
31
|
+
id: 'kusto.toUpperCase',
|
|
32
|
+
label: 'To Upper Case',
|
|
33
|
+
keybindings: [this.ctrlKeyMod | monaco.KeyMod.Shift | monaco.KeyCode.KeyU],
|
|
34
|
+
run: function (editor) {
|
|
35
|
+
var selectedRange = editor.getSelection();
|
|
36
|
+
var selectedText = editor.getModel().getValueInRange(selectedRange);
|
|
37
|
+
var upperCaseText = selectedText.toUpperCase();
|
|
38
|
+
editor.executeEdits('toUpperCase', [
|
|
39
|
+
{
|
|
40
|
+
range: selectedRange,
|
|
41
|
+
text: upperCaseText,
|
|
42
|
+
},
|
|
43
|
+
]);
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
CaseInvertor.prototype.registerLowerCaseHandler = function () {
|
|
48
|
+
this.editor.addAction({
|
|
49
|
+
id: 'kusto.toLowerCase',
|
|
50
|
+
label: 'To Lower Case',
|
|
51
|
+
keybindings: [this.ctrlKeyMod | monaco.KeyMod.Shift | monaco.KeyCode.KeyL],
|
|
52
|
+
run: function (editor) {
|
|
53
|
+
var selectedRange = editor.getSelection();
|
|
54
|
+
var selectedText = editor.getModel().getValueInRange(selectedRange);
|
|
55
|
+
var lowerCaseText = selectedText.toLowerCase();
|
|
56
|
+
editor.executeEdits('toLowerCase', [
|
|
57
|
+
{
|
|
58
|
+
range: selectedRange,
|
|
59
|
+
text: lowerCaseText,
|
|
60
|
+
},
|
|
61
|
+
]);
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
CaseInvertor.prototype.isMac = function () {
|
|
66
|
+
var uaData = navigator.userAgentData;
|
|
67
|
+
return uaData ? uaData.platform === 'macOS' : /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
|
68
|
+
};
|
|
69
|
+
return CaseInvertor;
|
|
70
|
+
}());
|
|
71
|
+
export default CaseInvertor;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
|
+
export function dateStringWrapper(editor) {
|
|
3
|
+
editor.onDidPaste(function (event) {
|
|
4
|
+
var range = event.range;
|
|
5
|
+
if (!range)
|
|
6
|
+
return;
|
|
7
|
+
var model = editor.getModel();
|
|
8
|
+
var pasted = model.getValueInRange(range);
|
|
9
|
+
if (!isBareIsoDate(pasted))
|
|
10
|
+
return;
|
|
11
|
+
var wrapped = "datetime(".concat(pasted, ")");
|
|
12
|
+
var edit = {
|
|
13
|
+
range: range,
|
|
14
|
+
text: wrapped,
|
|
15
|
+
forceMoveMarkers: true,
|
|
16
|
+
};
|
|
17
|
+
var cursorStateComputer = function () {
|
|
18
|
+
var startOffset = model.getOffsetAt(range.getStartPosition());
|
|
19
|
+
var endPos = model.getPositionAt(startOffset + wrapped.length);
|
|
20
|
+
return [new monaco.Selection(endPos.lineNumber, endPos.column, endPos.lineNumber, endPos.column)];
|
|
21
|
+
};
|
|
22
|
+
editor.executeEdits('paste-date', [edit], cursorStateComputer);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export function isBareIsoDate(text) {
|
|
26
|
+
var s = text.trim();
|
|
27
|
+
return /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}Z)?$/.test(s);
|
|
28
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 13.
|
|
3
|
+
* monaco-kusto version: 13.1.1(178105a761985a9b7c16d45b528f829e1c112ff0)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 13.
|
|
3
|
+
* monaco-kusto version: 13.1.1(178105a761985a9b7c16d45b528f829e1c112ff0)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import * as worker from 'monaco-editor/esm/vs/editor/editor.worker';
|
|
9
9
|
import * as ls from 'vscode-languageserver-types';
|
|
10
10
|
import XRegExp from 'xregexp';
|
|
11
|
-
import { d as getEntityDataTypeFromCslType, a as getCallName, b as getExpression, g as getCslTypeNameFromClrType } from './schema-
|
|
11
|
+
import { d as getEntityDataTypeFromCslType, a as getCallName, b as getExpression, g as getCslTypeNameFromClrType } from './schema-c46b688b.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';
|
package/release/esm/kustoMode.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 13.
|
|
3
|
+
* monaco-kusto version: 13.1.1(178105a761985a9b7c16d45b528f829e1c112ff0)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
@@ -9,7 +9,7 @@ import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
|
9
9
|
import { languages } from 'monaco-editor/esm/vs/editor/editor.api';
|
|
10
10
|
import * as ls from 'vscode-languageserver-types';
|
|
11
11
|
import debounce from 'lodash-es/debounce';
|
|
12
|
-
import { L as LANGUAGE_ID, T as Token, t as tokenTypes } from './globals-
|
|
12
|
+
import { L as LANGUAGE_ID, T as Token, t as tokenTypes } from './globals-ab5bacd5.js';
|
|
13
13
|
|
|
14
14
|
class WorkerManager {
|
|
15
15
|
constructor(_monacoInstance, defaults) {
|