@kusto/monaco-kusto 4.1.5 → 4.1.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kusto/monaco-kusto",
3
- "version": "4.1.5",
3
+ "version": "4.1.8",
4
4
  "description": "CSL, KQL plugin for the Monaco Editor",
5
5
  "author": {
6
6
  "name": "Microsoft"
@@ -277,15 +277,19 @@ define('vs/language/kusto/monaco.contribution',["require", "exports", "./command
277
277
  ],
278
278
  colors: {
279
279
  // see: https://code.visualstudio.com/api/references/theme-color#editor-widget-colors
280
- 'editorSuggestWidget.selectedBackground': '#001191',
281
- 'editorSuggestWidget.background': '#000000',
280
+ 'editor.background': '#1B1A19',
281
+ 'editorSuggestWidget.selectedBackground': '#004E8C',
282
282
  },
283
283
  });
284
284
  monacoInstance.editor.defineTheme('kusto-dark2', {
285
285
  base: 'vs-dark',
286
286
  inherit: true,
287
287
  rules: [],
288
- colors: { 'editor.background': '#1B1A19' },
288
+ colors: {
289
+ // see: https://code.visualstudio.com/api/references/theme-color#editor-widget-colors
290
+ 'editor.background': '#1B1A19',
291
+ 'editorSuggestWidget.selectedBackground': '#004E8C',
292
+ },
289
293
  });
290
294
  // Initialize kusto specific language features that don't currently have a natural way to extend using existing apis.
291
295
  // Most other language features are initialized in kustoMode.ts
@@ -304,22 +308,18 @@ define('vs/language/kusto/monaco.contribution',["require", "exports", "./command
304
308
  if (kustoDefaults &&
305
309
  kustoDefaults.languageSettings &&
306
310
  kustoDefaults.languageSettings.openSuggestionDialogAfterPreviousSuggestionAccepted) {
307
- var didAcceptSuggestion = event.source === 'modelChange' &&
308
- event.reason === monaco.editor.CursorChangeReason.RecoverFromMarkers;
311
+ var didAcceptSuggestion = event.source === 'snippet' && event.reason === monaco.editor.CursorChangeReason.NotSet;
309
312
  if (!didAcceptSuggestion) {
310
313
  return;
311
314
  }
312
315
  event.selection;
313
- var completionText = editor.getModel().getValueInRange(event.selection);
314
- if (completionText[completionText.length - 1] === ' ') {
315
- // OK so now we in a situation where we know a suggestion was selected and we want to trigger another one.
316
- // the only problem is that the suggestion widget itself listens to this same event in order to know it needs to close.
317
- // The only problem is that we're ahead in line, so we're triggering a suggest operation that will be shut down once
318
- // the next callback is called. This is why we're waiting here - to let all the callbacks run synchronously and be
319
- // the 'last' subscriber to run. Granted this is hacky, but until monaco provides a specific event for suggestions,
320
- // this is the best we have.
321
- setTimeout(function () { return editor.trigger('monaco-kusto', 'editor.action.triggerSuggest', {}); }, 10);
322
- }
316
+ // OK so now we in a situation where we know a suggestion was selected and we want to trigger another one.
317
+ // the only problem is that the suggestion widget itself listens to this same event in order to know it needs to close.
318
+ // The only problem is that we're ahead in line, so we're triggering a suggest operation that will be shut down once
319
+ // the next callback is called. This is why we're waiting here - to let all the callbacks run synchronously and be
320
+ // the 'last' subscriber to run. Granted this is hacky, but until monaco provides a specific event for suggestions,
321
+ // this is the best we have.
322
+ setTimeout(function () { return editor.trigger('monaco-kusto', 'editor.action.triggerSuggest', {}); }, 10);
323
323
  }
324
324
  });
325
325
  }
@@ -140,15 +140,19 @@ export function setupMonacoKusto(monacoInstance) {
140
140
  ],
141
141
  colors: {
142
142
  // see: https://code.visualstudio.com/api/references/theme-color#editor-widget-colors
143
- 'editorSuggestWidget.selectedBackground': '#001191',
144
- 'editorSuggestWidget.background': '#000000',
143
+ 'editor.background': '#1B1A19',
144
+ 'editorSuggestWidget.selectedBackground': '#004E8C',
145
145
  },
146
146
  });
