@kusto/monaco-kusto 6.1.0 → 6.1.2
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 +757 -0
- package/copyMonacoFilesAMD.js +28 -0
- package/package.json +14 -34
- package/release/dev/Kusto.Language.Bridge.min.js +2 -0
- package/release/dev/bridge.min.js +7 -0
- package/release/dev/kusto.javascript.client.min.js +1 -0
- package/release/dev/kustoMode.js +55 -22
- package/release/dev/kustoWorker.js +119 -118
- package/release/dev/{main-ac12725e.js → main-1f7cc4fa.js} +2 -2
- package/release/dev/monaco.contribution.js +7 -9
- package/release/dev/newtonsoft.json.min.js +7 -0
- package/release/esm/commandFormatter.d.ts +1 -1
- package/release/esm/commandHighlighter.d.ts +2 -2
- package/release/esm/extendedEditor.d.ts +1 -1
- package/release/esm/kusto.worker.js +28 -37
- package/release/esm/kustoMode.d.ts +3 -1
- package/release/esm/kustoMode.js +44 -16
- package/release/esm/kustoWorker.d.ts +5 -8
- package/release/esm/languageFeatures.d.ts +1 -1
- package/release/esm/languageService/kustoLanguageService.d.ts +2 -1
- package/release/esm/languageService/kustoMonarchLanguageDefinition.d.ts +2 -1
- package/release/esm/languageService/renderInfo.d.ts +5 -5
- package/release/esm/monaco.contribution.d.ts +3 -3
- package/release/esm/monaco.contribution.js +10 -8
- package/release/esm/workerManager.d.ts +1 -1
- package/release/min/kustoMode.js +2 -2
- package/release/min/kustoWorker.js +4 -4
- package/release/min/{main-5b1cc297.js → main-d13ce646.js} +2 -2
- package/release/min/monaco.contribution.js +2 -2
- package/release/dev/commandFormatter.d.ts +0 -6
- package/release/dev/commandHighlighter.d.ts +0 -20
- package/release/dev/extendedEditor.d.ts +0 -7
- package/release/dev/kustoMode.d.ts +0 -8
- package/release/dev/kustoWorker.d.ts +0 -92
- package/release/dev/languageFeatures.d.ts +0 -91
- package/release/dev/languageService/kustoLanguageService.d.ts +0 -143
- package/release/dev/languageService/kustoMonarchLanguageDefinition.d.ts +0 -1
- package/release/dev/languageService/renderInfo.d.ts +0 -31
- package/release/dev/languageService/schema.d.ts +0 -144
- package/release/dev/languageService/settings.d.ts +0 -30
- package/release/dev/monaco.contribution.d.ts +0 -15
- package/release/dev/workerManager.d.ts +0 -23
- package/release/min/commandFormatter.d.ts +0 -6
- package/release/min/commandHighlighter.d.ts +0 -20
- package/release/min/extendedEditor.d.ts +0 -7
- package/release/min/kustoMode.d.ts +0 -8
- package/release/min/kustoWorker.d.ts +0 -92
- package/release/min/languageFeatures.d.ts +0 -91
- package/release/min/languageService/kustoLanguageService.d.ts +0 -143
- package/release/min/languageService/kustoMonarchLanguageDefinition.d.ts +0 -1
- package/release/min/languageService/renderInfo.d.ts +0 -31
- package/release/min/languageService/schema.d.ts +0 -144
- package/release/min/languageService/settings.d.ts +0 -30
- package/release/min/monaco.contribution.d.ts +0 -15
- package/release/min/monaco.d.ts +0 -1
- package/release/min/workerManager.d.ts +0 -23
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="../monaco" />
|
|
2
|
-
/// <reference types="monaco-editor
|
|
2
|
+
/// <reference types="monaco-editor/monaco" />
|
|
3
3
|
/**
|
|
4
4
|
* Highlights the command that surround cursor location
|
|
5
5
|
*/
|
|
@@ -10,7 +10,7 @@ export default class KustoCommandHighlighter implements monaco.editor.IEditorCon
|
|
|
10
10
|
private disposables;
|
|
11
11
|
private decorations;
|
|
12
12
|
/**
|
|
13
|
-
* Register to cursor movement and
|
|
13
|
+
* Register to cursor movement and selection events.
|
|
14
14
|
* @param editor monaco editor instance
|
|
15
15
|
*/
|
|
16
16
|
constructor(editor: monaco.editor.ICodeEditor);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="../monaco" />
|
|
2
|
-
/// <reference types="monaco-editor
|
|
2
|
+
/// <reference types="monaco-editor/monaco" />
|
|
3
3
|
/**
|
|
4
4
|
* Extending ICode editor to contain additional kusto-specific methods.
|
|
5
5
|
* note that the extend method needs to be called at least once to take affect, otherwise this here code is useless.
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 6.1.
|
|
3
|
+
* monaco-kusto version: 6.1.2(4c9ec21ad04b49f9f8e8a8f7fe773fe9a8b47334)
|
|
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
|
-
import * as worker from 'monaco-editor
|
|
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 '@kusto/language-service/bridge.min';
|
|
12
|
+
import '@kusto/language-service/Kusto.JavaScript.Client.min';
|
|
13
|
+
import '@kusto/language-service/newtonsoft.json.min';
|
|
14
|
+
import '@kusto/language-service-next/Kusto.Language.Bridge.min';
|
|
11
15
|
|
|
12
16
|
// Definition of schema object in the context of language services. This model is exposed to consumers of this library.
|
|
13
17
|
|
|
14
18
|
// an input parameter either be a scalar in which case it has a name, type and cslType, or it can be columnar, in which case
|
|
15
19
|
// it will have a name, and a list of scalar types which are the column types.
|
|
16
|
-
|
|
17
20
|
/**
|
|
18
21
|
* Schema types:
|
|
19
22
|
* Engine – The main schema type. Contains clusters, databases, tables, table columns and functions.
|
|
20
23
|
* Cluster Manager – Internal only. A schema for clusters that manages other clusters.
|
|
21
24
|
* Data Management – Internal only. A schema for ingestion point operations.
|
|
22
25
|
*/
|
|
23
|
-
|
|
24
26
|
const dotnetTypeToKustoType = {
|
|
25
27
|
'System.SByte': 'bool',
|
|
26
28
|
'System.Byte': 'uint8',
|
|
@@ -76,28 +78,8 @@ const getInputParameterAsCslString = inputParameter => {
|
|
|
76
78
|
}
|
|
77
79
|
};
|
|
78
80
|
|
|
79
|
-
// polyfill string endsWith
|
|
80
|
-
if (!String.prototype.endsWith) {
|
|
81
|
-
String.prototype.endsWith = function (search, this_len) {
|
|
82
|
-
if (this_len === undefined || this_len > this.length) {
|
|
83
|
-
this_len = this.length;
|
|
84
|
-
}
|
|
85
|
-
return this.substring(this_len - search.length, this_len) === search;
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// If we're running in a web worker - which doesn't share global context with the main thread -
|
|
90
|
-
// we need to manually load dependencies that are not explicit- meaning our non-module dependencies
|
|
91
|
-
// generated by Bridge.Net
|
|
92
|
-
if (typeof document == 'undefined') {
|
|
93
|
-
// monaco will run the worker from vs/base/worker so the relative path needs to be from there (hence going up 2 dirs)
|
|
94
|
-
importScripts('../../language/kusto/bridge.min.js');
|
|
95
|
-
importScripts('../../language/kusto/kusto.javascript.client.min.js');
|
|
96
|
-
importScripts('../../language/kusto/Kusto.Language.Bridge.min.js');
|
|
97
|
-
}
|
|
98
81
|
var k = Kusto.Data.IntelliSense;
|
|
99
82
|
var parsing = Kusto.Language.Parsing;
|
|
100
|
-
Kusto.Language.Syntax;
|
|
101
83
|
var k2 = Kusto.Language.Editor;
|
|
102
84
|
var sym = Kusto.Language.Symbols;
|
|
103
85
|
var GlobalState = Kusto.Language.GlobalState;
|
|
@@ -119,15 +101,7 @@ class ParseProperties {
|
|
|
119
101
|
return true;
|
|
120
102
|
}
|
|
121
103
|
}
|
|
122
|
-
let TokenKind
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* A plain old javascript object that is roughly equivalent to the @kusto/language-service-next object, but without
|
|
126
|
-
* all the Bridge.Net properties and methods. this object is being sent from web worker to main thread and turns out
|
|
127
|
-
* that when posting the message we lose all properties (and functions), thus we use a POJO instead.
|
|
128
|
-
* This issue started happening once upgrading to 0.20.0 from 0.15.5.
|
|
129
|
-
*/
|
|
130
|
-
(function (TokenKind) {
|
|
104
|
+
let TokenKind = /*#__PURE__*/function (TokenKind) {
|
|
131
105
|
TokenKind[TokenKind["TableToken"] = 2] = "TableToken";
|
|
132
106
|
TokenKind[TokenKind["TableColumnToken"] = 4] = "TableColumnToken";
|
|
133
107
|
TokenKind[TokenKind["OperatorToken"] = 8] = "OperatorToken";
|
|
@@ -147,7 +121,16 @@ let TokenKind;
|
|
|
147
121
|
TokenKind[TokenKind["PluginToken"] = 131072] = "PluginToken";
|
|
148
122
|
TokenKind[TokenKind["BracketRangeToken"] = 262144] = "BracketRangeToken";
|
|
149
123
|
TokenKind[TokenKind["ClientDirectiveToken"] = 524288] = "ClientDirectiveToken";
|
|
150
|
-
|
|
124
|
+
return TokenKind;
|
|
125
|
+
}({});
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* A plain old javascript object that is roughly equivalent to the @kusto/language-service-next object, but without
|
|
129
|
+
* all the Bridge.Net properties and methods. this object is being sent from web worker to main thread and turns out
|
|
130
|
+
* that when posting the message we lose all properties (and functions), thus we use a POJO instead.
|
|
131
|
+
* This issue started happening once upgrading to 0.20.0 from 0.15.5.
|
|
132
|
+
*/
|
|
133
|
+
|
|
151
134
|
/**
|
|
152
135
|
* convert the bridge.net object to a plain javascript object that only contains data.
|
|
153
136
|
* @param k2Classifications @kusto/language-service-next bridge.net object
|
|
@@ -379,7 +362,11 @@ class KustoLanguageService {
|
|
|
379
362
|
const lsItem = ls.CompletionItem.create(kItem.DisplayText);
|
|
380
363
|
|
|
381
364
|
// Adding to columns a prefix to their sortText so they will appear first in the list
|
|
382
|
-
|
|
365
|
+
let sortTextPrefix = lsItem.kind === ls.CompletionItemKind.Field ? 0 : itemsAsArray.length;
|
|
366
|
+
const countOfWords = lsItem.label.split('_').length;
|
|
367
|
+
// We always want results with multiple words to show after shorter options.
|
|
368
|
+
// For example: to show "count_distinct" after "count"
|
|
369
|
+
sortTextPrefix = sortTextPrefix * countOfWords;
|
|
383
370
|
const startPosition = document.positionAt(completionItems.EditStart);
|
|
384
371
|
const endPosition = document.positionAt(completionItems.EditStart + completionItems.EditLength);
|
|
385
372
|
lsItem.textEdit = ls.TextEdit.replace(ls.Range.create(startPosition, endPosition), textToInsert);
|
|
@@ -2128,9 +2115,13 @@ class KustoWorker {
|
|
|
2128
2115
|
}
|
|
2129
2116
|
}
|
|
2130
2117
|
} = result;
|
|
2131
|
-
const range = new monaco.Range(start.line + 1, start.character + 1, end.line + 1, end.character + 1);
|
|
2132
2118
|
return {
|
|
2133
|
-
range
|
|
2119
|
+
range: {
|
|
2120
|
+
startLineNumber: start.line + 1,
|
|
2121
|
+
startColumn: start.character + 1,
|
|
2122
|
+
endLineNumber: end.line + 1,
|
|
2123
|
+
endColumn: end.character + 1
|
|
2124
|
+
},
|
|
2134
2125
|
text
|
|
2135
2126
|
};
|
|
2136
2127
|
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
/// <reference types="../monaco" />
|
|
2
|
+
/// <reference types="monaco-editor/monaco" />
|
|
1
3
|
import type { LanguageServiceDefaultsImpl } from './monaco.contribution';
|
|
2
4
|
import { WorkerAccessor } from './languageFeatures';
|
|
3
5
|
/**
|
|
4
6
|
* Called when Kusto language is first needed (a model has the language set)
|
|
5
7
|
* @param defaults
|
|
6
8
|
*/
|
|
7
|
-
export declare function setupMode(defaults: LanguageServiceDefaultsImpl, monacoInstance:
|
|
9
|
+
export declare function setupMode(defaults: LanguageServiceDefaultsImpl, monacoInstance: typeof monaco): WorkerAccessor;
|
|
8
10
|
export declare function getKustoWorker(): Promise<WorkerAccessor>;
|
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: 6.1.
|
|
3
|
+
* monaco-kusto version: 6.1.2(4c9ec21ad04b49f9f8e8a8f7fe773fe9a8b47334)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
@@ -98,10 +98,13 @@ const KustoLanguageDefinition = {
|
|
|
98
98
|
displayName: 'Kusto',
|
|
99
99
|
defaultToken: 'invalid',
|
|
100
100
|
brackets: [['[', ']', 'delimiter.square'], ['(', ')', 'delimiter.parenthesis']],
|
|
101
|
+
// types are wrong
|
|
101
102
|
wordDefinition: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
|
102
103
|
// .slice() call is for creating a shallow copy of the array since bridge.net shoves a $type property on the array which monaco doesn't like.
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
// Kusto.Data.IntelliSense.CslCommandParser.PromotedOperatorCommandTokens.slice(0),
|
|
105
|
+
promotedOperatorCommandTokens: ['where', 'count', 'extend', 'join', 'limit', 'order', 'project', 'project-away', 'project-rename', 'project-reorder', 'project-keep', 'render', 'sort', 'summarize', 'distinct', 'take', 'top', 'top-nested', 'top-hitters', 'union', 'mv-expand', 'mv-apply', 'reduce', 'evaluate', 'parse', 'parse-where', 'parse-kv', 'sample', 'sample-distinct', 'make-series', 'getschema', 'serialize', 'invoke', 'as', 'scan'],
|
|
106
|
+
// Kusto.Data.IntelliSense.CslCommandParser.OperatorCommandTokens.slice(0),
|
|
107
|
+
operatorCommandTokens: ['filter', 'fork', 'facet', 'range', 'consume', 'find', 'search', 'print', 'partition', 'lookup', 'where', 'count', 'extend', 'join', 'limit', 'order', 'project', 'project-away', 'project-rename', 'project-reorder', 'project-keep', 'render', 'sort', 'summarize', 'distinct', 'take', 'top', 'top-nested', 'top-hitters', 'union', 'mv-expand', 'mv-apply', 'reduce', 'evaluate', 'parse', 'parse-where', 'parse-kv', 'sample', 'sample-distinct', 'make-series', 'getschema', 'serialize', 'invoke', 'as', 'scan'],
|
|
105
108
|
keywords: ['by', 'on', 'contains', 'notcontains', 'containscs', 'notcontainscs', 'startswith', 'has', 'matches', 'regex', 'true', 'false', 'and', 'or', 'typeof', 'int', 'string', 'date', 'datetime', 'time', 'long', 'real', 'boolean', 'bool'],
|
|
106
109
|
operators: ['+', '-', '*', '/', '>', '<', '==', '<>', '<=', '>=', '~', '!~'],
|
|
107
110
|
builtinFunctions: ['countof', 'bin', 'extentid', 'extract', 'extractjson', 'floor', 'iif', 'isnull', 'isnotnull', 'notnull', 'isempty', 'isnotempty', 'notempty', 'now', 're2', 'strcat', 'strlen', 'toupper', 'tostring', 'count', 'cnt', 'sum', 'min', 'max', 'avg'],
|
|
@@ -176,8 +179,7 @@ monaco.Position;
|
|
|
176
179
|
var Range = monaco.Range;
|
|
177
180
|
monaco.Thenable;
|
|
178
181
|
monaco.CancellationToken;
|
|
179
|
-
monaco.IDisposable;
|
|
180
|
-
var ClassificationKind = Kusto.Language.Editor.ClassificationKind;
|
|
182
|
+
monaco.IDisposable; // --- diagnostics ---
|
|
181
183
|
class DiagnosticsAdapter {
|
|
182
184
|
_disposables = [];
|
|
183
185
|
_contentListener = Object.create(null);
|
|
@@ -455,6 +457,41 @@ function toDiagnostics(resource, diag) {
|
|
|
455
457
|
source: diag.source
|
|
456
458
|
};
|
|
457
459
|
}
|
|
460
|
+
/**
|
|
461
|
+
* Copy of Kusto.Language.Editor.ClassificationKind we don't have to depend on it in this file
|
|
462
|
+
*/
|
|
463
|
+
const ClassificationKind = {
|
|
464
|
+
PlainText: 0,
|
|
465
|
+
Comment: 1,
|
|
466
|
+
Punctuation: 2,
|
|
467
|
+
Directive: 3,
|
|
468
|
+
Literal: 4,
|
|
469
|
+
StringLiteral: 5,
|
|
470
|
+
Type: 6,
|
|
471
|
+
Column: 7,
|
|
472
|
+
Table: 8,
|
|
473
|
+
Database: 9,
|
|
474
|
+
Function: 10,
|
|
475
|
+
Parameter: 11,
|
|
476
|
+
Variable: 12,
|
|
477
|
+
Identifier: 13,
|
|
478
|
+
ClientParameter: 14,
|
|
479
|
+
QueryParameter: 15,
|
|
480
|
+
ScalarOperator: 16,
|
|
481
|
+
MathOperator: 17,
|
|
482
|
+
QueryOperator: 18,
|
|
483
|
+
Command: 19,
|
|
484
|
+
Keyword: 20,
|
|
485
|
+
MaterializedView: 21,
|
|
486
|
+
SchemaMember: 22,
|
|
487
|
+
SignatureParameter: 23,
|
|
488
|
+
Option: 24
|
|
489
|
+
};
|
|
490
|
+
const ClassificationKindNames = {};
|
|
491
|
+
for (const [key, value] of Object.entries(ClassificationKind)) {
|
|
492
|
+
ClassificationKindNames[value] = key;
|
|
493
|
+
}
|
|
494
|
+
|
|
458
495
|
// commented here is the color definitions are were defined by v1 intellisense terminology:
|
|
459
496
|
// { token: 'comment', foreground: '008000' }, // CommentToken Green
|
|
460
497
|
// { token: 'variable.predefined', foreground: '800080' }, // CalculatedColumnToken Purple
|
|
@@ -654,20 +691,11 @@ class ColorizationAdapter {
|
|
|
654
691
|
}
|
|
655
692
|
}
|
|
656
693
|
|
|
657
|
-
/**
|
|
658
|
-
* Gets all keys of an enum (the string keys not the numeric values).
|
|
659
|
-
* @param e Enum type
|
|
660
|
-
*/
|
|
661
|
-
function getEnumKeys(e) {
|
|
662
|
-
return Object.keys(e).filter(k => typeof e[k] === 'number');
|
|
663
|
-
}
|
|
664
|
-
|
|
665
694
|
/**
|
|
666
695
|
* Generates a mapping between ClassificationKind and color.
|
|
667
696
|
*/
|
|
668
697
|
function getClassificationColorTriplets() {
|
|
669
|
-
const
|
|
670
|
-
const result = keys.map(key => ({
|
|
698
|
+
const result = Object.keys(ClassificationKind).map(key => ({
|
|
671
699
|
classification: key,
|
|
672
700
|
colorLight: classificationToColorLight[key],
|
|
673
701
|
colorDark: classificationToColorDark[key]
|
|
@@ -704,7 +732,7 @@ function toDecoration(model, classification) {
|
|
|
704
732
|
const start = model.getPositionAt(classification.start);
|
|
705
733
|
const end = model.getPositionAt(classification.start + classification.length);
|
|
706
734
|
const range = new Range(start.lineNumber, start.column, end.lineNumber, end.column);
|
|
707
|
-
const inlineClassName =
|
|
735
|
+
const inlineClassName = ClassificationKindNames[classification.kind];
|
|
708
736
|
return {
|
|
709
737
|
range,
|
|
710
738
|
options: {
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
/// <reference types="monaco-editor
|
|
2
|
-
|
|
1
|
+
/// <reference types="monaco-editor/monaco" />
|
|
2
|
+
import * as ls from 'vscode-languageserver-types';
|
|
3
3
|
import * as kustoService from './languageService/kustoLanguageService';
|
|
4
4
|
import type { LanguageSettings } from './languageService/settings';
|
|
5
5
|
import { Schema, showSchema, ScalarParameter, Database, TabularParameter } from './languageService/schema';
|
|
6
|
-
import * as ls from 'vscode-languageserver-types';
|
|
7
6
|
import type { ColorizationRange } from './languageService/kustoLanguageService';
|
|
8
7
|
import type { RenderInfo } from './languageService/renderInfo';
|
|
9
|
-
import type { FoldingRange } from 'vscode-languageserver-types';
|
|
10
8
|
export declare class KustoWorker {
|
|
11
9
|
private _ctx;
|
|
12
10
|
private _languageService;
|
|
13
11
|
private _languageId;
|
|
14
12
|
private _languageSettings;
|
|
15
|
-
constructor(ctx: IWorkerContext, createData: ICreateData);
|
|
13
|
+
constructor(ctx: monaco.worker.IWorkerContext, createData: ICreateData);
|
|
16
14
|
setSchema(schema: Schema): Promise<void>;
|
|
17
15
|
addClusterToSchema(uri: string, clusterName: string, databasesNames: string[]): Promise<void>;
|
|
18
16
|
addDatabaseToSchema(uri: string, clusterName: string, databaseSchema: Database): Promise<void>;
|
|
@@ -60,7 +58,7 @@ export declare class KustoWorker {
|
|
|
60
58
|
}[], includeWarnings?: boolean, includeSuggestions?: boolean): Promise<ls.Diagnostic[]>;
|
|
61
59
|
getResultActions(uri: string, start: number, end: number): Promise<kustoService.ResultAction[]>;
|
|
62
60
|
doRangeFormat(uri: string, range: ls.Range): Promise<ls.TextEdit[]>;
|
|
63
|
-
doFolding(uri: string): Promise<FoldingRange[]>;
|
|
61
|
+
doFolding(uri: string): Promise<ls.FoldingRange[]>;
|
|
64
62
|
doDocumentFormat(uri: string): Promise<ls.TextEdit[]>;
|
|
65
63
|
doCurrentCommandFormat(uri: string, caretPosition: ls.Position): Promise<ls.TextEdit[]>;
|
|
66
64
|
doColorization(uri: string, colorizationIntervals: {
|
|
@@ -88,5 +86,4 @@ export interface ICreateData {
|
|
|
88
86
|
languageId: string;
|
|
89
87
|
languageSettings: LanguageSettings;
|
|
90
88
|
}
|
|
91
|
-
export declare function create(ctx: IWorkerContext, createData: ICreateData): KustoWorker;
|
|
92
|
-
export {};
|
|
89
|
+
export declare function create(ctx: monaco.worker.IWorkerContext, createData: ICreateData): KustoWorker;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="@kusto/language-service-next/Kusto.Language.Bridge" />
|
|
2
2
|
/// <reference types="@kusto/language-service/Kusto.JavaScript.Client" />
|
|
3
|
-
import * as s from './schema';
|
|
4
3
|
import * as ls from 'vscode-languageserver-types';
|
|
5
4
|
import type { TextDocument } from 'vscode-languageserver-textdocument';
|
|
6
5
|
import type { FoldingRange } from 'vscode-languageserver-types';
|
|
6
|
+
import * as s from './schema';
|
|
7
7
|
import type { LanguageSettings } from './settings';
|
|
8
|
+
import 'language-service';
|
|
8
9
|
import k = Kusto.Data.IntelliSense;
|
|
9
10
|
import k2 = Kusto.Language.Editor;
|
|
10
11
|
import { Database } from './schema';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="monaco-editor/monaco" />
|
|
2
|
+
export declare const KustoLanguageDefinition: monaco.languages.IMonarchLanguage;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
1
|
+
export type VisualizationType = 'anomalychart' | 'areachart' | 'barchart' | 'columnchart' | 'ladderchart' | 'linechart' | 'piechart' | 'pivotchart' | 'scatterchart' | 'stackedareachart' | 'timechart' | 'table' | 'timeline' | 'timepivot' | 'card';
|
|
2
|
+
export type Scale = 'linear' | 'log';
|
|
3
|
+
export type LegendVisibility = 'visible' | 'hidden';
|
|
4
|
+
export type YSplit = 'none' | 'axes' | 'panels';
|
|
5
|
+
export type Kind = 'default' | 'unstacked' | 'stacked' | 'stacked100' | 'map';
|
|
6
6
|
export interface RenderOptions {
|
|
7
7
|
visualization?: null | VisualizationType;
|
|
8
8
|
title?: null | string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/// <reference types="../monaco" />
|
|
2
|
-
/// <reference types="monaco-editor
|
|
3
|
-
import
|
|
2
|
+
/// <reference types="monaco-editor/monaco" />
|
|
3
|
+
import 'monaco-editor';
|
|
4
4
|
export declare class LanguageServiceDefaultsImpl implements monaco.languages.kusto.LanguageServiceDefaults {
|
|
5
5
|
private _onDidChange;
|
|
6
6
|
private _languageSettings;
|
|
7
7
|
private _workerMaxIdleTime;
|
|
8
8
|
constructor(languageSettings: monaco.languages.kusto.LanguageSettings);
|
|
9
|
-
get onDidChange(): IEvent<monaco.languages.kusto.LanguageServiceDefaults>;
|
|
9
|
+
get onDidChange(): monaco.IEvent<monaco.languages.kusto.LanguageServiceDefaults>;
|
|
10
10
|
get languageSettings(): monaco.languages.kusto.LanguageSettings;
|
|
11
11
|
setLanguageSettings(options: monaco.languages.kusto.LanguageSettings): void;
|
|
12
12
|
setMaximumWorkerIdleTime(value: number): void;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 6.1.
|
|
3
|
+
* monaco-kusto version: 6.1.2(4c9ec21ad04b49f9f8e8a8f7fe773fe9a8b47334)
|
|
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
|
+
import 'monaco-editor';
|
|
9
|
+
|
|
8
10
|
/**
|
|
9
11
|
* Highlights the command that surround cursor location
|
|
10
12
|
*/
|
|
@@ -17,12 +19,12 @@ class KustoCommandHighlighter {
|
|
|
17
19
|
decorations = [];
|
|
18
20
|
|
|
19
21
|
/**
|
|
20
|
-
* Register to cursor movement and
|
|
22
|
+
* Register to cursor movement and selection events.
|
|
21
23
|
* @param editor monaco editor instance
|
|
22
24
|
*/
|
|
23
25
|
constructor(editor) {
|
|
24
26
|
this.editor = editor;
|
|
25
|
-
// Note that selection update is triggered not only for selection changes, but also just when no text selection is
|
|
27
|
+
// 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.
|
|
26
28
|
// This case is counted as a 0-length selection starting and ending on the cursor position.
|
|
27
29
|
this.editor.onDidChangeCursorSelection(changeEvent => {
|
|
28
30
|
if (this.editor.getModel().getLanguageId() !== 'kusto') {
|
|
@@ -129,15 +131,15 @@ function extend(editor) {
|
|
|
129
131
|
};
|
|
130
132
|
}
|
|
131
133
|
|
|
132
|
-
|
|
133
|
-
monaco.IEvent;
|
|
134
|
-
|
|
135
|
-
// declare var require: <T>(moduleId: [string], callback: (module: T) => void) => void;
|
|
134
|
+
// Import monaco-editor to ensure "monaco" global is available before any other
|
|
136
135
|
|
|
137
136
|
// --- Kusto configuration and defaults ---------
|
|
138
137
|
|
|
139
138
|
class LanguageServiceDefaultsImpl {
|
|
140
|
-
_onDidChange = new Emitter();
|
|
139
|
+
_onDidChange = new monaco.Emitter();
|
|
140
|
+
|
|
141
|
+
// in milliseconds. For example - this is 2 minutes 2 * 60 * 1000
|
|
142
|
+
|
|
141
143
|
constructor(languageSettings) {
|
|
142
144
|
this.setLanguageSettings(languageSettings);
|
|
143
145
|
// default to never kill worker when idle.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="../monaco" />
|
|
2
|
-
/// <reference types="monaco-editor
|
|
2
|
+
/// <reference types="monaco-editor/monaco" />
|
|
3
3
|
import type { LanguageServiceDefaultsImpl } from './monaco.contribution';
|
|
4
4
|
import type { KustoWorker } from './kustoWorker';
|
|
5
5
|
type Uri = monaco.Uri;
|