@kusto/monaco-kusto 11.3.0 → 12.0.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 +23 -1
- package/package.json +3 -1
- package/release/dev/globals-0aacfe72.js +46 -0
- package/release/dev/kustoMode.js +235 -507
- package/release/dev/kustoWorker.js +49 -93
- package/release/dev/{main-80b384b2.js → main-b690e47e.js} +2 -2
- package/release/dev/monaco.contribution.js +235 -201
- package/release/dev/{schema-89d23a07.js → schema-957f5e9b.js} +13 -2
- package/release/esm/extendedGlobalApi/getRangeHtml.d.ts +2 -0
- package/release/esm/extendedGlobalApi/getRangeHtml.js +11 -0
- package/release/esm/extendedGlobalApi/index.d.ts +1 -0
- package/release/esm/extendedGlobalApi/index.js +1 -0
- package/release/esm/globals-88d92b64.js +40 -0
- package/release/esm/globals.d.ts +1 -0
- package/release/esm/globals.js +1 -0
- package/release/esm/kusto.worker.js +39 -94
- package/release/esm/kustoMode.js +39 -29
- package/release/esm/kustoWorker.d.ts +2 -5
- package/release/esm/kustoWorker.js +2 -5
- package/release/esm/languageFeatures.d.ts +0 -13
- package/release/esm/languageFeatures.js +7 -304
- package/release/esm/languageFeatures.utils.d.ts +2 -1
- package/release/esm/languageFeatures.utils.js +13 -5
- package/release/esm/languageServiceManager/kustoLanguageService.d.ts +2 -4
- package/release/esm/languageServiceManager/kustoLanguageService.js +58 -72
- package/release/esm/languageServiceManager/settings.d.ts +0 -2
- package/release/esm/monaco.contribution.d.ts +1 -6
- package/release/esm/monaco.contribution.js +22 -79
- package/release/esm/{schema-aeb83929.js → schema-66580db4.js} +12 -2
- package/release/esm/syntaxHighlighting/SemanticTokensProvider.d.ts +18 -0
- package/release/esm/syntaxHighlighting/SemanticTokensProvider.js +78 -0
- package/release/esm/syntaxHighlighting/kustoMonarchLanguageDefinition.d.ts +2 -0
- package/release/esm/syntaxHighlighting/kustoMonarchLanguageDefinition.js +401 -0
- package/release/esm/syntaxHighlighting/themes.d.ts +11 -0
- package/release/esm/syntaxHighlighting/themes.js +103 -0
- package/release/esm/syntaxHighlighting/types.d.ts +41 -0
- package/release/esm/syntaxHighlighting/types.js +55 -0
- package/release/min/globals-cce7b304.js +7 -0
- package/release/min/kustoMode.js +2 -2
- package/release/min/kustoWorker.js +4 -4
- package/release/min/{main-b6454357.js → main-13659fc4.js} +2 -2
- package/release/min/monaco.contribution.js +2 -2
- package/release/min/schema-ab3cbb28.js +7 -0
- package/release/esm/languageServiceManager/kustoMonarchLanguageDefinition.d.ts +0 -2
- package/release/esm/languageServiceManager/kustoMonarchLanguageDefinition.js +0 -211
- package/release/min/schema-1c89ac80.js +0 -7
|
@@ -1,13 +1,27 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
13
|
import KustoCommandHighlighter from './commandHighlighter';
|
|
3
14
|
import KustoCommandFormatter from './commandFormatter';
|
|
4
|
-
import { extend
|
|
5
|
-
import {
|
|
15
|
+
import { extend } from './extendedEditor';
|
|
16
|
+
import { themes } from './syntaxHighlighting/themes';
|
|
17
|
+
import { LANGUAGE_ID } from './globals';
|
|
18
|
+
import * as schema from './languageServiceManager/schema';
|
|
19
|
+
import { getRangeHtml } from './extendedGlobalApi';
|
|
6
20
|
export * from './languageServiceManager/schema';
|
|
7
21
|
export * from './languageServiceManager/renderInfo';
|
|
8
22
|
export * from './languageServiceManager/settings';
|
|
9
23
|
export * from './types';
|
|
10
|
-
export
|
|
24
|
+
export * from './extendedGlobalApi';
|
|
11
25
|
// --- Kusto configuration and defaults ---------
|
|
12
26
|
var LanguageServiceDefaultsImpl = /** @class */ (function () {
|
|
13
27
|
function LanguageServiceDefaultsImpl(languageSettings) {
|
|
@@ -53,8 +67,6 @@ var defaultLanguageSettings = {
|
|
|
53
67
|
includeControlCommands: true,
|
|
54
68
|
newlineAfterPipe: true,
|
|
55
69
|
openSuggestionDialogAfterPreviousSuggestionAccepted: true,
|
|
56
|
-
useSemanticColorization: true,
|
|
57
|
-
useTokenColorization: false,
|
|
58
70
|
enableHover: true,
|
|
59
71
|
formatter: {
|
|
60
72
|
indentationSize: 4,
|
|
@@ -81,75 +93,16 @@ function withMode(callback) {
|
|
|
81
93
|
import('./kustoMode').then(callback);
|
|
82
94
|
}
|
|
83
95
|
export var kustoDefaults = new LanguageServiceDefaultsImpl(defaultLanguageSettings);
|
|
84
|
-
export var themeNames = {
|
|
85
|
-
light: 'kusto-light',
|
|
86
|
-
dark: 'kusto-dark',
|
|
87
|
-
dark2: 'kusto-dark2',
|
|
88
|
-
};
|
|
89
96
|
monaco.languages.onLanguage('kusto', function () {
|
|
90
97
|
withMode(function (mode) { return mode.setupMode(kustoDefaults, monaco); });
|
|
91
98
|
});
|
|
92
99
|
monaco.languages.register({
|
|
93
|
-
id:
|
|
100
|
+
id: LANGUAGE_ID,
|
|
94
101
|
extensions: ['.csl', '.kql'],
|
|
95
102
|
});
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
rules: [
|
|
100
|
-
{ token: 'comment', foreground: '008000' }, // CommentToken Green
|
|
101
|
-
{ token: 'variable.predefined', foreground: '800080' }, // CalculatedColumnToken Purple
|
|
102
|
-
{ token: 'function', foreground: '0000FF' }, // FunctionNameToken Blue
|
|
103
|
-
{ token: 'operator.sql', foreground: 'CC3700' }, // _WAS_ OperatorToken OrangeRed, but wasn't accessible.
|
|
104
|
-
{ token: 'string', foreground: 'B22222' }, // StringLiteralToken Firebrick
|
|
105
|
-
{ token: 'operator.scss', foreground: '0000FF' }, // SubOperatorToken Blue
|
|
106
|
-
{ token: 'variable', foreground: 'C71585' }, // TableColumnToken MediumVioletRed
|
|
107
|
-
{ token: 'variable.parameter', foreground: '9932CC' }, // TableToken DarkOrchid
|
|
108
|
-
{ token: '', foreground: '000000' }, // UnknownToken, PlainTextToken Black
|
|
109
|
-
{ token: 'type', foreground: '0000FF' }, // DataTypeToken Blue
|
|
110
|
-
{ token: 'tag', foreground: '0000FF' }, // ControlCommandToken Blue
|
|
111
|
-
{ token: 'annotation', foreground: '2B91AF' }, // QueryParametersToken FF2B91AF
|
|
112
|
-
{ token: 'keyword', foreground: '0000FF' }, // CslCommandToken, PluginToken Blue
|
|
113
|
-
{ token: 'number', foreground: '191970' }, // LetVariablesToken MidnightBlue
|
|
114
|
-
{ token: 'annotation', foreground: '9400D3' }, // ClientDirectiveToken DarkViolet
|
|
115
|
-
{ token: 'invalid', background: 'cd3131' },
|
|
116
|
-
],
|
|
117
|
-
colors: {},
|
|
118
|
-
});
|
|
119
|
-
monaco.editor.defineTheme(themeNames.dark, {
|
|
120
|
-
base: 'vs-dark',
|
|
121
|
-
inherit: true,
|
|
122
|
-
rules: [
|
|
123
|
-
{ token: 'comment', foreground: '608B4E' }, // CommentToken Green
|
|
124
|
-
{ token: 'variable.predefined', foreground: '4ec9b0' }, // CalculatedColumnToken Purple
|
|
125
|
-
{ token: 'function', foreground: 'dcdcaa' }, // FunctionNameToken Blue
|
|
126
|
-
{ token: 'operator.sql', foreground: '9cdcfe' }, // OperatorToken OrangeRed
|
|
127
|
-
{ token: 'string', foreground: 'ce9178' }, // StringLiteralToken Firebrick
|
|
128
|
-
{ token: 'operator.scss', foreground: '569cd6' }, // SubOperatorToken Blue
|
|
129
|
-
{ token: 'variable', foreground: '4ec9b0' }, // TableColumnToken MediumVioletRed
|
|
130
|
-
{ token: 'variable.parameter', foreground: 'c586c0' }, // TableToken DarkOrchid
|
|
131
|
-
{ token: '', foreground: 'd4d4d4' }, // UnknownToken, PlainTextToken Black
|
|
132
|
-
{ token: 'type', foreground: '569cd6' }, // DataTypeToken Blue
|
|
133
|
-
{ token: 'tag', foreground: '569cd6' }, // ControlCommandToken Blue
|
|
134
|
-
{ token: 'annotation', foreground: '9cdcfe' }, // QueryParametersToken FF2B91AF
|
|
135
|
-
{ token: 'keyword', foreground: '569cd6' }, // CslCommandToken, PluginToken Blue
|
|
136
|
-
{ token: 'number', foreground: 'd7ba7d' }, // LetVariablesToken MidnightBlue
|
|
137
|
-
{ token: 'annotation', foreground: 'b5cea8' }, // ClientDirectiveToken DarkViolet
|
|
138
|
-
{ token: 'invalid', background: 'cd3131' },
|
|
139
|
-
],
|
|
140
|
-
colors: {
|
|
141
|
-
// see: https://code.visualstudio.com/api/references/theme-color#editor-widget-colors
|
|
142
|
-
},
|
|
143
|
-
});
|
|
144
|
-
monaco.editor.defineTheme(themeNames.dark2, {
|
|
145
|
-
base: 'vs-dark',
|
|
146
|
-
inherit: true,
|
|
147
|
-
rules: [],
|
|
148
|
-
colors: {
|
|
149
|
-
// see: https://code.visualstudio.com/api/references/theme-color#editor-widget-colors
|
|
150
|
-
'editor.background': '#1B1A19', // gray 200
|
|
151
|
-
'editorSuggestWidget.selectedBackground': '#004E8C',
|
|
152
|
-
},
|
|
103
|
+
themes.forEach(function (_a) {
|
|
104
|
+
var name = _a.name, data = _a.data;
|
|
105
|
+
return monaco.editor.defineTheme(name, data);
|
|
153
106
|
});
|
|
154
107
|
// Initialize kusto specific language features that don't currently have a natural way to extend using existing apis.
|
|
155
108
|
// Most other language features are initialized in kustoMode.ts
|
|
@@ -193,15 +146,5 @@ function triggerSuggestDialogWhenCompletionItemSelected(editor) {
|
|
|
193
146
|
function isStandaloneCodeEditor(editor) {
|
|
194
147
|
return editor.addAction !== undefined;
|
|
195
148
|
}
|
|
196
|
-
var globalApi = {
|
|
197
|
-
getCslTypeNameFromClrType: getCslTypeNameFromClrType,
|
|
198
|
-
getCallName: getCallName,
|
|
199
|
-
getExpression: getExpression,
|
|
200
|
-
getInputParametersAsCslString: getInputParametersAsCslString,
|
|
201
|
-
getEntityDataTypeFromCslType: getEntityDataTypeFromCslType,
|
|
202
|
-
kustoDefaults: kustoDefaults,
|
|
203
|
-
getKustoWorker: getKustoWorker,
|
|
204
|
-
getCurrentCommandRange: getCurrentCommandRange,
|
|
205
|
-
themeNames: themeNames,
|
|
206
|
-
};
|
|
149
|
+
var globalApi = __assign(__assign({}, schema), { kustoDefaults: kustoDefaults, getKustoWorker: getKustoWorker, getRangeHtml: getRangeHtml });
|
|
207
150
|
monaco.languages.kusto = globalApi;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version:
|
|
3
|
+
* monaco-kusto version: 12.0.0(2f1838c12bdb98562467acf51b6fd3e396182e86)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
@@ -81,4 +81,14 @@ const getInputParameterAsCslString = inputParameter => {
|
|
|
81
81
|
*/
|
|
82
82
|
let showSchema;
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
const schema = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
85
|
+
__proto__: null,
|
|
86
|
+
getCallName,
|
|
87
|
+
getCslTypeNameFromClrType,
|
|
88
|
+
getEntityDataTypeFromCslType,
|
|
89
|
+
getExpression,
|
|
90
|
+
getInputParametersAsCslString,
|
|
91
|
+
showSchema
|
|
92
|
+
}, Symbol.toStringTag, { value: 'Module' }));
|
|
93
|
+
|
|
94
|
+
export { getEntityDataTypeFromCslType as a, getCallName as b, getExpression as c, getInputParametersAsCslString as d, showSchema as e, getCslTypeNameFromClrType as g, schema as s };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as monaco from 'monaco-editor';
|
|
2
|
+
import { editor } from 'monaco-editor';
|
|
3
|
+
import { ClassificationRange } from './types';
|
|
4
|
+
type ClassificationsGetter = (resource: monaco.Uri) => Promise<ClassificationRange[]>;
|
|
5
|
+
export declare class SemanticTokensProvider implements monaco.languages.DocumentSemanticTokensProvider {
|
|
6
|
+
private readonly classificationsGetter;
|
|
7
|
+
constructor(classificationsGetter: ClassificationsGetter);
|
|
8
|
+
getLegend(): {
|
|
9
|
+
tokenTypes: import("./types").Token[];
|
|
10
|
+
tokenModifiers: any[];
|
|
11
|
+
};
|
|
12
|
+
provideDocumentSemanticTokens(model: editor.ITextModel): Promise<{
|
|
13
|
+
data: Uint32Array;
|
|
14
|
+
resultId: string;
|
|
15
|
+
}>;
|
|
16
|
+
releaseDocumentSemanticTokens(): void;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { tokenTypes } from './types';
|
|
38
|
+
var SemanticTokensProvider = /** @class */ (function () {
|
|
39
|
+
function SemanticTokensProvider(classificationsGetter) {
|
|
40
|
+
this.classificationsGetter = classificationsGetter;
|
|
41
|
+
}
|
|
42
|
+
SemanticTokensProvider.prototype.getLegend = function () {
|
|
43
|
+
return { tokenTypes: tokenTypes, tokenModifiers: [] };
|
|
44
|
+
};
|
|
45
|
+
SemanticTokensProvider.prototype.provideDocumentSemanticTokens = function (model) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
47
|
+
var resource, classifications, semanticTokens;
|
|
48
|
+
return __generator(this, function (_a) {
|
|
49
|
+
switch (_a.label) {
|
|
50
|
+
case 0:
|
|
51
|
+
resource = model.uri;
|
|
52
|
+
return [4 /*yield*/, this.classificationsGetter(resource)];
|
|
53
|
+
case 1:
|
|
54
|
+
classifications = _a.sent();
|
|
55
|
+
semanticTokens = classifications.map(function (classification, index) {
|
|
56
|
+
var previousClassification = classifications[index - 1];
|
|
57
|
+
return semanticTokenMaker(classification, previousClassification);
|
|
58
|
+
});
|
|
59
|
+
return [2 /*return*/, {
|
|
60
|
+
data: new Uint32Array(semanticTokens.flat()),
|
|
61
|
+
resultId: model.getVersionId().toString(),
|
|
62
|
+
}];
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
SemanticTokensProvider.prototype.releaseDocumentSemanticTokens = function () { };
|
|
68
|
+
return SemanticTokensProvider;
|
|
69
|
+
}());
|
|
70
|
+
export { SemanticTokensProvider };
|
|
71
|
+
var emptyClassification = { line: 0, character: 0, length: 0, kind: 0 };
|
|
72
|
+
function semanticTokenMaker(classification, previousClassification) {
|
|
73
|
+
if (previousClassification === void 0) { previousClassification = emptyClassification; }
|
|
74
|
+
var line = classification.line, character = classification.character, length = classification.length, kind = classification.kind;
|
|
75
|
+
var deltaLine = line - previousClassification.line;
|
|
76
|
+
var deltaStart = deltaLine ? character : character - previousClassification.character;
|
|
77
|
+
return [deltaLine, deltaStart, length, kind, 0];
|
|
78
|
+
}
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
import { LANGUAGE_ID } from '../globals';
|
|
2
|
+
import { Token } from './types';
|
|
3
|
+
var queryOperators = [
|
|
4
|
+
'as',
|
|
5
|
+
'consume',
|
|
6
|
+
'distinct',
|
|
7
|
+
'evaluate',
|
|
8
|
+
'extend',
|
|
9
|
+
'getschema',
|
|
10
|
+
'graph-match',
|
|
11
|
+
'graph-merge',
|
|
12
|
+
'graph-to-table',
|
|
13
|
+
'invoke',
|
|
14
|
+
'join',
|
|
15
|
+
'limit',
|
|
16
|
+
'lookup',
|
|
17
|
+
'make-graph',
|
|
18
|
+
'make-series',
|
|
19
|
+
'mv-apply',
|
|
20
|
+
'mv-expand',
|
|
21
|
+
'order',
|
|
22
|
+
'parse',
|
|
23
|
+
'parse-kv',
|
|
24
|
+
'parse-where',
|
|
25
|
+
'project',
|
|
26
|
+
'project-away',
|
|
27
|
+
'project-keep',
|
|
28
|
+
'project-rename',
|
|
29
|
+
'project-reorder',
|
|
30
|
+
'range',
|
|
31
|
+
'reduce',
|
|
32
|
+
'render',
|
|
33
|
+
'sample',
|
|
34
|
+
'sample-distinct',
|
|
35
|
+
'scan',
|
|
36
|
+
'serialize',
|
|
37
|
+
'sort',
|
|
38
|
+
'summarize',
|
|
39
|
+
'take',
|
|
40
|
+
'top',
|
|
41
|
+
'top-hitters',
|
|
42
|
+
'top-nested',
|
|
43
|
+
'union',
|
|
44
|
+
'where',
|
|
45
|
+
'filter',
|
|
46
|
+
'fork',
|
|
47
|
+
'facet',
|
|
48
|
+
'range',
|
|
49
|
+
'consume',
|
|
50
|
+
'find',
|
|
51
|
+
'search',
|
|
52
|
+
'print',
|
|
53
|
+
'partition',
|
|
54
|
+
'lookup',
|
|
55
|
+
];
|
|
56
|
+
var queryParameters = ['kind'];
|
|
57
|
+
var types = ['bool', 'datetime', 'decimal', 'double', 'dynamic', 'guid', 'int', 'long', 'real', 'string', 'timespan'];
|
|
58
|
+
var commands = [
|
|
59
|
+
'.add',
|
|
60
|
+
'.alter',
|
|
61
|
+
'.alter-merge',
|
|
62
|
+
'.append',
|
|
63
|
+
'.as',
|
|
64
|
+
'.assert',
|
|
65
|
+
'.attach',
|
|
66
|
+
'.consume',
|
|
67
|
+
'.count',
|
|
68
|
+
'.create',
|
|
69
|
+
'.create-merge',
|
|
70
|
+
'.create-or-alter',
|
|
71
|
+
'.create-set',
|
|
72
|
+
'.datatable',
|
|
73
|
+
'.default',
|
|
74
|
+
'.define',
|
|
75
|
+
'.delete',
|
|
76
|
+
'.detach',
|
|
77
|
+
'.distinct',
|
|
78
|
+
'.drop',
|
|
79
|
+
'.drop-pretend',
|
|
80
|
+
'.dup-next-failed-ingest',
|
|
81
|
+
'.dup-next-ingest',
|
|
82
|
+
'.evaluate',
|
|
83
|
+
'.export',
|
|
84
|
+
'.extend',
|
|
85
|
+
'.externaldata',
|
|
86
|
+
'.filter',
|
|
87
|
+
'.find',
|
|
88
|
+
'.fork',
|
|
89
|
+
'.getschema',
|
|
90
|
+
'.ingest',
|
|
91
|
+
'.join',
|
|
92
|
+
'.limit',
|
|
93
|
+
'.load',
|
|
94
|
+
'.make-series',
|
|
95
|
+
'.materialize',
|
|
96
|
+
'.move',
|
|
97
|
+
'.mv-expand',
|
|
98
|
+
'.order',
|
|
99
|
+
'.parse',
|
|
100
|
+
'.parse-where',
|
|
101
|
+
'.partition',
|
|
102
|
+
'.pivot',
|
|
103
|
+
'.print',
|
|
104
|
+
'.project',
|
|
105
|
+
'.project-away',
|
|
106
|
+
'.project-keep',
|
|
107
|
+
'.project-rename',
|
|
108
|
+
'.reduce',
|
|
109
|
+
'.remove',
|
|
110
|
+
'.rename',
|
|
111
|
+
'.replace',
|
|
112
|
+
'.restrict',
|
|
113
|
+
'.run',
|
|
114
|
+
'.sample',
|
|
115
|
+
'.sample-distinct',
|
|
116
|
+
'.save',
|
|
117
|
+
'.search',
|
|
118
|
+
'.serialize',
|
|
119
|
+
'.set',
|
|
120
|
+
'.set-or-append',
|
|
121
|
+
'.set-or-replace',
|
|
122
|
+
'.show',
|
|
123
|
+
'.sort',
|
|
124
|
+
'.summarize',
|
|
125
|
+
'.take',
|
|
126
|
+
'.top',
|
|
127
|
+
'.top-hitters',
|
|
128
|
+
'.top-nested',
|
|
129
|
+
'.union',
|
|
130
|
+
];
|
|
131
|
+
var functions = [
|
|
132
|
+
'abs',
|
|
133
|
+
'acos',
|
|
134
|
+
'ago',
|
|
135
|
+
'array_concat',
|
|
136
|
+
'array_length',
|
|
137
|
+
'array_slice',
|
|
138
|
+
'array_split',
|
|
139
|
+
'asin',
|
|
140
|
+
'atan',
|
|
141
|
+
'atan2',
|
|
142
|
+
'avg',
|
|
143
|
+
'bag_keys',
|
|
144
|
+
'base64_decodestring',
|
|
145
|
+
'base64_encodestring',
|
|
146
|
+
'bin',
|
|
147
|
+
'bin_at',
|
|
148
|
+
'binary_and',
|
|
149
|
+
'binary_not',
|
|
150
|
+
'binary_or',
|
|
151
|
+
'binary_shift_left',
|
|
152
|
+
'binary_shift_right',
|
|
153
|
+
'binary_xor',
|
|
154
|
+
'case',
|
|
155
|
+
'ceiling',
|
|
156
|
+
'coalesce',
|
|
157
|
+
'columnifexists',
|
|
158
|
+
'cos',
|
|
159
|
+
'count',
|
|
160
|
+
'countof',
|
|
161
|
+
'cot',
|
|
162
|
+
'cursor_after',
|
|
163
|
+
'datatable',
|
|
164
|
+
'datepart',
|
|
165
|
+
'datetime_add',
|
|
166
|
+
'datetime_diff',
|
|
167
|
+
'datetime_part',
|
|
168
|
+
'dayofmonth',
|
|
169
|
+
'dayofweek',
|
|
170
|
+
'dayofyear',
|
|
171
|
+
'dcount',
|
|
172
|
+
'dcount_hll',
|
|
173
|
+
'degrees',
|
|
174
|
+
'endofday',
|
|
175
|
+
'endofmonth',
|
|
176
|
+
'endofweek',
|
|
177
|
+
'endofyear',
|
|
178
|
+
'exp',
|
|
179
|
+
'exp10',
|
|
180
|
+
'exp2',
|
|
181
|
+
'extract',
|
|
182
|
+
'extractall',
|
|
183
|
+
'extractjson',
|
|
184
|
+
'format_datetime',
|
|
185
|
+
'format_timespan',
|
|
186
|
+
'floor',
|
|
187
|
+
'gamma',
|
|
188
|
+
'geo_distance_2points',
|
|
189
|
+
'geo_geohash_to_central_point',
|
|
190
|
+
'geo_point_in_circle',
|
|
191
|
+
'geo_point_in_polygon',
|
|
192
|
+
'geo_point_to_geohash',
|
|
193
|
+
'getmonth',
|
|
194
|
+
'gettype',
|
|
195
|
+
'getyear',
|
|
196
|
+
'hash',
|
|
197
|
+
'hash_sha256',
|
|
198
|
+
'hll_merge',
|
|
199
|
+
'iif',
|
|
200
|
+
'indexof',
|
|
201
|
+
'isempty',
|
|
202
|
+
'isfinite',
|
|
203
|
+
'isinf',
|
|
204
|
+
'isascii',
|
|
205
|
+
'isnan',
|
|
206
|
+
'isnotempty',
|
|
207
|
+
'isnotnull',
|
|
208
|
+
'isnull',
|
|
209
|
+
'isutf8',
|
|
210
|
+
'log',
|
|
211
|
+
'log10',
|
|
212
|
+
'log2',
|
|
213
|
+
'loggamma',
|
|
214
|
+
'make_datetime',
|
|
215
|
+
'make_string',
|
|
216
|
+
'make_timespan',
|
|
217
|
+
'materialize',
|
|
218
|
+
'max',
|
|
219
|
+
'max_of',
|
|
220
|
+
'min',
|
|
221
|
+
'min_of',
|
|
222
|
+
'monthofyear',
|
|
223
|
+
'next',
|
|
224
|
+
'not',
|
|
225
|
+
'pack',
|
|
226
|
+
'pack_array',
|
|
227
|
+
'pack_dictionary',
|
|
228
|
+
'parse_csv',
|
|
229
|
+
'parse_ipv4',
|
|
230
|
+
'parse_json',
|
|
231
|
+
'parse_path',
|
|
232
|
+
'parse_url',
|
|
233
|
+
'parse_urlquery',
|
|
234
|
+
'parse_user_agent',
|
|
235
|
+
'parse_version',
|
|
236
|
+
'parse_xml',
|
|
237
|
+
'parsejson',
|
|
238
|
+
'percentrank_tdigest',
|
|
239
|
+
'percentile_tdigest',
|
|
240
|
+
'pow',
|
|
241
|
+
'prev',
|
|
242
|
+
'radians',
|
|
243
|
+
'rand',
|
|
244
|
+
'rank_tdigest',
|
|
245
|
+
'repeat',
|
|
246
|
+
'replace',
|
|
247
|
+
'reverse',
|
|
248
|
+
'round',
|
|
249
|
+
'row_cumsum',
|
|
250
|
+
'row_window_session',
|
|
251
|
+
'series_add',
|
|
252
|
+
'series_decompose',
|
|
253
|
+
'series_decompose_anomalies',
|
|
254
|
+
'series_decompose_forecast',
|
|
255
|
+
'series_divide',
|
|
256
|
+
'series_equals',
|
|
257
|
+
'series_fill_backward',
|
|
258
|
+
'series_fill_const',
|
|
259
|
+
'series_fill_forward',
|
|
260
|
+
'series_fill_linear',
|
|
261
|
+
'series_fir',
|
|
262
|
+
'series_fit_2lines',
|
|
263
|
+
'series_fit_2lines_dynamic',
|
|
264
|
+
'series_fit_line',
|
|
265
|
+
'series_fit_line_dynamic',
|
|
266
|
+
'series_greater',
|
|
267
|
+
'series_greater_equals',
|
|
268
|
+
'series_iir',
|
|
269
|
+
'series_less',
|
|
270
|
+
'series_less_equals',
|
|
271
|
+
'series_multiply',
|
|
272
|
+
'series_not_equals',
|
|
273
|
+
'series_outliers',
|
|
274
|
+
'series_pearson_correlation',
|
|
275
|
+
'series_periods_detect',
|
|
276
|
+
'series_periods_validate',
|
|
277
|
+
'series_seasonal',
|
|
278
|
+
'series_stats',
|
|
279
|
+
'series_stats_dynamic',
|
|
280
|
+
'series_subtract',
|
|
281
|
+
'sign',
|
|
282
|
+
'sin',
|
|
283
|
+
'split',
|
|
284
|
+
'sqrt',
|
|
285
|
+
'startofday',
|
|
286
|
+
'startofmonth',
|
|
287
|
+
'startofweek',
|
|
288
|
+
'startofyear',
|
|
289
|
+
'strcat',
|
|
290
|
+
'strcat_array',
|
|
291
|
+
'strcat_delim',
|
|
292
|
+
'strcmp',
|
|
293
|
+
'strlen',
|
|
294
|
+
'strrep',
|
|
295
|
+
'string_size',
|
|
296
|
+
'substring',
|
|
297
|
+
'sum',
|
|
298
|
+
'tan',
|
|
299
|
+
'tdigest_merge',
|
|
300
|
+
'tobool',
|
|
301
|
+
'toboolean',
|
|
302
|
+
'todecimal',
|
|
303
|
+
'todouble',
|
|
304
|
+
'todynamic',
|
|
305
|
+
'tofloat',
|
|
306
|
+
'toguid',
|
|
307
|
+
'tohex',
|
|
308
|
+
'toint',
|
|
309
|
+
'tolong',
|
|
310
|
+
'tolower',
|
|
311
|
+
'toobject',
|
|
312
|
+
'toreal',
|
|
313
|
+
'toscalar',
|
|
314
|
+
'tostring',
|
|
315
|
+
'totimespan',
|
|
316
|
+
'toupper',
|
|
317
|
+
'translate',
|
|
318
|
+
'trim',
|
|
319
|
+
'trim_end',
|
|
320
|
+
'trim_start',
|
|
321
|
+
'typeof',
|
|
322
|
+
'url_decode',
|
|
323
|
+
'url_encode',
|
|
324
|
+
'week_of_year',
|
|
325
|
+
'welch_test',
|
|
326
|
+
];
|
|
327
|
+
var keywords = [
|
|
328
|
+
'and',
|
|
329
|
+
'as',
|
|
330
|
+
'asc',
|
|
331
|
+
'between',
|
|
332
|
+
'by',
|
|
333
|
+
'contains',
|
|
334
|
+
'count',
|
|
335
|
+
'desc',
|
|
336
|
+
'extend',
|
|
337
|
+
'false',
|
|
338
|
+
'filter',
|
|
339
|
+
'find',
|
|
340
|
+
'from',
|
|
341
|
+
'has',
|
|
342
|
+
'in',
|
|
343
|
+
'inner',
|
|
344
|
+
'join',
|
|
345
|
+
'leftouter',
|
|
346
|
+
'let',
|
|
347
|
+
'not',
|
|
348
|
+
'on',
|
|
349
|
+
'or',
|
|
350
|
+
'policy',
|
|
351
|
+
'project',
|
|
352
|
+
'project-away',
|
|
353
|
+
'project-rename',
|
|
354
|
+
'project-reorder',
|
|
355
|
+
'project-keep',
|
|
356
|
+
'range',
|
|
357
|
+
'rename',
|
|
358
|
+
'retention',
|
|
359
|
+
'summarize',
|
|
360
|
+
'table',
|
|
361
|
+
'take',
|
|
362
|
+
'to',
|
|
363
|
+
'true',
|
|
364
|
+
'where',
|
|
365
|
+
'with',
|
|
366
|
+
];
|
|
367
|
+
export var kustoLanguageDefinition = {
|
|
368
|
+
name: LANGUAGE_ID,
|
|
369
|
+
mimeTypes: ['text/kusto'],
|
|
370
|
+
displayName: 'Kusto',
|
|
371
|
+
defaultToken: 'invalid',
|
|
372
|
+
queryOperators: queryOperators,
|
|
373
|
+
queryParameters: queryParameters,
|
|
374
|
+
types: types,
|
|
375
|
+
commands: commands,
|
|
376
|
+
functions: functions,
|
|
377
|
+
keywords: keywords,
|
|
378
|
+
tokenizer: {
|
|
379
|
+
root: [
|
|
380
|
+
[/(\/\/.*$)/, Token.Comment],
|
|
381
|
+
[/[\(\)\{\}\|\[\]\:\=\,\<|\.\..]/, Token.Punctuation],
|
|
382
|
+
[/[\+\-\*\/\%\!\<\<=\>\>=\=\==\!=\<>\:\;\,\=~\@\?\=>\!~]/, Token.MathOperator],
|
|
383
|
+
[/"([^"\\]*(\\.[^"\\]*)*)"/, Token.StringLiteral],
|
|
384
|
+
[/'([^"\\]*(\\.[^"\\]*)*)'/, Token.StringLiteral],
|
|
385
|
+
[
|
|
386
|
+
/[\w@#\-$\.]+/,
|
|
387
|
+
{
|
|
388
|
+
cases: {
|
|
389
|
+
'@queryOperators': Token.QueryOperator,
|
|
390
|
+
'@queryParameters': Token.QueryParameter,
|
|
391
|
+
'@types': Token.Type,
|
|
392
|
+
'@commands': Token.Command,
|
|
393
|
+
'@functions': Token.Function,
|
|
394
|
+
'@keywords': Token.Keyword,
|
|
395
|
+
'@default': 'identifier',
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
],
|
|
399
|
+
],
|
|
400
|
+
},
|
|
401
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
2
|
+
export declare enum ThemeName {
|
|
3
|
+
light = "kusto-light",
|
|
4
|
+
dark = "kusto-dark"
|
|
5
|
+
}
|
|
6
|
+
interface Theme {
|
|
7
|
+
name: ThemeName;
|
|
8
|
+
data: monaco.editor.IStandaloneThemeData;
|
|
9
|
+
}
|
|
10
|
+
export declare const themes: Theme[];
|
|
11
|
+
export {};
|