147
147
  monacoInstance.editor.defineTheme('kusto-dark2', {
148
148
  base: 'vs-dark',
149
149
  inherit: true,
150
150
  rules: [],
151
- colors: { 'editor.background': '#1B1A19' },
151
+ colors: {
152
+ // see: https://code.visualstudio.com/api/references/theme-color#editor-widget-colors
153
+ 'editor.background': '#1B1A19',
154
+ 'editorSuggestWidget.selectedBackground': '#004E8C',
155
+ },
152
156
  });
153
157
  // Initialize kusto specific language features that don't currently have a natural way to extend using existing apis.
154
158
  // Most other language features are initialized in kustoMode.ts
@@ -167,22 +171,18 @@ export function setupMonacoKusto(monacoInstance) {
167
171
  if (kustoDefaults &&
168
172
  kustoDefaults.languageSettings &&
169
173
  kustoDefaults.languageSettings.openSuggestionDialogAfterPreviousSuggestionAccepted) {
170
- var didAcceptSuggestion = event.source === 'modelChange' &&
171
- event.reason === monaco.editor.CursorChangeReason.RecoverFromMarkers;
174
+ var didAcceptSuggestion = event.source === 'snippet' && event.reason === monaco.editor.CursorChangeReason.NotSet;
172
175
  if (!didAcceptSuggestion) {
173
176
  return;
174
177
  }
175
178
  event.selection;
176
- var completionText = editor.getModel().getValueInRange(event.selection);
177
- if (completionText[completionText.length - 1] === ' ') {
178
- // OK so now we in a situation where we know a suggestion was selected and we want to trigger another one.
179
- // the only problem is that the suggestion widget itself listens to this same event in order to know it needs to close.
180
- // The only problem is that we're ahead in line, so we're triggering a suggest operation that will be shut down once
181
- // the next callback is called. This is why we're waiting here - to let all the callbacks run synchronously and be
182
- // the 'last' subscriber to run. Granted this is hacky, but until monaco provides a specific event for suggestions,
183
- // this is the best we have.
184
- setTimeout(function () { return editor.trigger('monaco-kusto', 'editor.action.triggerSuggest', {}); }, 10);
185
- }
179
+ // OK so now we in a situation where we know a suggestion was selected and we want to trigger another one.
180
+ // the only problem is that the suggestion widget itself listens to this same event in order to know it needs to close.
181
+ // The only problem is that we're ahead in line, so we're triggering a suggest operation that will be shut down once
182
+ // the next callback is called. This is why we're waiting here - to let all the callbacks run synchronously and be
183
+ // the 'last' subscriber to run. Granted this is hacky, but until monaco provides a specific event for suggestions,
184
+ // this is the best we have.
185
+ setTimeout(function () { return editor.trigger('monaco-kusto', 'editor.action.triggerSuggest', {}); }, 10);
186
186
  }
187
187
  });
188
188
  }
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 4.1.5(undefined)
3
+ * monaco-kusto version: 4.1.8(undefined)
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: 4.1.5(undefined)
3
+ * monaco-kusto version: 4.1.8(undefined)
4
4
  * Released under the MIT license
5
5
  * https://https://github.com/Azure/monaco-kusto/blob/master/README.md
6
6
  *-----------------------------------------------------------------------------*/
@@ -1,7 +1,7 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 4.1.5(undefined)
3
+ * monaco-kusto version: 4.1.8(undefined)
4
4
  * Released under the MIT license
5
5
  * https://https://github.com/Azure/monaco-kusto/blob/master/README.md
6
6
  *-----------------------------------------------------------------------------*/
