@kusto/monaco-kusto 6.1.1 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/package.json +1 -1
- package/release/dev/kustoMode.js +45 -31
- package/release/dev/kustoWorker.js +6 -4
- package/release/dev/{main-068f3954.js → main-81df16b2.js} +2 -2
- package/release/dev/monaco.contribution.js +252 -241
- package/release/esm/kusto.worker.js +6 -4
- package/release/esm/kustoMode.d.ts +3 -3
- package/release/esm/kustoMode.js +10 -15
- package/release/esm/languageFeatures.d.ts +15 -19
- package/release/esm/monaco.contribution.d.ts +9 -8
- package/release/esm/monaco.contribution.js +229 -238
- package/release/esm/workerManager.d.ts +1 -2
- package/release/min/kustoMode.js +2 -2
- package/release/min/kustoWorker.js +3 -3
- package/release/min/{main-f5378257.js → main-bf0e83c5.js} +2 -2
- package/release/min/monaco.contribution.js +2 -2
- package/release/monaco.d.ts +1 -8
- 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 -10
- package/release/dev/kustoWorker.d.ts +0 -89
- package/release/dev/languageFeatures.d.ts +0 -91
- package/release/dev/languageService/kustoLanguageService.d.ts +0 -144
- package/release/dev/languageService/kustoMonarchLanguageDefinition.d.ts +0 -2
- 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 -10
- package/release/min/kustoWorker.d.ts +0 -89
- package/release/min/languageFeatures.d.ts +0 -91
- package/release/min/languageService/kustoLanguageService.d.ts +0 -144
- package/release/min/languageService/kustoMonarchLanguageDefinition.d.ts +0 -2
- 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,15 +1,11 @@
|
|
|
1
|
-
/// <reference types="monaco-editor/monaco" />
|
|
2
1
|
/// <reference types="../monaco" />
|
|
2
|
+
/// <reference types="monaco-editor/monaco" />
|
|
3
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
3
4
|
import type { LanguageServiceDefaultsImpl } from './monaco.contribution';
|
|
4
5
|
import type { KustoWorker } from './kustoWorker';
|
|
5
|
-
import Uri = monaco.Uri;
|
|
6
|
-
import Position = monaco.Position;
|
|
7
|
-
import Range = monaco.Range;
|
|
8
|
-
import Thenable = monaco.Thenable;
|
|
9
|
-
import CancellationToken = monaco.CancellationToken;
|
|
10
6
|
import type { Schema } from './languageService/schema';
|
|
11
7
|
export interface WorkerAccessor {
|
|
12
|
-
(first: Uri, ...more: Uri[]): Promise<KustoWorker>;
|
|
8
|
+
(first: monaco.Uri, ...more: monaco.Uri[]): Promise<KustoWorker>;
|
|
13
9
|
}
|
|
14
10
|
export declare class DiagnosticsAdapter {
|
|
15
11
|
private _monacoInstance;
|
|
@@ -22,7 +18,7 @@ export declare class DiagnosticsAdapter {
|
|
|
22
18
|
private _schemaListener;
|
|
23
19
|
private _cursorListener;
|
|
24
20
|
private _debouncedValidations;
|
|
25
|
-
constructor(_monacoInstance: typeof monaco, _languageId: string, _worker: WorkerAccessor, defaults: LanguageServiceDefaultsImpl, onSchemaChange: monaco.IEvent<Schema>);
|
|
21
|
+
constructor(_monacoInstance: typeof globalThis.monaco, _languageId: string, _worker: WorkerAccessor, defaults: LanguageServiceDefaultsImpl, onSchemaChange: monaco.IEvent<Schema>);
|
|
26
22
|
private getMonacoCodeActions;
|
|
27
23
|
private getOrCreateDebouncedValidation;
|
|
28
24
|
dispose(): void;
|
|
@@ -37,11 +33,11 @@ export declare class ColorizationAdapter {
|
|
|
37
33
|
private _configurationListener;
|
|
38
34
|
private _schemaListener;
|
|
39
35
|
private decorations;
|
|
40
|
-
constructor(_monacoInstance: typeof monaco, _languageId: string, _worker: WorkerAccessor, defaults: LanguageServiceDefaultsImpl, onSchemaChange: monaco.IEvent<Schema>);
|
|
36
|
+
constructor(_monacoInstance: typeof globalThis.monaco, _languageId: string, _worker: WorkerAccessor, defaults: LanguageServiceDefaultsImpl, onSchemaChange: monaco.IEvent<Schema>);
|
|
41
37
|
dispose(): void;
|
|
42
38
|
/**
|
|
43
39
|
* Return true if the range doesn't intersect any of the line ranges.
|
|
44
|
-
* @param range Range
|
|
40
|
+
* @param range monaco.Range
|
|
45
41
|
* @param impactedLineRanges an array of line ranges
|
|
46
42
|
*/
|
|
47
43
|
private _rangeDoesNotIntersectAny;
|
|
@@ -50,42 +46,42 @@ export declare class ColorizationAdapter {
|
|
|
50
46
|
export declare class CompletionAdapter implements monaco.languages.CompletionItemProvider {
|
|
51
47
|
private _worker;
|
|
52
48
|
private languageSettings;
|
|
53
|
-
constructor(_worker: WorkerAccessor, languageSettings: monaco.languages.kusto.LanguageSettings);
|
|
49
|
+
constructor(_worker: WorkerAccessor, languageSettings: globalThis.monaco.languages.kusto.LanguageSettings);
|
|
54
50
|
get triggerCharacters(): string[];
|
|
55
|
-
provideCompletionItems(model: monaco.editor.IReadOnlyModel, position: Position, context: monaco.languages.CompletionContext, token: CancellationToken): Thenable<monaco.languages.CompletionList>;
|
|
51
|
+
provideCompletionItems(model: monaco.editor.IReadOnlyModel, position: monaco.Position, context: monaco.languages.CompletionContext, token: monaco.CancellationToken): monaco.Thenable<monaco.languages.CompletionList>;
|
|
56
52
|
}
|
|
57
53
|
export declare class DefinitionAdapter {
|
|
58
54
|
private _worker;
|
|
59
55
|
constructor(_worker: WorkerAccessor);
|
|
60
|
-
provideDefinition(model: monaco.editor.IReadOnlyModel, position: Position, token: CancellationToken): Thenable<monaco.languages.Definition>;
|
|
56
|
+
provideDefinition(model: monaco.editor.IReadOnlyModel, position: monaco.Position, token: monaco.CancellationToken): monaco.Thenable<monaco.languages.Definition>;
|
|
61
57
|
}
|
|
62
58
|
export declare class ReferenceAdapter implements monaco.languages.ReferenceProvider {
|
|
63
59
|
private _worker;
|
|
64
60
|
constructor(_worker: WorkerAccessor);
|
|
65
|
-
provideReferences(model: monaco.editor.IReadOnlyModel, position: Position, context: monaco.languages.ReferenceContext, token: CancellationToken): Thenable<monaco.languages.Location[]>;
|
|
61
|
+
provideReferences(model: monaco.editor.IReadOnlyModel, position: monaco.Position, context: monaco.languages.ReferenceContext, token: monaco.CancellationToken): monaco.Thenable<monaco.languages.Location[]>;
|
|
66
62
|
}
|
|
67
63
|
export declare class RenameAdapter implements monaco.languages.RenameProvider {
|
|
68
64
|
private _worker;
|
|
69
65
|
constructor(_worker: WorkerAccessor);
|
|
70
|
-
provideRenameEdits(model: monaco.editor.IReadOnlyModel, position: Position, newName: string, token: CancellationToken): Thenable<monaco.languages.WorkspaceEdit>;
|
|
66
|
+
provideRenameEdits(model: monaco.editor.IReadOnlyModel, position: monaco.Position, newName: string, token: monaco.CancellationToken): monaco.Thenable<monaco.languages.WorkspaceEdit>;
|
|
71
67
|
}
|
|
72
68
|
export declare class DocumentFormatAdapter implements monaco.languages.DocumentFormattingEditProvider {
|
|
73
69
|
private _worker;
|
|
74
70
|
constructor(_worker: WorkerAccessor);
|
|
75
|
-
provideDocumentFormattingEdits(model: monaco.editor.IReadOnlyModel, options: monaco.languages.FormattingOptions, token: CancellationToken): monaco.languages.TextEdit[] | Thenable<monaco.languages.TextEdit[]>;
|
|
71
|
+
provideDocumentFormattingEdits(model: monaco.editor.IReadOnlyModel, options: monaco.languages.FormattingOptions, token: monaco.CancellationToken): monaco.languages.TextEdit[] | monaco.Thenable<monaco.languages.TextEdit[]>;
|
|
76
72
|
}
|
|
77
73
|
export declare class FormatAdapter implements monaco.languages.DocumentRangeFormattingEditProvider {
|
|
78
74
|
private _worker;
|
|
79
75
|
constructor(_worker: WorkerAccessor);
|
|
80
|
-
provideDocumentRangeFormattingEdits(model: monaco.editor.IReadOnlyModel, range: Range, options: monaco.languages.FormattingOptions, token: CancellationToken): monaco.languages.TextEdit[] | Thenable<monaco.languages.TextEdit[]>;
|
|
76
|
+
provideDocumentRangeFormattingEdits(model: monaco.editor.IReadOnlyModel, range: monaco.Range, options: monaco.languages.FormattingOptions, token: monaco.CancellationToken): monaco.languages.TextEdit[] | monaco.Thenable<monaco.languages.TextEdit[]>;
|
|
81
77
|
}
|
|
82
78
|
export declare class FoldingAdapter implements monaco.languages.FoldingRangeProvider {
|
|
83
79
|
private _worker;
|
|
84
80
|
constructor(_worker: WorkerAccessor);
|
|
85
|
-
provideFoldingRanges(model: monaco.editor.ITextModel, context: monaco.languages.FoldingContext, token: CancellationToken): monaco.languages.FoldingRange[] | PromiseLike<monaco.languages.FoldingRange[]>;
|
|
81
|
+
provideFoldingRanges(model: monaco.editor.ITextModel, context: monaco.languages.FoldingContext, token: monaco.CancellationToken): monaco.languages.FoldingRange[] | PromiseLike<monaco.languages.FoldingRange[]>;
|
|
86
82
|
}
|
|
87
83
|
export declare class HoverAdapter implements monaco.languages.HoverProvider {
|
|
88
84
|
private _worker;
|
|
89
85
|
constructor(_worker: WorkerAccessor);
|
|
90
|
-
provideHover(model: monaco.editor.IReadOnlyModel, position: Position, token: CancellationToken): Thenable<monaco.languages.Hover>;
|
|
86
|
+
provideHover(model: monaco.editor.IReadOnlyModel, position: monaco.Position, token: monaco.CancellationToken): monaco.Thenable<monaco.languages.Hover>;
|
|
91
87
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/// <reference types="../monaco" />
|
|
2
|
-
|
|
3
|
-
import '
|
|
4
|
-
export declare class LanguageServiceDefaultsImpl implements monaco.languages.kusto.LanguageServiceDefaults {
|
|
2
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
3
|
+
import type { KustoWorker } from './kustoWorker';
|
|
4
|
+
export declare class LanguageServiceDefaultsImpl implements globalThis.globalThis.monaco.languages.kusto.LanguageServiceDefaults {
|
|
5
5
|
private _onDidChange;
|
|
6
6
|
private _languageSettings;
|
|
7
7
|
private _workerMaxIdleTime;
|
|
8
|
-
constructor(languageSettings: monaco.languages.kusto.LanguageSettings);
|
|
9
|
-
get onDidChange(): monaco.IEvent<monaco.languages.kusto.LanguageServiceDefaults>;
|
|
10
|
-
get languageSettings(): monaco.languages.kusto.LanguageSettings;
|
|
11
|
-
setLanguageSettings(options: monaco.languages.kusto.LanguageSettings): void;
|
|
8
|
+
constructor(languageSettings: globalThis.monaco.languages.kusto.LanguageSettings);
|
|
9
|
+
get onDidChange(): monaco.IEvent<globalThis.monaco.languages.kusto.LanguageServiceDefaults>;
|
|
10
|
+
get languageSettings(): globalThis.monaco.languages.kusto.LanguageSettings;
|
|
11
|
+
setLanguageSettings(options: globalThis.monaco.languages.kusto.LanguageSettings): void;
|
|
12
12
|
setMaximumWorkerIdleTime(value: number): void;
|
|
13
13
|
getWorkerMaxIdleTime(): number;
|
|
14
14
|
}
|
|
15
|
-
export declare function
|
|
15
|
+
export declare function getKustoWorker(): Promise<(first: monaco.Uri, ...more: monaco.Uri[]) => Promise<KustoWorker>>;
|
|
16
|
+
export declare const kustoDefaults: LanguageServiceDefaultsImpl;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 6.
|
|
3
|
+
* monaco-kusto version: 6.2.0(8e26147bc7c3b5a7a3bc6ee55311dfa0b612c10c)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
7
7
|
|
|
8
|
-
import 'monaco-editor';
|
|
8
|
+
import * as monaco$1 from 'monaco-editor/esm/vs/editor/editor.api';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Highlights the command that surround cursor location
|
|
@@ -66,7 +66,7 @@ class KustoCommandFormatter {
|
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
// Theoretically you would expect this code to run only once in onDidCreateEditor.
|
|
69
|
-
// Turns out that onDidCreateEditor is fired before the IStandaloneEditor is completely created (it is
|
|
69
|
+
// Turns out that onDidCreateEditor is fired before the IStandaloneEditor is completely created (it is emitted by
|
|
70
70
|
// the super ctor before the child ctor was able to fully run).
|
|
71
71
|
// Thus we don't have a key binding provided yet when onDidCreateEditor is run, which is essential to call addAction.
|
|
72
72
|
// By adding the action here in onDidChangeCursorSelection we're making sure that the editor has a key binding provider,
|
|
@@ -131,12 +131,13 @@ function extend(editor) {
|
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
// Import monaco-editor to ensure "monaco" global is available before any other
|
|
135
|
-
|
|
136
134
|
// --- Kusto configuration and defaults ---------
|
|
137
135
|
|
|
138
136
|
class LanguageServiceDefaultsImpl {
|
|
139
|
-
_onDidChange = new monaco.Emitter();
|
|
137
|
+
_onDidChange = new monaco$1.Emitter();
|
|
138
|
+
|
|
139
|
+
// in milliseconds. For example - this is 2 minutes 2 * 60 * 1000
|
|
140
|
+
|
|
140
141
|
constructor(languageSettings) {
|
|
141
142
|
this.setLanguageSettings(languageSettings);
|
|
142
143
|
// default to never kill worker when idle.
|
|
@@ -197,244 +198,234 @@ function getKustoWorker() {
|
|
|
197
198
|
function withMode(callback) {
|
|
198
199
|
import('./kustoMode.js').then(callback);
|
|
199
200
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
201
|
+
const kustoDefaults = new LanguageServiceDefaultsImpl(defaultLanguageSettings);
|
|
202
|
+
monaco$1.languages.onLanguage('kusto', () => {
|
|
203
|
+
withMode(mode => mode.setupMode(kustoDefaults, monaco$1));
|
|
204
|
+
});
|
|
205
|
+
monaco$1.languages.register({
|
|
206
|
+
id: 'kusto',
|
|
207
|
+
extensions: ['.csl', '.kql']
|
|
208
|
+
});
|
|
209
|
+
monaco$1.editor.defineTheme('kusto-light', {
|
|
210
|
+
base: 'vs',
|
|
211
|
+
inherit: true,
|
|
212
|
+
rules: [{
|
|
213
|
+
token: 'comment',
|
|
214
|
+
foreground: '008000'
|
|
215
|
+
},
|
|
216
|
+
// CommentToken Green
|
|
217
|
+
{
|
|
218
|
+
token: 'variable.predefined',
|
|
219
|
+
foreground: '800080'
|
|
220
|
+
},
|
|
221
|
+
// CalculatedColumnToken Purple
|
|
222
|
+
{
|
|
223
|
+
token: 'function',
|
|
224
|
+
foreground: '0000FF'
|
|
225
|
+
},
|
|
226
|
+
// FunctionNameToken Blue
|
|
227
|
+
{
|
|
228
|
+
token: 'operator.sql',
|
|
229
|
+
foreground: 'CC3700'
|
|
230
|
+
},
|
|
231
|
+
// _WAS_ OperatorToken OrangeRed, but wasn't accessible.
|
|
232
|
+
{
|
|
233
|
+
token: 'string',
|
|
234
|
+
foreground: 'B22222'
|
|
235
|
+
},
|
|
236
|
+
// StringLiteralToken Firebrick
|
|
237
|
+
{
|
|
238
|
+
token: 'operator.scss',
|
|
239
|
+
foreground: '0000FF'
|
|
240
|
+
},
|
|
241
|
+
// SubOperatorToken Blue
|
|
242
|
+
{
|
|
243
|
+
token: 'variable',
|
|
244
|
+
foreground: 'C71585'
|
|
245
|
+
},
|
|
246
|
+
// TableColumnToken MediumVioletRed
|
|
247
|
+
{
|
|
248
|
+
token: 'variable.parameter',
|
|
249
|
+
foreground: '9932CC'
|
|
250
|
+
},
|
|
251
|
+
// TableToken DarkOrchid
|
|
252
|
+
{
|
|
253
|
+
token: '',
|
|
254
|
+
foreground: '000000'
|
|
255
|
+
},
|
|
256
|
+
// UnknownToken, PlainTextToken Black
|
|
257
|
+
{
|
|
258
|
+
token: 'type',
|
|
259
|
+
foreground: '0000FF'
|
|
260
|
+
},
|
|
261
|
+
// DataTypeToken Blue
|
|
262
|
+
{
|
|
263
|
+
token: 'tag',
|
|
264
|
+
foreground: '0000FF'
|
|
265
|
+
},
|
|
266
|
+
// ControlCommandToken Blue
|
|
267
|
+
{
|
|
268
|
+
token: 'annotation',
|
|
269
|
+
foreground: '2B91AF'
|
|
270
|
+
},
|
|
271
|
+
// QueryParametersToken FF2B91AF
|
|
272
|
+
{
|
|
273
|
+
token: 'keyword',
|
|
274
|
+
foreground: '0000FF'
|
|
275
|
+
},
|
|
276
|
+
// CslCommandToken, PluginToken Blue
|
|
277
|
+
{
|
|
278
|
+
token: 'number',
|
|
279
|
+
foreground: '191970'
|
|
280
|
+
},
|
|
281
|
+
// LetVariablesToken MidnightBlue
|
|
282
|
+
{
|
|
283
|
+
token: 'annotation',
|
|
284
|
+
foreground: '9400D3'
|
|
285
|
+
},
|
|
286
|
+
// ClientDirectiveToken DarkViolet
|
|
287
|
+
{
|
|
288
|
+
token: 'invalid',
|
|
289
|
+
background: 'cd3131'
|
|
290
|
+
}],
|
|
291
|
+
colors: {}
|
|
292
|
+
});
|
|
293
|
+
monaco$1.editor.defineTheme('kusto-dark', {
|
|
294
|
+
base: 'vs-dark',
|
|
295
|
+
inherit: true,
|
|
296
|
+
rules: [{
|
|
297
|
+
token: 'comment',
|
|
298
|
+
foreground: '608B4E'
|
|
299
|
+
},
|
|
300
|
+
// CommentToken Green
|
|
301
|
+
{
|
|
302
|
+
token: 'variable.predefined',
|
|
303
|
+
foreground: '4ec9b0'
|
|
304
|
+
},
|
|
305
|
+
// CalculatedColumnToken Purple
|
|
306
|
+
{
|
|
307
|
+
token: 'function',
|
|
308
|
+
foreground: 'dcdcaa'
|
|
309
|
+
},
|
|
310
|
+
// FunctionNameToken Blue
|
|
311
|
+
{
|
|
312
|
+
token: 'operator.sql',
|
|
313
|
+
foreground: '9cdcfe'
|
|
314
|
+
},
|
|
315
|
+
// OperatorToken OrangeRed
|
|
316
|
+
{
|
|
317
|
+
token: 'string',
|
|
318
|
+
foreground: 'ce9178'
|
|
319
|
+
},
|
|
320
|
+
// StringLiteralToken Firebrick
|
|
321
|
+
{
|
|
322
|
+
token: 'operator.scss',
|
|
323
|
+
foreground: '569cd6'
|
|
324
|
+
},
|
|
325
|
+
// SubOperatorToken Blue
|
|
326
|
+
{
|
|
327
|
+
token: 'variable',
|
|
328
|
+
foreground: '4ec9b0'
|
|
329
|
+
},
|
|
330
|
+
// TableColumnToken MediumVioletRed
|
|
331
|
+
{
|
|
332
|
+
token: 'variable.parameter',
|
|
333
|
+
foreground: 'c586c0'
|
|
334
|
+
},
|
|
335
|
+
// TableToken DarkOrchid
|
|
336
|
+
{
|
|
337
|
+
token: '',
|
|
338
|
+
foreground: 'd4d4d4'
|
|
339
|
+
},
|
|
340
|
+
// UnknownToken, PlainTextToken Black
|
|
341
|
+
{
|
|
342
|
+
token: 'type',
|
|
343
|
+
foreground: '569cd6'
|
|
344
|
+
},
|
|
345
|
+
// DataTypeToken Blue
|
|
346
|
+
{
|
|
347
|
+
token: 'tag',
|
|
348
|
+
foreground: '569cd6'
|
|
349
|
+
},
|
|
350
|
+
// ControlCommandToken Blue
|
|
351
|
+
{
|
|
352
|
+
token: 'annotation',
|
|
353
|
+
foreground: '9cdcfe'
|
|
354
|
+
},
|
|
355
|
+
// QueryParametersToken FF2B91AF
|
|
356
|
+
{
|
|
357
|
+
token: 'keyword',
|
|
358
|
+
foreground: '569cd6'
|
|
359
|
+
},
|
|
360
|
+
// CslCommandToken, PluginToken Blue
|
|
361
|
+
{
|
|
362
|
+
token: 'number',
|
|
363
|
+
foreground: 'd7ba7d'
|
|
364
|
+
},
|
|
365
|
+
// LetVariablesToken MidnightBlue
|
|
366
|
+
{
|
|
367
|
+
token: 'annotation',
|
|
368
|
+
foreground: 'b5cea8'
|
|
369
|
+
},
|
|
370
|
+
// ClientDirectiveToken DarkViolet
|
|
371
|
+
{
|
|
372
|
+
token: 'invalid',
|
|
373
|
+
background: 'cd3131'
|
|
374
|
+
}],
|
|
375
|
+
colors: {
|
|
376
|
+
// see: https://code.visualstudio.com/api/references/theme-color#editor-widget-colors
|
|
207
377
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
token: 'comment',
|
|
221
|
-
foreground: '008000'
|
|
222
|
-
},
|
|
223
|
-
// CommentToken Green
|
|
224
|
-
{
|
|
225
|
-
token: 'variable.predefined',
|
|
226
|
-
foreground: '800080'
|
|
227
|
-
},
|
|
228
|
-
// CalculatedColumnToken Purple
|
|
229
|
-
{
|
|
230
|
-
token: 'function',
|
|
231
|
-
foreground: '0000FF'
|
|
232
|
-
},
|
|
233
|
-
// FunctionNameToken Blue
|
|
234
|
-
{
|
|
235
|
-
token: 'operator.sql',
|
|
236
|
-
foreground: 'CC3700'
|
|
237
|
-
},
|
|
238
|
-
// _WAS_ OperatorToken OrangeRed, but wasn't accessible.
|
|
239
|
-
{
|
|
240
|
-
token: 'string',
|
|
241
|
-
foreground: 'B22222'
|
|
242
|
-
},
|
|
243
|
-
// StringLiteralToken Firebrick
|
|
244
|
-
{
|
|
245
|
-
token: 'operator.scss',
|
|
246
|
-
foreground: '0000FF'
|
|
247
|
-
},
|
|
248
|
-
// SubOperatorToken Blue
|
|
249
|
-
{
|
|
250
|
-
token: 'variable',
|
|
251
|
-
foreground: 'C71585'
|
|
252
|
-
},
|
|
253
|
-
// TableColumnToken MediumVioletRed
|
|
254
|
-
{
|
|
255
|
-
token: 'variable.parameter',
|
|
256
|
-
foreground: '9932CC'
|
|
257
|
-
},
|
|
258
|
-
// TableToken DarkOrchid
|
|
259
|
-
{
|
|
260
|
-
token: '',
|
|
261
|
-
foreground: '000000'
|
|
262
|
-
},
|
|
263
|
-
// UnknownToken, PlainTextToken Black
|
|
264
|
-
{
|
|
265
|
-
token: 'type',
|
|
266
|
-
foreground: '0000FF'
|
|
267
|
-
},
|
|
268
|
-
// DataTypeToken Blue
|
|
269
|
-
{
|
|
270
|
-
token: 'tag',
|
|
271
|
-
foreground: '0000FF'
|
|
272
|
-
},
|
|
273
|
-
// ControlCommandToken Blue
|
|
274
|
-
{
|
|
275
|
-
token: 'annotation',
|
|
276
|
-
foreground: '2B91AF'
|
|
277
|
-
},
|
|
278
|
-
// QueryParametersToken FF2B91AF
|
|
279
|
-
{
|
|
280
|
-
token: 'keyword',
|
|
281
|
-
foreground: '0000FF'
|
|
282
|
-
},
|
|
283
|
-
// CslCommandToken, PluginToken Blue
|
|
284
|
-
{
|
|
285
|
-
token: 'number',
|
|
286
|
-
foreground: '191970'
|
|
287
|
-
},
|
|
288
|
-
// LetVariablesToken MidnightBlue
|
|
289
|
-
{
|
|
290
|
-
token: 'annotation',
|
|
291
|
-
foreground: '9400D3'
|
|
292
|
-
},
|
|
293
|
-
// ClientDirectiveToken DarkViolet
|
|
294
|
-
{
|
|
295
|
-
token: 'invalid',
|
|
296
|
-
background: 'cd3131'
|
|
297
|
-
}],
|
|
298
|
-
colors: {}
|
|
299
|
-
});
|
|
300
|
-
monacoInstance.editor.defineTheme('kusto-dark', {
|
|
301
|
-
base: 'vs-dark',
|
|
302
|
-
inherit: true,
|
|
303
|
-
rules: [{
|
|
304
|
-
token: 'comment',
|
|
305
|
-
foreground: '608B4E'
|
|
306
|
-
},
|
|
307
|
-
// CommentToken Green
|
|
308
|
-
{
|
|
309
|
-
token: 'variable.predefined',
|
|
310
|
-
foreground: '4ec9b0'
|
|
311
|
-
},
|
|
312
|
-
// CalculatedColumnToken Purple
|
|
313
|
-
{
|
|
314
|
-
token: 'function',
|
|
315
|
-
foreground: 'dcdcaa'
|
|
316
|
-
},
|
|
317
|
-
// FunctionNameToken Blue
|
|
318
|
-
{
|
|
319
|
-
token: 'operator.sql',
|
|
320
|
-
foreground: '9cdcfe'
|
|
321
|
-
},
|
|
322
|
-
// OperatorToken OrangeRed
|
|
323
|
-
{
|
|
324
|
-
token: 'string',
|
|
325
|
-
foreground: 'ce9178'
|
|
326
|
-
},
|
|
327
|
-
// StringLiteralToken Firebrick
|
|
328
|
-
{
|
|
329
|
-
token: 'operator.scss',
|
|
330
|
-
foreground: '569cd6'
|
|
331
|
-
},
|
|
332
|
-
// SubOperatorToken Blue
|
|
333
|
-
{
|
|
334
|
-
token: 'variable',
|
|
335
|
-
foreground: '4ec9b0'
|
|
336
|
-
},
|
|
337
|
-
// TableColumnToken MediumVioletRed
|
|
338
|
-
{
|
|
339
|
-
token: 'variable.parameter',
|
|
340
|
-
foreground: 'c586c0'
|
|
341
|
-
},
|
|
342
|
-
// TableToken DarkOrchid
|
|
343
|
-
{
|
|
344
|
-
token: '',
|
|
345
|
-
foreground: 'd4d4d4'
|
|
346
|
-
},
|
|
347
|
-
// UnknownToken, PlainTextToken Black
|
|
348
|
-
{
|
|
349
|
-
token: 'type',
|
|
350
|
-
foreground: '569cd6'
|
|
351
|
-
},
|
|
352
|
-
// DataTypeToken Blue
|
|
353
|
-
{
|
|
354
|
-
token: 'tag',
|
|
355
|
-
foreground: '569cd6'
|
|
356
|
-
},
|
|
357
|
-
// ControlCommandToken Blue
|
|
358
|
-
{
|
|
359
|
-
token: 'annotation',
|
|
360
|
-
foreground: '9cdcfe'
|
|
361
|
-
},
|
|
362
|
-
// QueryParametersToken FF2B91AF
|
|
363
|
-
{
|
|
364
|
-
token: 'keyword',
|
|
365
|
-
foreground: '569cd6'
|
|
366
|
-
},
|
|
367
|
-
// CslCommandToken, PluginToken Blue
|
|
368
|
-
{
|
|
369
|
-
token: 'number',
|
|
370
|
-
foreground: 'd7ba7d'
|
|
371
|
-
},
|
|
372
|
-
// LetVariablesToken MidnightBlue
|
|
373
|
-
{
|
|
374
|
-
token: 'annotation',
|
|
375
|
-
foreground: 'b5cea8'
|
|
376
|
-
},
|
|
377
|
-
// ClientDirectiveToken DarkViolet
|
|
378
|
-
{
|
|
379
|
-
token: 'invalid',
|
|
380
|
-
background: 'cd3131'
|
|
381
|
-
}],
|
|
382
|
-
colors: {
|
|
383
|
-
// see: https://code.visualstudio.com/api/references/theme-color#editor-widget-colors
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
monacoInstance.editor.defineTheme('kusto-dark2', {
|
|
387
|
-
base: 'vs-dark',
|
|
388
|
-
inherit: true,
|
|
389
|
-
rules: [],
|
|
390
|
-
colors: {
|
|
391
|
-
// see: https://code.visualstudio.com/api/references/theme-color#editor-widget-colors
|
|
392
|
-
'editor.background': '#1B1A19',
|
|
393
|
-
// gray 200
|
|
394
|
-
'editorSuggestWidget.selectedBackground': '#004E8C'
|
|
395
|
-
}
|
|
396
|
-
});
|
|
378
|
+
});
|
|
379
|
+
monaco$1.editor.defineTheme('kusto-dark2', {
|
|
380
|
+
base: 'vs-dark',
|
|
381
|
+
inherit: true,
|
|
382
|
+
rules: [],
|
|
383
|
+
colors: {
|
|
384
|
+
// see: https://code.visualstudio.com/api/references/theme-color#editor-widget-colors
|
|
385
|
+
'editor.background': '#1B1A19',
|
|
386
|
+
// gray 200
|
|
387
|
+
'editorSuggestWidget.selectedBackground': '#004E8C'
|
|
388
|
+
}
|
|
389
|
+
});
|
|
397
390
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
391
|
+
// Initialize kusto specific language features that don't currently have a natural way to extend using existing apis.
|
|
392
|
+
// Most other language features are initialized in kustoMode.ts
|
|
393
|
+
monaco$1.editor.onDidCreateEditor(editor => {
|
|
394
|
+
// hook up extension methods to editor.
|
|
395
|
+
extend(editor);
|
|
396
|
+
new KustoCommandHighlighter(editor);
|
|
397
|
+
if (isStandaloneCodeEditor(editor)) {
|
|
398
|
+
new KustoCommandFormatter(editor);
|
|
399
|
+
}
|
|
400
|
+
triggerSuggestDialogWhenCompletionItemSelected(editor);
|
|
401
|
+
});
|
|
402
|
+
function triggerSuggestDialogWhenCompletionItemSelected(editor) {
|
|
403
|
+
editor.onDidChangeCursorSelection(event => {
|
|
404
|
+
// checking the condition inside the event makes sure we will stay up to date when kusto configuration changes at runtime.
|
|
405
|
+
if (kustoDefaults && kustoDefaults.languageSettings && kustoDefaults.languageSettings.openSuggestionDialogAfterPreviousSuggestionAccepted) {
|
|
406
|
+
var didAcceptSuggestion = event.source === 'snippet' && event.reason === monaco$1.editor.CursorChangeReason.NotSet;
|
|
407
|
+
// If the word at the current position is not null - meaning we did not add a space after completion.
|
|
408
|
+
// In this case we don't want to activate the eager mode, since it will display the current selected word..
|
|
409
|
+
if (!didAcceptSuggestion || editor.getModel().getWordAtPosition(event.selection.getPosition()) !== null) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
event.selection;
|
|
413
|
+
// OK so now we in a situation where we know a suggestion was selected and we want to trigger another one.
|
|
414
|
+
// the only problem is that the suggestion widget itself listens to this same event in order to know it needs to close.
|
|
415
|
+
// The only problem is that we're ahead in line, so we're triggering a suggest operation that will be shut down once
|
|
416
|
+
// the next callback is called. This is why we're waiting here - to let all the callbacks run synchronously and be
|
|
417
|
+
// the 'last' subscriber to run. Granted this is hacky, but until monaco provides a specific event for suggestions,
|
|
418
|
+
// this is the best we have.
|
|
419
|
+
setTimeout(() => editor.trigger('monaco-kusto', 'editor.action.triggerSuggest', {}), 10);
|
|
406
420
|
}
|
|
407
|
-
triggerSuggestDialogWhenCompletionItemSelected(editor);
|
|
408
421
|
});
|
|
409
|
-
function triggerSuggestDialogWhenCompletionItemSelected(editor) {
|
|
410
|
-
editor.onDidChangeCursorSelection(event => {
|
|
411
|
-
// checking the condition inside the event makes sure we will stay up to date when kusto configuration changes at runtime.
|
|
412
|
-
if (kustoDefaults && kustoDefaults.languageSettings && kustoDefaults.languageSettings.openSuggestionDialogAfterPreviousSuggestionAccepted) {
|
|
413
|
-
var didAcceptSuggestion = event.source === 'snippet' && event.reason === monaco.editor.CursorChangeReason.NotSet;
|
|
414
|
-
// If the word at the current position is not null - meaning we did not add a space after completion.
|
|
415
|
-
// In this case we don't want to activate the eager mode, since it will display the current selected word..
|
|
416
|
-
if (!didAcceptSuggestion || editor.getModel().getWordAtPosition(event.selection.getPosition()) !== null) {
|
|
417
|
-
return;
|
|
418
|
-
}
|
|
419
|
-
event.selection;
|
|
420
|
-
// OK so now we in a situation where we know a suggestion was selected and we want to trigger another one.
|
|
421
|
-
// the only problem is that the suggestion widget itself listens to this same event in order to know it needs to close.
|
|
422
|
-
// The only problem is that we're ahead in line, so we're triggering a suggest operation that will be shut down once
|
|
423
|
-
// the next callback is called. This is why we're waiting here - to let all the callbacks run synchronously and be
|
|
424
|
-
// the 'last' subscriber to run. Granted this is hacky, but until monaco provides a specific event for suggestions,
|
|
425
|
-
// this is the best we have.
|
|
426
|
-
setTimeout(() => editor.trigger('monaco-kusto', 'editor.action.triggerSuggest', {}), 10);
|
|
427
|
-
}
|
|
428
|
-
});
|
|
429
|
-
}
|
|
430
422
|
}
|
|
431
423
|
function isStandaloneCodeEditor(editor) {
|
|
432
424
|
return editor.addAction !== undefined;
|
|
433
425
|
}
|
|
426
|
+
monaco$1.languages.kusto = {
|
|
427
|
+
kustoDefaults,
|
|
428
|
+
getKustoWorker
|
|
429
|
+
};
|
|
434
430
|
|
|
435
|
-
|
|
436
|
-
if (monaco.editor) {
|
|
437
|
-
setupMonacoKusto(monaco);
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
export { LanguageServiceDefaultsImpl, setupMonacoKusto };
|
|
431
|
+
export { LanguageServiceDefaultsImpl, getKustoWorker, kustoDefaults };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="../monaco" />
|
|
2
2
|
/// <reference types="monaco-editor/monaco" />
|
|
3
|
+
import type { Uri } from 'monaco-editor/esm/vs/editor/editor.api';
|
|
3
4
|
import type { LanguageServiceDefaultsImpl } from './monaco.contribution';
|
|
4
5
|
import type { KustoWorker } from './kustoWorker';
|
|
5
|
-
type Uri = monaco.Uri;
|
|
6
6
|
export declare class WorkerManager {
|
|
7
7
|
private _monacoInstance;
|
|
8
8
|
private _storedState;
|
|
@@ -20,4 +20,3 @@ export declare class WorkerManager {
|
|
|
20
20
|
private _getClient;
|
|
21
21
|
getLanguageServiceWorker(...resources: Uri[]): Promise<KustoWorker>;
|
|
22
22
|
}
|
|
23
|
-
export {};
|