@kusto/monaco-kusto 5.3.10 → 5.3.11
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 +7 -12
- package/release/dev/kustoMode.js +86 -32
- package/release/dev/kustoWorker.js +68 -55
- package/release/dev/monaco.contribution.js +9 -8
- package/release/esm/extendedEditor.js +3 -3
- package/release/esm/kustoMode.js +4 -1
- package/release/esm/kustoWorker.js +9 -9
- package/release/esm/languageFeatures.js +10 -10
- package/release/esm/languageService/kustoLanguageService.js +37 -32
- package/release/esm/languageService/kustoMonarchLanguageDefinition.js +72 -21
- package/release/esm/languageService/schema.js +8 -8
- package/release/esm/monaco.contribution.d.ts +1 -0
- package/release/esm/monaco.contribution.js +5 -4
- package/release/esm/monaco.d.ts +25 -15
- package/release/min/kustoMode.js +2 -11
- package/release/min/kustoWorker.js +2 -55
- package/release/min/monaco.contribution.d.ts +1 -0
- package/release/min/monaco.contribution.js +2 -2
- package/release/min/monaco.d.ts +25 -15
- package/scripts/bundle.js +55 -48
- package/scripts/release.js +13 -20
- package/tsconfig.esm.json +18 -0
- package/tsconfig.json +20 -0
- package/tsconfig.watch.json +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kusto/monaco-kusto",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.11",
|
|
4
4
|
"description": "CSL, KQL plugin for the Monaco Editor",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Microsoft"
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"copy_runtime_deps_to_out": "mcopy ./node_modules/@kusto/language-service/Kusto.JavaScript.Client.min.js ./out/vs/language/kusto/kusto.javascript.client.min.js && mcopy ./node_modules/@kusto/language-service-next/Kusto.Language.Bridge.min.js ./out/vs/language/kusto/Kusto.Language.Bridge.min.js && mcopy ./node_modules/@kusto/language-service/bridge.min.js ./out/vs/language/kusto/bridge.min.js && node ./node_modules/copy-dir-cli/bin/copy ./node_modules/monaco-editor-core/dev/vs ./out/vs",
|
|
21
|
-
"compile": "tsc -p ./
|
|
22
|
-
"watch": "echo dev > test/mode.txt && tsc -p ./
|
|
21
|
+
"compile": "tsc -p ./tsconfig.json && tsc -p ./tsconfig.esm.json",
|
|
22
|
+
"watch": "echo dev > test/mode.txt && tsc -p ./tsconfig.watch.json && npm run copy_runtime_deps_to_out && concurrently \"live-server ./ \" \"tsc -w -p ./tsconfig.watch.json \"",
|
|
23
23
|
"test_release": "echo release > test/mode.txt && http-server -c-1 -p 8080 ./ -o index.html",
|
|
24
24
|
"copy_types_to_release": "mcopy ./src/monaco.d.ts ./release/esm/monaco.d.ts && mcopy ./out/amd/monaco.contribution.d.ts ./release/esm/monaco.contribution.d.ts && mcopy ./src/monaco.d.ts ./release/min/monaco.d.ts && mcopy ./out/amd/monaco.contribution.d.ts ./release/min/monaco.contribution.d.ts && mcopy ./node_modules/@kusto/language-service/Kusto.JavaScript.Client.min.js ./release/min/kusto.javascript.client.min.js && mcopy ./node_modules/@kusto/language-service-next/Kusto.Language.Bridge.min.js ./release/min/Kusto.Language.Bridge.min.js && mcopy ./node_modules/@kusto/language-service/bridge.min.js ./release/min/bridge.min.js && mcopy ./node_modules/@kusto/language-service/newtonsoft.json.min.js ./release/min/newtonsoft.json.min.js",
|
|
25
25
|
"prepublishOnly": "mkdirp release && npm run compile && node ./scripts/release.js && node ./scripts/bundle.js && npm run copy_runtime_deps_to_out && npm run copy_types_to_release",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"monaco-plugin-helpers": "^1.0.3",
|
|
47
47
|
"object-assign": "4.1.0",
|
|
48
48
|
"requirejs": "^2.3.6",
|
|
49
|
-
"terser": "^
|
|
49
|
+
"terser": "^5.16.2",
|
|
50
50
|
"ts-jest": "^26.1.1",
|
|
51
|
-
"typescript": "
|
|
52
|
-
"vscode-languageserver-types": "3.16.0",
|
|
51
|
+
"typescript": "^4.0.0",
|
|
53
52
|
"vscode-languageserver-textdocument": "1.0.4",
|
|
53
|
+
"vscode-languageserver-types": "3.16.0",
|
|
54
54
|
"xregexp": "^3.2.0"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"rootDir": "src",
|
|
65
65
|
"globals": {
|
|
66
66
|
"ts-jest": {
|
|
67
|
-
"tsConfigFile": "
|
|
67
|
+
"tsConfigFile": "./tsconfig.json"
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
"transform": {
|
|
@@ -79,10 +79,5 @@
|
|
|
79
79
|
"json",
|
|
80
80
|
"node"
|
|
81
81
|
]
|
|
82
|
-
},
|
|
83
|
-
"prettier": {
|
|
84
|
-
"printWidth": 120,
|
|
85
|
-
"tabWidth": 4,
|
|
86
|
-
"singleQuote": true
|
|
87
82
|
}
|
|
88
83
|
}
|
package/release/dev/kustoMode.js
CHANGED
|
@@ -113,23 +113,69 @@ define('vs/language/kusto/languageService/kustoMonarchLanguageDefinition',["requ
|
|
|
113
113
|
exports.KustoLanguageDefinition = {
|
|
114
114
|
name: 'kusto',
|
|
115
115
|
mimeTypes: ['text/kusto'],
|
|
116
|
-
displayName:
|
|
117
|
-
defaultToken:
|
|
118
|
-
brackets: [
|
|
119
|
-
['
|
|
116
|
+
displayName: 'Kusto',
|
|
117
|
+
defaultToken: 'invalid',
|
|
118
|
+
brackets: [
|
|
119
|
+
['[', ']', 'delimiter.square'],
|
|
120
|
+
['(', ')', 'delimiter.parenthesis'],
|
|
121
|
+
],
|
|
120
122
|
wordDefinition: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
|
121
123
|
// .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.
|
|
122
124
|
promotedOperatorCommandTokens: Kusto.Data.IntelliSense.CslCommandParser.PromotedOperatorCommandTokens.slice(0),
|
|
123
125
|
operatorCommandTokens: Kusto.Data.IntelliSense.CslCommandParser.OperatorCommandTokens.slice(0),
|
|
124
126
|
keywords: [
|
|
125
|
-
'by',
|
|
126
|
-
'
|
|
127
|
+
'by',
|
|
128
|
+
'on',
|
|
129
|
+
'contains',
|
|
130
|
+
'notcontains',
|
|
131
|
+
'containscs',
|
|
132
|
+
'notcontainscs',
|
|
133
|
+
'startswith',
|
|
134
|
+
'has',
|
|
135
|
+
'matches',
|
|
136
|
+
'regex',
|
|
137
|
+
'true',
|
|
138
|
+
'false',
|
|
139
|
+
'and',
|
|
140
|
+
'or',
|
|
141
|
+
'typeof',
|
|
142
|
+
'int',
|
|
143
|
+
'string',
|
|
144
|
+
'date',
|
|
145
|
+
'datetime',
|
|
146
|
+
'time',
|
|
147
|
+
'long',
|
|
148
|
+
'real',
|
|
149
|
+
'boolean',
|
|
150
|
+
'bool',
|
|
127
151
|
],
|
|
128
152
|
operators: ['+', '-', '*', '/', '>', '<', '==', '<>', '<=', '>=', '~', '!~'],
|
|
129
153
|
builtinFunctions: [
|
|
130
|
-
'countof',
|
|
131
|
-
'
|
|
132
|
-
'
|
|
154
|
+
'countof',
|
|
155
|
+
'bin',
|
|
156
|
+
'extentid',
|
|
157
|
+
'extract',
|
|
158
|
+
'extractjson',
|
|
159
|
+
'floor',
|
|
160
|
+
'iif',
|
|
161
|
+
'isnull',
|
|
162
|
+
'isnotnull',
|
|
163
|
+
'notnull',
|
|
164
|
+
'isempty',
|
|
165
|
+
'isnotempty',
|
|
166
|
+
'notempty',
|
|
167
|
+
'now',
|
|
168
|
+
're2',
|
|
169
|
+
'strcat',
|
|
170
|
+
'strlen',
|
|
171
|
+
'toupper',
|
|
172
|
+
'tostring',
|
|
173
|
+
'count',
|
|
174
|
+
'cnt',
|
|
175
|
+
'sum',
|
|
176
|
+
'min',
|
|
177
|
+
'max',
|
|
178
|
+
'avg',
|
|
133
179
|
],
|
|
134
180
|
tokenizer: {
|
|
135
181
|
root: [
|
|
@@ -142,7 +188,9 @@ define('vs/language/kusto/languageService/kustoMonarchLanguageDefinition',["requ
|
|
|
142
188
|
[/[;,.]/, 'delimiter'],
|
|
143
189
|
[/[()\[\]]/, '@brackets'],
|
|
144
190
|
[/[<>=!%&+\-*/|~^]/, 'operator'],
|
|
145
|
-
[
|
|
191
|
+
[
|
|
192
|
+
/[\w@#\-$]+/,
|
|
193
|
+
{
|
|
146
194
|
cases: {
|
|
147
195
|
'@keywords': 'keyword',
|
|
148
196
|
'@promotedOperatorCommandTokens': 'operator.sql',
|
|
@@ -150,41 +198,44 @@ define('vs/language/kusto/languageService/kustoMonarchLanguageDefinition',["requ
|
|
|
150
198
|
'@operators': 'operator',
|
|
151
199
|
'@builtinFunctions': 'predefined',
|
|
152
200
|
'@default': 'identifier',
|
|
153
|
-
}
|
|
154
|
-
}
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
],
|
|
155
204
|
],
|
|
156
205
|
whitespace: [[/\s+/, 'white']],
|
|
157
|
-
comments: [[
|
|
206
|
+
comments: [['\\/\\/+.*', 'comment']],
|
|
158
207
|
numbers: [
|
|
159
208
|
[/0[xX][0-9a-fA-F]*/, 'number'],
|
|
160
209
|
[/[$][+-]*\d*(\.\d*)?/, 'number'],
|
|
161
|
-
[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/, 'number']
|
|
210
|
+
[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/, 'number'],
|
|
162
211
|
],
|
|
163
212
|
strings: [
|
|
164
213
|
[/H'/, { token: 'string.quote', bracket: '@open', next: '@string' }],
|
|
165
214
|
[/h'/, { token: 'string.quote', bracket: '@open', next: '@string' }],
|
|
166
|
-
[/'/, { token: 'string.quote', bracket: '@open', next: '@string' }]
|
|
215
|
+
[/'/, { token: 'string.quote', bracket: '@open', next: '@string' }],
|
|
167
216
|
],
|
|
168
217
|
string: [
|
|
169
218
|
[/[^']+/, 'string'],
|
|
170
219
|
[/''/, 'string'],
|
|
171
|
-
[/'/, { token: 'string.quote', bracket: '@close', next: '@pop' }]
|
|
220
|
+
[/'/, { token: 'string.quote', bracket: '@close', next: '@pop' }],
|
|
172
221
|
],
|
|
173
222
|
dqstrings: [
|
|
174
223
|
[/H"/, { token: 'string.quote', bracket: '@open', next: '@dqstring' }],
|
|
175
224
|
[/h"/, { token: 'string.quote', bracket: '@open', next: '@dqstring' }],
|
|
176
|
-
[/"/, { token: 'string.quote', bracket: '@open', next: '@dqstring' }]
|
|
225
|
+
[/"/, { token: 'string.quote', bracket: '@open', next: '@dqstring' }],
|
|
177
226
|
],
|
|
178
227
|
dqstring: [
|
|
179
228
|
[/[^"]+/, 'string'],
|
|
180
229
|
[/""/, 'string'],
|
|
181
|
-
[/"/, { token: 'string.quote', bracket: '@close', next: '@pop' }]
|
|
230
|
+
[/"/, { token: 'string.quote', bracket: '@close', next: '@pop' }],
|
|
182
231
|
],
|
|
183
|
-
literals: [
|
|
232
|
+
literals: [
|
|
233
|
+
[/datetime\(\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}(:\d{2}(\.\d{0,3})?)?)?\)/, 'number'],
|
|
184
234
|
[/time\((\d+(s(ec(onds?)?)?|m(in(utes?)?)?|h(ours?)?|d(ays?)?)|(\s*(('[^']+')|("[^"]+"))\s*))\)/, 'number'],
|
|
185
235
|
[/guid\([\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}\)/, 'number'],
|
|
186
|
-
[/typeof\((int|string|date|datetime|time|long|real|boolean|bool)\)/, 'number']
|
|
187
|
-
|
|
236
|
+
[/typeof\((int|string|date|datetime|time|long|real|boolean|bool)\)/, 'number'],
|
|
237
|
+
],
|
|
238
|
+
},
|
|
188
239
|
};
|
|
189
240
|
});
|
|
190
241
|
|
|
@@ -2260,7 +2311,6 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
|
|
|
2260
2311
|
var Uri = monaco.Uri;
|
|
2261
2312
|
var Range = monaco.Range;
|
|
2262
2313
|
var ClassificationKind = Kusto.Language.Editor.ClassificationKind;
|
|
2263
|
-
// --- diagnostics ---
|
|
2264
2314
|
var DiagnosticsAdapter = /** @class */ (function () {
|
|
2265
2315
|
function DiagnosticsAdapter(_monacoInstance, _languageId, _worker, defaults, onSchemaChange) {
|
|
2266
2316
|
var _this = this;
|
|
@@ -2403,9 +2453,9 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
|
|
|
2403
2453
|
}
|
|
2404
2454
|
else {
|
|
2405
2455
|
// Add custom popup for syntax error: icon, header and message as markdown
|
|
2406
|
-
var header = syntaxErrorAsMarkDown.header ? "**"
|
|
2407
|
-
var icon = syntaxErrorAsMarkDown.icon ? " : '';
|
|
2457
|
+
var icon = syntaxErrorAsMarkDown.icon ? "") : '';
|
|
2458
|
+
var popupErrorHoverHeaderMessage_1 = "".concat(icon, " ").concat(header);
|
|
2409
2459
|
var newDecorations = markers.map(function (marker) {
|
|
2410
2460
|
return {
|
|
2411
2461
|
range: {
|
|
@@ -2432,8 +2482,7 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
|
|
|
2432
2482
|
},
|
|
2433
2483
|
};
|
|
2434
2484
|
});
|
|
2435
|
-
var oldMarkers = monaco.editor
|
|
2436
|
-
.getModelMarkers({
|
|
2485
|
+
var oldMarkers = monaco.editor.getModelMarkers({
|
|
2437
2486
|
owner: languageId,
|
|
2438
2487
|
resource: resource,
|
|
2439
2488
|
});
|
|
@@ -2739,7 +2788,7 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
|
|
|
2739
2788
|
var classificationColorTriplets = getClassificationColorTriplets();
|
|
2740
2789
|
var cssInnerHtml = classificationColorTriplets
|
|
2741
2790
|
.map(function (pair) {
|
|
2742
|
-
return ".vs ."
|
|
2791
|
+
return ".vs .".concat(pair.classification, " {color: #").concat(pair.colorLight, ";} .vs-dark .").concat(pair.classification, " {color: #").concat(pair.colorDark, ";}");
|
|
2743
2792
|
})
|
|
2744
2793
|
.join('\n');
|
|
2745
2794
|
return cssInnerHtml;
|
|
@@ -2840,7 +2889,7 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
|
|
|
2840
2889
|
text: textEdit.newText,
|
|
2841
2890
|
};
|
|
2842
2891
|
}
|
|
2843
|
-
var DOCS_BASE_URL =
|
|
2892
|
+
var DOCS_BASE_URL = 'https://learn.microsoft.com/azure/data-explorer/kusto/query';
|
|
2844
2893
|
function formatDocLink(docString) {
|
|
2845
2894
|
// If the docString is empty, we want to return undefined to prevent an empty documentation popup.
|
|
2846
2895
|
if (!docString) {
|
|
@@ -2850,9 +2899,11 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
|
|
|
2850
2899
|
var urisProxy = new Proxy(target, {
|
|
2851
2900
|
get: function (_target, prop, _receiver) {
|
|
2852
2901
|
// The link comes with a postfix of ".md" that we want to remove
|
|
2853
|
-
var linkWithoutPostfix = prop.toString().replace(
|
|
2902
|
+
var linkWithoutPostfix = prop.toString().replace('.md', '');
|
|
2854
2903
|
// Sometimes we get the link as a full URL. For example in the main doc link of the item
|
|
2855
|
-
var fullURL = linkWithoutPostfix.startsWith(
|
|
2904
|
+
var fullURL = linkWithoutPostfix.startsWith('https')
|
|
2905
|
+
? linkWithoutPostfix
|
|
2906
|
+
: "".concat(DOCS_BASE_URL, "/").concat(linkWithoutPostfix);
|
|
2856
2907
|
return monaco.Uri.parse(fullURL);
|
|
2857
2908
|
},
|
|
2858
2909
|
});
|
|
@@ -3205,7 +3256,10 @@ define('vs/language/kusto/kustoMode',["require", "exports", "./workerManager", "
|
|
|
3205
3256
|
return (__assign(__assign({}, worker), { setSchema: function (schema) { return augmentedSetSchema(schema, worker); }, setSchemaFromShowSchema: function (schema, connection, database, globalScalarParameters, globalTabularParameters) {
|
|
3206
3257
|
worker
|
|
3207
3258
|
.normalizeSchema(schema, connection, database)
|
|
3208
|
-
.then(function (schema) {
|
|
3259
|
+
.then(function (schema) {
|
|
3260
|
+
return globalScalarParameters
|
|
3261
|
+
? __assign(__assign({}, schema), { globalScalarParameters: globalScalarParameters, globalTabularParameters: globalTabularParameters }) : schema;
|
|
3262
|
+
})
|
|
3209
3263
|
.then(function (normalized) { return augmentedSetSchema(normalized, worker); });
|
|
3210
3264
|
} }));
|
|
3211
3265
|
});
|
|
@@ -23,9 +23,10 @@ define('vs/language/kusto/languageService/schema',["require", "exports"], functi
|
|
|
23
23
|
'Newtonsoft.Json.Linq.JObject': 'dynamic',
|
|
24
24
|
'Newtonsoft.Json.Linq.JToken': 'dynamic',
|
|
25
25
|
'System.Object': 'dynamic',
|
|
26
|
-
'System.Data.SqlTypes.SqlDecimal': 'decimal'
|
|
26
|
+
'System.Data.SqlTypes.SqlDecimal': 'decimal',
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
var getCslTypeNameFromClrType = function (clrType) { return dotnetTypeToKustoType[clrType] || clrType; };
|
|
29
|
+
exports.getCslTypeNameFromClrType = getCslTypeNameFromClrType;
|
|
29
30
|
var kustoTypeToEntityDataType = {
|
|
30
31
|
object: 'Object',
|
|
31
32
|
bool: 'Boolean',
|
|
@@ -42,28 +43,32 @@ define('vs/language/kusto/languageService/schema',["require", "exports"], functi
|
|
|
42
43
|
datetime: 'DateTime',
|
|
43
44
|
string: 'String',
|
|
44
45
|
dynamic: 'Dynamic',
|
|
45
|
-
timespan: 'TimeSpan'
|
|
46
|
+
timespan: 'TimeSpan',
|
|
46
47
|
};
|
|
47
|
-
|
|
48
|
-
exports.
|
|
49
|
-
|
|
48
|
+
var getEntityDataTypeFromCslType = function (cslType) { return kustoTypeToEntityDataType[cslType] || cslType; };
|
|
49
|
+
exports.getEntityDataTypeFromCslType = getEntityDataTypeFromCslType;
|
|
50
|
+
var getCallName = function (fn) {
|
|
51
|
+
return "".concat(fn.name, "(").concat(fn.inputParameters.map(function (p) { return "{".concat(p.name, "}"); }).join(','), ")");
|
|
50
52
|
};
|
|
51
|
-
exports.
|
|
52
|
-
|
|
53
|
+
exports.getCallName = getCallName;
|
|
54
|
+
var getExpression = function (fn) {
|
|
55
|
+
return "let ".concat(fn.name, " = ").concat((0, exports.getInputParametersAsCslString)(fn.inputParameters), " ").concat(fn.body);
|
|
53
56
|
};
|
|
54
|
-
exports.
|
|
55
|
-
|
|
57
|
+
exports.getExpression = getExpression;
|
|
58
|
+
var getInputParametersAsCslString = function (inputParameters) {
|
|
59
|
+
return "(".concat(inputParameters.map(function (inputParameter) { return getInputParameterAsCslString(inputParameter); }).join(','), ")");
|
|
56
60
|
};
|
|
61
|
+
exports.getInputParametersAsCslString = getInputParametersAsCslString;
|
|
57
62
|
var getInputParameterAsCslString = function (inputParameter) {
|
|
58
63
|
// If this is a tabular parameter
|
|
59
64
|
if (inputParameter.columns && inputParameter.columns.length > 0) {
|
|
60
65
|
var attributesAsString = inputParameter.columns
|
|
61
|
-
.map(function (col) { return col.name
|
|
66
|
+
.map(function (col) { return "".concat(col.name, ":").concat(col.cslType || (0, exports.getCslTypeNameFromClrType)(col.type)); })
|
|
62
67
|
.join(',');
|
|
63
|
-
return inputParameter.name
|
|
68
|
+
return "".concat(inputParameter.name, ":").concat(attributesAsString === '' ? '*' : attributesAsString);
|
|
64
69
|
}
|
|
65
70
|
else {
|
|
66
|
-
return inputParameter.name
|
|
71
|
+
return "".concat(inputParameter.name, ":").concat(inputParameter.cslType || (0, exports.getCslTypeNameFromClrType)(inputParameter.type));
|
|
67
72
|
}
|
|
68
73
|
};
|
|
69
74
|
});
|
|
@@ -6656,12 +6661,14 @@ var __assign = (this && this.__assign) || function () {
|
|
|
6656
6661
|
};
|
|
6657
6662
|
return __assign.apply(this, arguments);
|
|
6658
6663
|
};
|
|
6659
|
-
var
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6664
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
6665
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
6666
|
+
if (ar || !(i in from)) {
|
|
6667
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6668
|
+
ar[i] = from[i];
|
|
6669
|
+
}
|
|
6670
|
+
}
|
|
6671
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
6665
6672
|
};
|
|
6666
6673
|
define('vs/language/kusto/languageService/kustoLanguageService',["require", "exports", "./schema", "vscode-languageserver-types", "xregexp", "./schema"], function (require, exports, s, ls, XRegExp, schema_1) {
|
|
6667
6674
|
"use strict";
|
|
@@ -6768,7 +6775,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
6768
6775
|
/**
|
|
6769
6776
|
* Taken from:
|
|
6770
6777
|
* https://msazure.visualstudio.com/One/_git/Azure-Kusto-Service?path=/Src/Tools/Kusto.Explorer.Control/QueryEditors/KustoScriptEditor/KustoScriptEditorControl2.xaml.cs&version=GBdev&line=2075&lineEnd=2075&lineStartColumn=9&lineEndColumn=77&lineStyle=plain&_a=contents
|
|
6771
|
-
|
|
6778
|
+
*/
|
|
6772
6779
|
this._toOptionKind = (_a = {},
|
|
6773
6780
|
_a[k2.CompletionKind.AggregateFunction] = k.OptionKind.FunctionAggregation,
|
|
6774
6781
|
_a[k2.CompletionKind.BuiltInFunction] = k.OptionKind.FunctionScalar,
|
|
@@ -6915,7 +6922,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
6915
6922
|
this._newlineAppendPipePolicy.Text = '\n| ';
|
|
6916
6923
|
}
|
|
6917
6924
|
KustoLanguageService.prototype.createDatabaseUniqueName = function (clusterName, databaseName) {
|
|
6918
|
-
return clusterName
|
|
6925
|
+
return "".concat(clusterName, "_").concat(databaseName);
|
|
6919
6926
|
};
|
|
6920
6927
|
Object.defineProperty(KustoLanguageService.prototype, "_kustoJsSchemaV2", {
|
|
6921
6928
|
/**
|
|
@@ -6962,20 +6969,20 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
6962
6969
|
*/
|
|
6963
6970
|
KustoLanguageService.prototype.debugGlobalState = function (globals) {
|
|
6964
6971
|
// iterate over clusters
|
|
6965
|
-
console.log("globals.Clusters.Count: "
|
|
6972
|
+
console.log("globals.Clusters.Count: ".concat(globals.Clusters.Count));
|
|
6966
6973
|
for (var i = 0; i < globals.Clusters.Count; i++) {
|
|
6967
6974
|
var cluster = globals.Clusters.getItem(i);
|
|
6968
|
-
console.log("cluster: "
|
|
6975
|
+
console.log("cluster: ".concat(cluster.Name));
|
|
6969
6976
|
// iterate over databases
|
|
6970
|
-
console.log("cluster.Databases.Count: "
|
|
6977
|
+
console.log("cluster.Databases.Count: ".concat(cluster.Databases.Count));
|
|
6971
6978
|
for (var i2 = 0; i2 < cluster.Databases.Count; i2++) {
|
|
6972
6979
|
var database = cluster.Databases.getItem(i2);
|
|
6973
|
-
console.log("cluster.database: ["
|
|
6980
|
+
console.log("cluster.database: [".concat(cluster.Name, "].[").concat(database.Name, "]"));
|
|
6974
6981
|
// iterate over tables
|
|
6975
|
-
console.log("cluster.Databases.Tables.Count: "
|
|
6982
|
+
console.log("cluster.Databases.Tables.Count: ".concat(database.Tables.Count));
|
|
6976
6983
|
for (var i3 = 0; i3 < database.Tables.Count; i3++) {
|
|
6977
6984
|
var table = database.Tables.getItem(i3);
|
|
6978
|
-
console.log("cluster.database.table: ["
|
|
6985
|
+
console.log("cluster.database.table: [".concat(cluster.Name, "].[").concat(database.Name, "].[").concat(table.Name, "]"));
|
|
6979
6986
|
}
|
|
6980
6987
|
}
|
|
6981
6988
|
}
|
|
@@ -6984,7 +6991,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
6984
6991
|
* Prepending the doc of the actual topic at the top
|
|
6985
6992
|
*/
|
|
6986
6993
|
KustoLanguageService.prototype.formatHelpTopic = function (helpTopic) {
|
|
6987
|
-
return "**"
|
|
6994
|
+
return "**".concat(helpTopic.Name, " [(view online)](").concat(helpTopic.Url, ")**\n\n").concat(helpTopic.LongDescription);
|
|
6988
6995
|
};
|
|
6989
6996
|
KustoLanguageService.prototype.doCompleteV2 = function (document, position) {
|
|
6990
6997
|
var _this = this;
|
|
@@ -7026,7 +7033,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
7026
7033
|
? {
|
|
7027
7034
|
// Need to escape dollar sign since it is used as a placeholder in snippet.
|
|
7028
7035
|
// Usually dollar sign is not a valid character in a function name, but grafana uses macros that start with dollars.
|
|
7029
|
-
textToInsert: kItem.EditText.replace('$', '\\$')
|
|
7036
|
+
textToInsert: "".concat(kItem.EditText.replace('$', '\\$'), "$0").concat(kItem.AfterText),
|
|
7030
7037
|
format: ls.InsertTextFormat.Snippet,
|
|
7031
7038
|
}
|
|
7032
7039
|
: {
|
|
@@ -7436,7 +7443,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
7436
7443
|
this._script = undefined;
|
|
7437
7444
|
this._parsePropertiesV2 = undefined;
|
|
7438
7445
|
}
|
|
7439
|
-
// since V2 doesn't support control commands, we're initializing V1 intellisense for both cases and we'll going to use V1 intellisense for
|
|
7446
|
+
// since V2 doesn't support control commands, we're initializing V1 intellisense for both cases and we'll going to use V1 intellisense for control commands.
|
|
7440
7447
|
return new Promise(function (resolve, reject) {
|
|
7441
7448
|
var kustoJsSchema = schema ? KustoLanguageService.convertToKustoJsSchema(schema) : undefined;
|
|
7442
7449
|
_this._kustoJsSchema = kustoJsSchema;
|
|
@@ -7451,8 +7458,10 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
7451
7458
|
this._schema.globalScalarParameters = scalarParameters;
|
|
7452
7459
|
this._schema.globalTabularParameters = tabularParameters;
|
|
7453
7460
|
var scalarSymbols = scalarParameters.map(function (param) { return KustoLanguageService.createParameterSymbol(param); });
|
|
7454
|
-
var tabularSymbols = tabularParameters.map(function (param) {
|
|
7455
|
-
|
|
7461
|
+
var tabularSymbols = tabularParameters.map(function (param) {
|
|
7462
|
+
return KustoLanguageService.createTabularParameterSymbol(param);
|
|
7463
|
+
});
|
|
7464
|
+
this._kustoJsSchemaV2 = this._kustoJsSchemaV2.WithParameters(KustoLanguageService.toBridgeList(__spreadArray(__spreadArray([], scalarSymbols, true), tabularSymbols, true)));
|
|
7456
7465
|
return Promise.resolve(undefined);
|
|
7457
7466
|
};
|
|
7458
7467
|
/**
|
|
@@ -8046,7 +8055,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
8046
8055
|
table.columns.forEach(function (column) {
|
|
8047
8056
|
var kColumn = new k.KustoIntelliSenseColumnEntity();
|
|
8048
8057
|
kColumn.Name = column.name;
|
|
8049
|
-
kColumn.TypeCode = k.EntityDataType[schema_1.getEntityDataTypeFromCslType(column.type)];
|
|
8058
|
+
kColumn.TypeCode = k.EntityDataType[(0, schema_1.getEntityDataTypeFromCslType)(column.type)];
|
|
8050
8059
|
cols.push(kColumn);
|
|
8051
8060
|
});
|
|
8052
8061
|
kTable.Columns = new Bridge.ArrayEnumerable(cols);
|
|
@@ -8099,8 +8108,8 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
8099
8108
|
* @param params scalar parameters
|
|
8100
8109
|
*/
|
|
8101
8110
|
KustoLanguageService.scalarParametersToSignature = function (params) {
|
|
8102
|
-
var signatureWithoutParens = params.map(function (param) { return param.name
|
|
8103
|
-
return "("
|
|
8111
|
+
var signatureWithoutParens = params.map(function (param) { return "".concat(param.name, ": ").concat(param.cslType); }).join(', ');
|
|
8112
|
+
return "(".concat(signatureWithoutParens, ")");
|
|
8104
8113
|
};
|
|
8105
8114
|
/**
|
|
8106
8115
|
* Returns something like '(x: string, T: (y: int))'
|
|
@@ -8112,14 +8121,14 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
8112
8121
|
.map(function (param) {
|
|
8113
8122
|
if (param.columns) {
|
|
8114
8123
|
var tableSignature = _this.scalarParametersToSignature(param.columns);
|
|
8115
|
-
return param.name
|
|
8124
|
+
return "".concat(param.name, ": ").concat(tableSignature);
|
|
8116
8125
|
}
|
|
8117
8126
|
else {
|
|
8118
|
-
return param.name
|
|
8127
|
+
return "".concat(param.name, ": ").concat(param.cslType);
|
|
8119
8128
|
}
|
|
8120
8129
|
})
|
|
8121
8130
|
.join(', ');
|
|
8122
|
-
return "("
|
|
8131
|
+
return "(".concat(signatureWithoutParens, ")");
|
|
8123
8132
|
};
|
|
8124
8133
|
/**
|
|
8125
8134
|
* converts a function definition to a let statement.
|
|
@@ -8127,13 +8136,13 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
8127
8136
|
*/
|
|
8128
8137
|
KustoLanguageService.toLetStatement = function (fn) {
|
|
8129
8138
|
var signature = this.inputParameterToSignature(fn.inputParameters);
|
|
8130
|
-
return "let "
|
|
8139
|
+
return "let ".concat(fn.name, " = ").concat(signature, " ").concat(fn.body);
|
|
8131
8140
|
};
|
|
8132
8141
|
KustoLanguageService.createColumnSymbol = function (col) {
|
|
8133
|
-
return new sym.ColumnSymbol(col.name, sym.ScalarTypes.GetSymbol(schema_1.getCslTypeNameFromClrType(col.type)), col.docstring, null, null, col.examples ? KustoLanguageService.toBridgeList(col.examples) : null);
|
|
8142
|
+
return new sym.ColumnSymbol(col.name, sym.ScalarTypes.GetSymbol((0, schema_1.getCslTypeNameFromClrType)(col.type)), col.docstring, null, null, col.examples ? KustoLanguageService.toBridgeList(col.examples) : null);
|
|
8134
8143
|
};
|
|
8135
8144
|
KustoLanguageService.createParameterSymbol = function (param) {
|
|
8136
|
-
var paramSymbol = Kusto.Language.Symbols.ScalarTypes.GetSymbol(schema_1.getCslTypeNameFromClrType(param.type));
|
|
8145
|
+
var paramSymbol = Kusto.Language.Symbols.ScalarTypes.GetSymbol((0, schema_1.getCslTypeNameFromClrType)(param.type));
|
|
8137
8146
|
return new sym.ParameterSymbol(param.name, paramSymbol, null);
|
|
8138
8147
|
};
|
|
8139
8148
|
KustoLanguageService.createTabularParameterSymbol = function (param) {
|
|
@@ -8143,7 +8152,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
8143
8152
|
};
|
|
8144
8153
|
KustoLanguageService.createParameter = function (param) {
|
|
8145
8154
|
if (!param.columns) {
|
|
8146
|
-
var paramSymbol = Kusto.Language.Symbols.ScalarTypes.GetSymbol(schema_1.getCslTypeNameFromClrType(param.type));
|
|
8155
|
+
var paramSymbol = Kusto.Language.Symbols.ScalarTypes.GetSymbol((0, schema_1.getCslTypeNameFromClrType)(param.type));
|
|
8147
8156
|
var expression = param.cslDefaultValue && typeof param.cslDefaultValue === 'string'
|
|
8148
8157
|
? parsing.QueryParser.ParseLiteral$1(param.cslDefaultValue)
|
|
8149
8158
|
: undefined;
|
|
@@ -8235,11 +8244,15 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
8235
8244
|
globalState = globalState.WithDatabase(databaseInContext);
|
|
8236
8245
|
}
|
|
8237
8246
|
// Inject global scalar parameters to global scope.
|
|
8238
|
-
var scalarParameters = ((_a = schema.globalScalarParameters) !== null && _a !== void 0 ? _a : []).map(function (param) {
|
|
8247
|
+
var scalarParameters = ((_a = schema.globalScalarParameters) !== null && _a !== void 0 ? _a : []).map(function (param) {
|
|
8248
|
+
return KustoLanguageService.createParameterSymbol(param);
|
|
8249
|
+
});
|
|
8239
8250
|
// Inject global tabular parameters to global scope.
|
|
8240
|
-
var tabularParameters = ((_b = schema.globalTabularParameters) !== null && _b !== void 0 ? _b : []).map(function (param) {
|
|
8251
|
+
var tabularParameters = ((_b = schema.globalTabularParameters) !== null && _b !== void 0 ? _b : []).map(function (param) {
|
|
8252
|
+
return KustoLanguageService.createTabularParameterSymbol(param);
|
|
8253
|
+
});
|
|
8241
8254
|
if (tabularParameters.length || scalarParameters.length) {
|
|
8242
|
-
globalState = globalState.WithParameters(KustoLanguageService.toBridgeList(
|
|
8255
|
+
globalState = globalState.WithParameters(KustoLanguageService.toBridgeList(__spreadArray(__spreadArray([], scalarParameters, true), tabularParameters, true)));
|
|
8243
8256
|
}
|
|
8244
8257
|
return globalState;
|
|
8245
8258
|
};
|
|
@@ -8276,7 +8289,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
8276
8289
|
*/
|
|
8277
8290
|
KustoLanguageService.prototype.getSortText = function (order) {
|
|
8278
8291
|
if (order <= 0) {
|
|
8279
|
-
throw new RangeError("order should be a number >= 1. instead got "
|
|
8292
|
+
throw new RangeError("order should be a number >= 1. instead got ".concat(order));
|
|
8280
8293
|
}
|
|
8281
8294
|
var sortText = '';
|
|
8282
8295
|
var numCharacters = 26; // "z" - "a" + 1;
|
|
@@ -8481,7 +8494,7 @@ define('vs/language/kusto/kustoWorker',["require", "exports", "./languageService
|
|
|
8481
8494
|
KustoWorker.prototype.addClusterToSchema = function (uri, clusterName, databasesNames) {
|
|
8482
8495
|
var document = this._getTextDocument(uri);
|
|
8483
8496
|
if (!document) {
|
|
8484
|
-
console.error("addClusterToSchema: document is "
|
|
8497
|
+
console.error("addClusterToSchema: document is ".concat(document, ". uri is ").concat(uri));
|
|
8485
8498
|
return Promise.resolve();
|
|
8486
8499
|
}
|
|
8487
8500
|
return this._languageService.addClusterToSchema(document, clusterName, databasesNames);
|
|
@@ -8489,7 +8502,7 @@ define('vs/language/kusto/kustoWorker',["require", "exports", "./languageService
|
|
|
8489
8502
|
KustoWorker.prototype.addDatabaseToSchema = function (uri, clusterName, databaseSchema) {
|
|
8490
8503
|
var document = this._getTextDocument(uri);
|
|
8491
8504
|
if (!document) {
|
|
8492
|
-
console.error("addDatabaseToSchema: document is "
|
|
8505
|
+
console.error("addDatabaseToSchema: document is ".concat(document, ". uri is ").concat(uri));
|
|
8493
8506
|
return Promise.resolve();
|
|
8494
8507
|
}
|
|
8495
8508
|
return this._languageService.addDatabaseToSchema(document, clusterName, databaseSchema);
|
|
@@ -8506,7 +8519,7 @@ define('vs/language/kusto/kustoWorker',["require", "exports", "./languageService
|
|
|
8506
8519
|
KustoWorker.prototype.getCommandInContext = function (uri, cursorOffset) {
|
|
8507
8520
|
var document = this._getTextDocument(uri);
|
|
8508
8521
|
if (!document) {
|
|
8509
|
-
console.error("getCommandInContext: document is "
|
|
8522
|
+
console.error("getCommandInContext: document is ".concat(document, ". uri is ").concat(uri));
|
|
8510
8523
|
return null;
|
|
8511
8524
|
}
|
|
8512
8525
|
var commandInContext = this._languageService.getCommandInContext(document, cursorOffset);
|
|
@@ -8518,7 +8531,7 @@ define('vs/language/kusto/kustoWorker',["require", "exports", "./languageService
|
|
|
8518
8531
|
KustoWorker.prototype.getQueryParams = function (uri, cursorOffset) {
|
|
8519
8532
|
var document = this._getTextDocument(uri);
|
|
8520
8533
|
if (!document) {
|
|
8521
|
-
console.error("getQueryParams: document is "
|
|
8534
|
+
console.error("getQueryParams: document is ".concat(document, ". uri is ").concat(uri));
|
|
8522
8535
|
return null;
|
|
8523
8536
|
}
|
|
8524
8537
|
var queryParams = this._languageService.getQueryParams(document, cursorOffset);
|
|
@@ -8530,7 +8543,7 @@ define('vs/language/kusto/kustoWorker',["require", "exports", "./languageService
|
|
|
8530
8543
|
KustoWorker.prototype.getGlobalParams = function (uri) {
|
|
8531
8544
|
var document = this._getTextDocument(uri);
|
|
8532
8545
|
if (!document) {
|
|
8533
|
-
console.error("getGLobalParams: document is "
|
|
8546
|
+
console.error("getGLobalParams: document is ".concat(document, ". uri is ").concat(uri));
|
|
8534
8547
|
return null;
|
|
8535
8548
|
}
|
|
8536
8549
|
var globalParams = this._languageService.getGlobalParams(document);
|
|
@@ -8542,7 +8555,7 @@ define('vs/language/kusto/kustoWorker',["require", "exports", "./languageService
|
|
|
8542
8555
|
KustoWorker.prototype.getReferencedGlobalParams = function (uri, cursorOffest) {
|
|
8543
8556
|
var document = this._getTextDocument(uri);
|
|
8544
8557
|
if (!document) {
|
|
8545
|
-
console.error("getReferencedGlobalParams: document is "
|
|
8558
|
+
console.error("getReferencedGlobalParams: document is ".concat(document, ". uri is ").concat(uri));
|
|
8546
8559
|
return null;
|
|
8547
8560
|
}
|
|
8548
8561
|
var referencedParams = this._languageService.getReferencedGlobalParams(document, cursorOffest);
|
|
@@ -8554,7 +8567,7 @@ define('vs/language/kusto/kustoWorker',["require", "exports", "./languageService
|
|
|
8554
8567
|
KustoWorker.prototype.getRenderInfo = function (uri, cursorOffset) {
|
|
8555
8568
|
var document = this._getTextDocument(uri);
|
|
8556
8569
|
if (!document) {
|
|
8557
|
-
console.error("getRenderInfo: document is "
|
|
8570
|
+
console.error("getRenderInfo: document is ".concat(document, ". uri is ").concat(uri));
|
|
8558
8571
|
}
|
|
8559
8572
|
return this._languageService.getRenderInfo(document, cursorOffset).then(function (result) {
|
|
8560
8573
|
if (!result) {
|
|
@@ -8572,7 +8585,7 @@ define('vs/language/kusto/kustoWorker',["require", "exports", "./languageService
|
|
|
8572
8585
|
KustoWorker.prototype.getCommandAndLocationInContext = function (uri, cursorOffset) {
|
|
8573
8586
|
var document = this._getTextDocument(uri);
|
|
8574
8587
|
if (!document) {
|
|
8575
|
-
console.error("getCommandAndLocationInContext: document is "
|
|
8588
|
+
console.error("getCommandAndLocationInContext: document is ".concat(document, ". uri is ").concat(uri));
|
|
8576
8589
|
return Promise.resolve(null);
|
|
8577
8590
|
}
|
|
8578
8591
|
return this._languageService.getCommandAndLocationInContext(document, cursorOffset).then(function (result) {
|
|
@@ -8591,7 +8604,7 @@ define('vs/language/kusto/kustoWorker',["require", "exports", "./languageService
|
|
|
8591
8604
|
KustoWorker.prototype.getCommandsInDocument = function (uri) {
|
|
8592
8605
|
var document = this._getTextDocument(uri);
|
|
8593
8606
|
if (!document) {
|
|
8594
|
-
console.error("getCommandInDocument: document is "
|
|
8607
|
+
console.error("getCommandInDocument: document is ".concat(document, ". uri is ").concat(uri));
|
|
8595
8608
|
return null;
|
|
8596
8609
|
}
|
|
8597
8610
|
return this._languageService.getCommandsInDocument(document);
|