7
- define("vs/language/kusto/commandHighlighter",["require","exports"],(function(e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var t=function(){function e(e){var o=this;this.editor=e,this.disposables=[],this.decorations=[],this.editor.onDidChangeCursorSelection((function(e){"kusto"===o.editor.getModel().getModeId()&&o.highlightCommandUnderCursor(e)}))}return e.prototype.getId=function(){return e.ID},e.prototype.dispose=function(){this.disposables.forEach((function(e){return e.dispose()}))},e.prototype.highlightCommandUnderCursor=function(o){if(o.selection.isEmpty()){var t=[{range:this.editor.getCurrentCommandRange(o.selection.getStartPosition()),options:e.CURRENT_COMMAND_HIGHLIGHT}];this.decorations=this.editor.deltaDecorations(this.decorations,t)}else this.decorations=this.editor.deltaDecorations(this.decorations,[])},e.ID="editor.contrib.kustoCommandHighliter",e.CURRENT_COMMAND_HIGHLIGHT={className:"selectionHighlight"},e}();o.default=t})),define("vs/language/kusto/commandFormatter",["require","exports"],(function(e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var t=function(e){var o=this;this.editor=e,this.actionAdded=!1,e.onDidChangeCursorSelection((function(t){"kusto"===o.editor.getModel().getModeId()&&(o.actionAdded||(e.addAction({id:"editor.action.kusto.formatCurrentCommand",label:"Format Command Under Cursor",keybindings:[monaco.KeyMod.chord(monaco.KeyMod.CtrlCmd|monaco.KeyCode.KEY_K,monaco.KeyMod.CtrlCmd|monaco.KeyCode.KEY_F)],run:function(o){e.trigger("KustoCommandFormatter","editor.action.formatSelection",null)},contextMenuGroupId:"1_modification"}),o.actionAdded=!0))}))};o.default=t})),define("vs/language/kusto/extendedEditor",["require","exports"],(function(e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.extend=void 0,o.extend=function(e){Object.getPrototypeOf(e).getCurrentCommandRange=function(e){for(var o=e.lineNumber-1,t=this.getModel().getLinesContent(),n=0,r=[],i=0;i<t.length;i++){if(""===t[i].trim()?r.push({commandOrdinal:n++,lineNumber:i}):r.push({commandOrdinal:n,lineNumber:i}),i>o&&n>r[o].commandOrdinal)break}var a=r[o].commandOrdinal,d=r.filter((function(e){return e.commandOrdinal===a})),u=d[0].lineNumber+1,s=d[d.length-1].lineNumber+1,g=t[s-1].length+1;return new monaco.Range(u,1,s,g)}}})),define("vs/language/kusto/monaco.contribution",["require","exports","./commandHighlighter","./commandFormatter","./extendedEditor"],(function(e,o,t,n,r){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.setupMonacoKusto=o.LanguageServiceDefaultsImpl=void 0;var i=monaco.Emitter,a=function(){function e(e){this._onDidChange=new i,this.setLanguageSettings(e),this._workerMaxIdleTime=0}return Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageSettings",{get:function(){return this._languageSettings},enumerable:!1,configurable:!0}),e.prototype.setLanguageSettings=function(e){this._languageSettings=e||Object.create(null),this._onDidChange.fire(this)},e.prototype.setMaximumWorkerIdleTime=function(e){this._workerMaxIdleTime=e},e.prototype.getWorkerMaxIdleTime=function(){return this._workerMaxIdleTime},e}();o.LanguageServiceDefaultsImpl=a;var d={includeControlCommands:!0,newlineAfterPipe:!0,openSuggestionDialogAfterPreviousSuggestionAccepted:!0,useIntellisenseV2:!0,useSemanticColorization:!0,useTokenColorization:!0,enableHover:!0,formatter:{indentationSize:4,pipeOperatorStyle:"Smart"},syntaxErrorAsMarkDown:{enableSyntaxErrorAsMarkDown:!1}};function u(){return new Promise((function(e,o){s((function(t){t.getKustoWorker().then(e,o)}))}))}function s(o){e(["vs/language/kusto/kustoMode"],o)}function g(e){var o=new a(d);e.languages.kusto={kustoDefaults:o,getKustoWorker:u},e.languages.onLanguage("kusto",(function(){s((function(t){return t.setupMode(o,e)}))})),e.languages.register({id:"kusto",extensions:[".csl",".kql"]}),e.editor.defineTheme("kusto-light",{base:"vs",inherit:!0,rules:[{token:"comment",foreground:"008000"},{token:"variable.predefined",foreground:"800080"},{token:"function",foreground:"0000FF"},{token:"operator.sql",foreground:"CC3700"},{token:"string",foreground:"B22222"},{token:"operator.scss",foreground:"0000FF"},{token:"variable",foreground:"C71585"},{token:"variable.parameter",foreground:"9932CC"},{token:"",foreground:"000000"},{token:"type",foreground:"0000FF"},{token:"tag",foreground:"0000FF"},{token:"annotation",foreground:"2B91AF"},{token:"keyword",foreground:"0000FF"},{token:"number",foreground:"191970"},{token:"annotation",foreground:"9400D3"},{token:"invalid",background:"cd3131"}],colors:{"editorSuggestWidget.selectedBackground":"#93CFFB","editorSuggestWidget.background":"#FAF9F8"}}),e.editor.defineTheme("kusto-dark",{base:"vs-dark",inherit:!0,rules:[{token:"comment",foreground:"608B4E"},{token:"variable.predefined",foreground:"4ec9b0"},{token:"function",foreground:"dcdcaa"},{token:"operator.sql",foreground:"9cdcfe"},{token:"string",foreground:"ce9178"},{token:"operator.scss",foreground:"569cd6"},{token:"variable",foreground:"4ec9b0"},{token:"variable.parameter",foreground:"c586c0"},{token:"",foreground:"d4d4d4"},{token:"type",foreground:"569cd6"},{token:"tag",foreground:"569cd6"},{token:"annotation",foreground:"9cdcfe"},{token:"keyword",foreground:"569cd6"},{token:"number",foreground:"d7ba7d"},{token:"annotation",foreground:"b5cea8"},{token:"invalid",background:"cd3131"}],colors:{"editorSuggestWidget.selectedBackground":"#001191","editorSuggestWidget.background":"#000000"}}),e.editor.defineTheme("kusto-dark2",{base:"vs-dark",inherit:!0,rules:[],colors:{"editor.background":"#1B1A19"}}),e.editor.onDidCreateEditor((function(e){r.extend(e),new t.default(e),function(e){return void 0!==e.addAction}(e)&&new n.default(e),function(e){e.onDidChangeCursorSelection((function(t){if(o&&o.languageSettings&&o.languageSettings.openSuggestionDialogAfterPreviousSuggestionAccepted){if(!("modelChange"===t.source&&t.reason===monaco.editor.CursorChangeReason.RecoverFromMarkers))return;t.selection;var n=e.getModel().getValueInRange(t.selection);" "===n[n.length-1]&&setTimeout((function(){return e.trigger("monaco-kusto","editor.action.triggerSuggest",{})}),10)}}))}(e)}))}o.setupMonacoKusto=g,monaco.editor&&g(monaco)}));
7
+ define("vs/language/kusto/commandHighlighter",["require","exports"],(function(e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var t=function(){function e(e){var o=this;this.editor=e,this.disposables=[],this.decorations=[],this.editor.onDidChangeCursorSelection((function(e){"kusto"===o.editor.getModel().getModeId()&&o.highlightCommandUnderCursor(e)}))}return e.prototype.getId=function(){return e.ID},e.prototype.dispose=function(){this.disposables.forEach((function(e){return e.dispose()}))},e.prototype.highlightCommandUnderCursor=function(o){if(o.selection.isEmpty()){var t=[{range:this.editor.getCurrentCommandRange(o.selection.getStartPosition()),options:e.CURRENT_COMMAND_HIGHLIGHT}];this.decorations=this.editor.deltaDecorations(this.decorations,t)}else this.decorations=this.editor.deltaDecorations(this.decorations,[])},e.ID="editor.contrib.kustoCommandHighliter",e.CURRENT_COMMAND_HIGHLIGHT={className:"selectionHighlight"},e}();o.default=t})),define("vs/language/kusto/commandFormatter",["require","exports"],(function(e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var t=function(e){var o=this;this.editor=e,this.actionAdded=!1,e.onDidChangeCursorSelection((function(t){"kusto"===o.editor.getModel().getModeId()&&(o.actionAdded||(e.addAction({id:"editor.action.kusto.formatCurrentCommand",label:"Format Command Under Cursor",keybindings:[monaco.KeyMod.chord(monaco.KeyMod.CtrlCmd|monaco.KeyCode.KEY_K,monaco.KeyMod.CtrlCmd|monaco.KeyCode.KEY_F)],run:function(o){e.trigger("KustoCommandFormatter","editor.action.formatSelection",null)},contextMenuGroupId:"1_modification"}),o.actionAdded=!0))}))};o.default=t})),define("vs/language/kusto/extendedEditor",["require","exports"],(function(e,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.extend=void 0,o.extend=function(e){Object.getPrototypeOf(e).getCurrentCommandRange=function(e){for(var o=e.lineNumber-1,t=this.getModel().getLinesContent(),n=0,r=[],i=0;i<t.length;i++){if(""===t[i].trim()?r.push({commandOrdinal:n++,lineNumber:i}):r.push({commandOrdinal:n,lineNumber:i}),i>o&&n>r[o].commandOrdinal)break}var d=r[o].commandOrdinal,a=r.filter((function(e){return e.commandOrdinal===d})),u=a[0].lineNumber+1,s=a[a.length-1].lineNumber+1,g=t[s-1].length+1;return new monaco.Range(u,1,s,g)}}})),define("vs/language/kusto/monaco.contribution",["require","exports","./commandHighlighter","./commandFormatter","./extendedEditor"],(function(e,o,t,n,r){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.setupMonacoKusto=o.LanguageServiceDefaultsImpl=void 0;var i=monaco.Emitter,d=function(){function e(e){this._onDidChange=new i,this.setLanguageSettings(e),this._workerMaxIdleTime=0}return Object.defineProperty(e.prototype,"onDidChange",{get:function(){return this._onDidChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageSettings",{get:function(){return this._languageSettings},enumerable:!1,configurable:!0}),e.prototype.setLanguageSettings=function(e){this._languageSettings=e||Object.create(null),this._onDidChange.fire(this)},e.prototype.setMaximumWorkerIdleTime=function(e){this._workerMaxIdleTime=e},e.prototype.getWorkerMaxIdleTime=function(){return this._workerMaxIdleTime},e}();o.LanguageServiceDefaultsImpl=d;var a={includeControlCommands:!0,newlineAfterPipe:!0,openSuggestionDialogAfterPreviousSuggestionAccepted:!0,useIntellisenseV2:!0,useSemanticColorization:!0,useTokenColorization:!0,enableHover:!0,formatter:{indentationSize:4,pipeOperatorStyle:"Smart"},syntaxErrorAsMarkDown:{enableSyntaxErrorAsMarkDown:!1}};function u(){return new Promise((function(e,o){s((function(t){t.getKustoWorker().then(e,o)}))}))}function s(o){e(["vs/language/kusto/kustoMode"],o)}function g(e){var o=new d(a);e.languages.kusto={kustoDefaults:o,getKustoWorker:u},e.languages.onLanguage("kusto",(function(){s((function(t){return t.setupMode(o,e)}))})),e.languages.register({id:"kusto",extensions:[".csl",".kql"]}),e.editor.defineTheme("kusto-light",{base:"vs",inherit:!0,rules:[{token:"comment",foreground:"008000"},{token:"variable.predefined",foreground:"800080"},{token:"function",foreground:"0000FF"},{token:"operator.sql",foreground:"CC3700"},{token:"string",foreground:"B22222"},{token:"operator.scss",foreground:"0000FF"},{token:"variable",foreground:"C71585"},{token:"variable.parameter",foreground:"9932CC"},{token:"",foreground:"000000"},{token:"type",foreground:"0000FF"},{token:"tag",foreground:"0000FF"},{token:"annotation",foreground:"2B91AF"},{token:"keyword",foreground:"0000FF"},{token:"number",foreground:"191970"},{token:"annotation",foreground:"9400D3"},{token:"invalid",background:"cd3131"}],colors:{"editorSuggestWidget.selectedBackground":"#93CFFB","editorSuggestWidget.background":"#FAF9F8"}}),e.editor.defineTheme("kusto-dark",{base:"vs-dark",inherit:!0,rules:[{token:"comment",foreground:"608B4E"},{token:"variable.predefined",foreground:"4ec9b0"},{token:"function",foreground:"dcdcaa"},{token:"operator.sql",foreground:"9cdcfe"},{token:"string",foreground:"ce9178"},{token:"operator.scss",foreground:"569cd6"},{token:"variable",foreground:"4ec9b0"},{token:"variable.parameter",foreground:"c586c0"},{token:"",foreground:"d4d4d4"},{token:"type",foreground:"569cd6"},{token:"tag",foreground:"569cd6"},{token:"annotation",foreground:"9cdcfe"},{token:"keyword",foreground:"569cd6"},{token:"number",foreground:"d7ba7d"},{token:"annotation",foreground:"b5cea8"},{token:"invalid",background:"cd3131"}],colors:{"editor.background":"#1B1A19","editorSuggestWidget.selectedBackground":"#004E8C"}}),e.editor.defineTheme("kusto-dark2",{base:"vs-dark",inherit:!0,rules:[],colors:{"editor.background":"#1B1A19","editorSuggestWidget.selectedBackground":"#004E8C"}}),e.editor.onDidCreateEditor((function(e){r.extend(e),new t.default(e),function(e){return void 0!==e.addAction}(e)&&new n.default(e),function(e){e.onDidChangeCursorSelection((function(t){if(o&&o.languageSettings&&o.languageSettings.openSuggestionDialogAfterPreviousSuggestionAccepted){if(!("snippet"===t.source&&t.reason===monaco.editor.CursorChangeReason.NotSet))return;t.selection,setTimeout((function(){return e.trigger("monaco-kusto","editor.action.triggerSuggest",{})}),10)}}))}(e)}))}o.setupMonacoKusto=g,monaco.editor&&g(monaco)}));