@kusto/monaco-kusto 4.1.7 → 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.7",
3
+ "version": "4.1.8",
4
4
  "description": "CSL, KQL plugin for the Monaco Editor",
5
5
  "author": {
6
6
  "name": "Microsoft"
@@ -308,22 +308,18 @@ define('vs/language/kusto/monaco.contribution',["require", "exports", "./command
308
308
  if (kustoDefaults &&
309
309
  kustoDefaults.languageSettings &&
310
310
  kustoDefaults.languageSettings.openSuggestionDialogAfterPreviousSuggestionAccepted) {
311
- var didAcceptSuggestion = event.source === 'modelChange' &&
312
- event.reason === monaco.editor.CursorChangeReason.RecoverFromMarkers;
311
+ var didAcceptSuggestion = event.source === 'snippet' && event.reason === monaco.editor.CursorChangeReason.NotSet;
313
312
  if (!didAcceptSuggestion) {
314
313
  return;
315
314
  }
316
315
  event.selection;
317
- var completionText = editor.getModel().getValueInRange(event.selection);
318
- if (completionText[completionText.length - 1] === ' ') {
319
- // OK so now we in a situation where we know a suggestion was selected and we want to trigger another one.
320
- // the only problem is that the suggestion widget itself listens to this same event in order to know it needs to close.
321
- // The only problem is that we're ahead in line, so we're triggering a suggest operation that will be shut down once
322
- // the next callback is called. This is why we're waiting here - to let all the callbacks run synchronously and be
323
- // the 'last' subscriber to run. Granted this is hacky, but until monaco provides a specific event for suggestions,
324
- // this is the best we have.
325
- setTimeout(function () { return editor.trigger('monaco-kusto', 'editor.action.triggerSuggest', {}); }, 10);
326
- }
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);
327
323
  }
328
324
  });
329
325
  }
@@ -171,22 +171,18 @@ export function setupMonacoKusto(monacoInstance) {
171
171
  if (kustoDefaults &&
172
172
  kustoDefaults.languageSettings &&
173
173
  kustoDefaults.languageSettings.openSuggestionDialogAfterPreviousSuggestionAccepted) {
174
- var didAcceptSuggestion = event.source === 'modelChange' &&
175
- event.reason === monaco.editor.CursorChangeReason.RecoverFromMarkers;
174
+ var didAcceptSuggestion = event.source === 'snippet' && event.reason === monaco.editor.CursorChangeReason.NotSet;
176
175
  if (!didAcceptSuggestion) {
177
176
  return;
178
177
  }
179
178
  event.selection;
180
- var completionText = editor.getModel().getValueInRange(event.selection);
181
- if (completionText[completionText.length - 1] === ' ') {
182
- // OK so now we in a situation where we know a suggestion was selected and we want to trigger another one.
183
- // the only problem is that the suggestion widget itself listens to this same event in order to know it needs to close.
184
- // The only problem is that we're ahead in line, so we're triggering a suggest operation that will be shut down once
185
- // the next callback is called. This is why we're waiting here - to let all the callbacks run synchronously and be
186
- // the 'last' subscriber to run. Granted this is hacky, but until monaco provides a specific event for suggestions,
187
- // this is the best we have.
188
- setTimeout(function () { return editor.trigger('monaco-kusto', 'editor.action.triggerSuggest', {}); }, 10);
189
- }
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);
190
186
  }
191
187
  });
192
188
  }
@@ -1,6 +1,6 @@
1
1
  /*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * monaco-kusto version: 4.1.7(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.7(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.7(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:{"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(!("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)}));