@kusto/monaco-kusto 5.3.8 → 5.3.10
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 +2 -2
- package/release/dev/kustoMode.js +3 -3
- package/release/dev/kustoWorker.js +33 -17
- package/release/esm/kustoMode.js +3 -3
- package/release/esm/kustoWorker.js +2 -2
- package/release/esm/languageService/kustoLanguageService.js +31 -15
- package/release/esm/monaco.d.ts +7 -2
- package/release/min/Kusto.Language.Bridge.min.js +1 -1
- package/release/min/kustoMode.js +2 -2
- package/release/min/kustoWorker.js +2 -2
- package/release/min/monaco.contribution.js +1 -1
- package/release/min/monaco.d.ts +7 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kusto/monaco-kusto",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.10",
|
|
4
4
|
"description": "CSL, KQL plugin for the Monaco Editor",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Microsoft"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@kusto/language-service": "0.0.39",
|
|
58
|
-
"@kusto/language-service-next": "0.0.
|
|
58
|
+
"@kusto/language-service-next": "0.0.62"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"monaco-editor": "0.34.1"
|
package/release/dev/kustoMode.js
CHANGED
|
@@ -3194,7 +3194,7 @@ define('vs/language/kusto/kustoMode',["require", "exports", "./workerManager", "
|
|
|
3194
3194
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
3195
3195
|
more[_i - 1] = arguments[_i];
|
|
3196
3196
|
}
|
|
3197
|
-
var augmentedSetSchema = function (schema, worker,
|
|
3197
|
+
var augmentedSetSchema = function (schema, worker, globalScalarParameters, globalTabularParameters) {
|
|
3198
3198
|
var workerPromise = worker.setSchema(schema);
|
|
3199
3199
|
workerPromise.then(function () {
|
|
3200
3200
|
onSchemaChange.fire(schema);
|
|
@@ -3202,10 +3202,10 @@ define('vs/language/kusto/kustoMode',["require", "exports", "./workerManager", "
|
|
|
3202
3202
|
};
|
|
3203
3203
|
var worker = client.getLanguageServiceWorker.apply(client, [first].concat(more));
|
|
3204
3204
|
return worker.then(function (worker) {
|
|
3205
|
-
return (__assign(__assign({}, worker), { setSchema: function (schema) { return augmentedSetSchema(schema, worker); }, setSchemaFromShowSchema: function (schema, connection, database,
|
|
3205
|
+
return (__assign(__assign({}, worker), { setSchema: function (schema) { return augmentedSetSchema(schema, worker); }, setSchemaFromShowSchema: function (schema, connection, database, globalScalarParameters, globalTabularParameters) {
|
|
3206
3206
|
worker
|
|
3207
3207
|
.normalizeSchema(schema, connection, database)
|
|
3208
|
-
.then(function (schema) { return (
|
|
3208
|
+
.then(function (schema) { return (globalScalarParameters ? __assign(__assign({}, schema), { globalScalarParameters: globalScalarParameters, globalTabularParameters: globalTabularParameters }) : schema); })
|
|
3209
3209
|
.then(function (normalized) { return augmentedSetSchema(normalized, worker); });
|
|
3210
3210
|
} }));
|
|
3211
3211
|
});
|
|
@@ -6656,6 +6656,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
6656
6656
|
};
|
|
6657
6657
|
return __assign.apply(this, arguments);
|
|
6658
6658
|
};
|
|
6659
|
+
var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
6660
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
6661
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
6662
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
6663
|
+
r[k] = a[j];
|
|
6664
|
+
return r;
|
|
6665
|
+
};
|
|
6659
6666
|
define('vs/language/kusto/languageService/kustoLanguageService',["require", "exports", "./schema", "vscode-languageserver-types", "xregexp", "./schema"], function (require, exports, s, ls, XRegExp, schema_1) {
|
|
6660
6667
|
"use strict";
|
|
6661
6668
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -7437,13 +7444,15 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
7437
7444
|
resolve(undefined);
|
|
7438
7445
|
});
|
|
7439
7446
|
};
|
|
7440
|
-
KustoLanguageService.prototype.setParameters = function (
|
|
7447
|
+
KustoLanguageService.prototype.setParameters = function (scalarParameters, tabularParameters) {
|
|
7441
7448
|
if (!this._languageSettings.useIntellisenseV2 || this._schema.clusterType !== 'Engine') {
|
|
7442
7449
|
throw new Error('setParameters requires intellisense V2 and Engine cluster');
|
|
7443
7450
|
}
|
|
7444
|
-
this._schema.
|
|
7445
|
-
|
|
7446
|
-
|
|
7451
|
+
this._schema.globalScalarParameters = scalarParameters;
|
|
7452
|
+
this._schema.globalTabularParameters = tabularParameters;
|
|
7453
|
+
var scalarSymbols = scalarParameters.map(function (param) { return KustoLanguageService.createParameterSymbol(param); });
|
|
7454
|
+
var tabularSymbols = tabularParameters.map(function (param) { return KustoLanguageService.createTabularParameterSymbol(param); });
|
|
7455
|
+
this._kustoJsSchemaV2 = this._kustoJsSchemaV2.WithParameters(KustoLanguageService.toBridgeList(__spreadArrays(scalarSymbols, tabularSymbols)));
|
|
7447
7456
|
return Promise.resolve(undefined);
|
|
7448
7457
|
};
|
|
7449
7458
|
/**
|
|
@@ -7452,10 +7461,10 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
7452
7461
|
* @param clusterConnectionString cluster connection string
|
|
7453
7462
|
* @param databaseInContextName name of database in context
|
|
7454
7463
|
*/
|
|
7455
|
-
KustoLanguageService.prototype.setSchemaFromShowSchema = function (schema, clusterConnectionString, databaseInContextName,
|
|
7464
|
+
KustoLanguageService.prototype.setSchemaFromShowSchema = function (schema, clusterConnectionString, databaseInContextName, globalScalarParameters, globalTabularParameters) {
|
|
7456
7465
|
var _this = this;
|
|
7457
7466
|
return this.normalizeSchema(schema, clusterConnectionString, databaseInContextName).then(function (normalized) {
|
|
7458
|
-
return _this.setSchema(__assign(__assign({}, normalized), {
|
|
7467
|
+
return _this.setSchema(__assign(__assign({}, normalized), { globalScalarParameters: globalScalarParameters, globalTabularParameters: globalTabularParameters }));
|
|
7459
7468
|
});
|
|
7460
7469
|
};
|
|
7461
7470
|
/**
|
|
@@ -7491,11 +7500,12 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
7491
7500
|
docstring: DocString,
|
|
7492
7501
|
entityType: tableEntity,
|
|
7493
7502
|
columns: OrderedColumns.map(function (_a) {
|
|
7494
|
-
var Name = _a.Name, Type = _a.Type, DocString = _a.DocString, CslType = _a.CslType;
|
|
7503
|
+
var Name = _a.Name, Type = _a.Type, DocString = _a.DocString, CslType = _a.CslType, Examples = _a.Examples;
|
|
7495
7504
|
return ({
|
|
7496
7505
|
name: Name,
|
|
7497
7506
|
type: CslType,
|
|
7498
7507
|
docstring: DocString,
|
|
7508
|
+
examples: Examples,
|
|
7499
7509
|
});
|
|
7500
7510
|
}),
|
|
7501
7511
|
});
|
|
@@ -8120,12 +8130,17 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
8120
8130
|
return "let " + fn.name + " = " + signature + " " + fn.body;
|
|
8121
8131
|
};
|
|
8122
8132
|
KustoLanguageService.createColumnSymbol = function (col) {
|
|
8123
|
-
return new sym.ColumnSymbol(col.name, sym.ScalarTypes.GetSymbol(schema_1.getCslTypeNameFromClrType(col.type)), col.docstring, null);
|
|
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);
|
|
8124
8134
|
};
|
|
8125
8135
|
KustoLanguageService.createParameterSymbol = function (param) {
|
|
8126
8136
|
var paramSymbol = Kusto.Language.Symbols.ScalarTypes.GetSymbol(schema_1.getCslTypeNameFromClrType(param.type));
|
|
8127
8137
|
return new sym.ParameterSymbol(param.name, paramSymbol, null);
|
|
8128
8138
|
};
|
|
8139
|
+
KustoLanguageService.createTabularParameterSymbol = function (param) {
|
|
8140
|
+
var columnSymbols = param.columns.map(function (col) { return KustoLanguageService.createColumnSymbol(col); });
|
|
8141
|
+
var para = new Kusto.Language.Symbols.TableSymbol.$ctor4(param.name, columnSymbols);
|
|
8142
|
+
return new sym.ParameterSymbol(param.name, para, param.docstring);
|
|
8143
|
+
};
|
|
8129
8144
|
KustoLanguageService.createParameter = function (param) {
|
|
8130
8145
|
if (!param.columns) {
|
|
8131
8146
|
var paramSymbol = Kusto.Language.Symbols.ScalarTypes.GetSymbol(schema_1.getCslTypeNameFromClrType(param.type));
|
|
@@ -8146,7 +8161,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
8146
8161
|
return KustoLanguageService.createParameter(param);
|
|
8147
8162
|
});
|
|
8148
8163
|
// TODO: handle outputColumns (right now it doesn't seem to be implemented for any function).
|
|
8149
|
-
return new sym.FunctionSymbol.$
|
|
8164
|
+
return new sym.FunctionSymbol.$ctor14(fn.name, fn.body, KustoLanguageService.toBridgeList(parameters), fn.docstring);
|
|
8150
8165
|
};
|
|
8151
8166
|
var createTableSymbol = function (tbl) {
|
|
8152
8167
|
var _a;
|
|
@@ -8175,6 +8190,7 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
8175
8190
|
return databaseSymbol;
|
|
8176
8191
|
};
|
|
8177
8192
|
KustoLanguageService.prototype.convertToKustoJsSchemaV2 = function (schema) {
|
|
8193
|
+
var _a, _b;
|
|
8178
8194
|
var cached = this._schemaCache[schema.cluster.connectionString];
|
|
8179
8195
|
// create a cache entry for the cluster if non yet exists.
|
|
8180
8196
|
if (!cached) {
|
|
@@ -8218,12 +8234,12 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
8218
8234
|
if (databaseInContext) {
|
|
8219
8235
|
globalState = globalState.WithDatabase(databaseInContext);
|
|
8220
8236
|
}
|
|
8221
|
-
// Inject global parameters to global scope.
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
globalState = globalState.WithParameters(KustoLanguageService.toBridgeList(
|
|
8237
|
+
// Inject global scalar parameters to global scope.
|
|
8238
|
+
var scalarParameters = ((_a = schema.globalScalarParameters) !== null && _a !== void 0 ? _a : []).map(function (param) { return KustoLanguageService.createParameterSymbol(param); });
|
|
8239
|
+
// Inject global tabular parameters to global scope.
|
|
8240
|
+
var tabularParameters = ((_b = schema.globalTabularParameters) !== null && _b !== void 0 ? _b : []).map(function (param) { return KustoLanguageService.createTabularParameterSymbol(param); });
|
|
8241
|
+
if (tabularParameters.length || scalarParameters.length) {
|
|
8242
|
+
globalState = globalState.WithParameters(KustoLanguageService.toBridgeList(__spreadArrays(scalarParameters, tabularParameters)));
|
|
8227
8243
|
}
|
|
8228
8244
|
return globalState;
|
|
8229
8245
|
};
|
|
@@ -8645,8 +8661,8 @@ define('vs/language/kusto/kustoWorker',["require", "exports", "./languageService
|
|
|
8645
8661
|
var hover = this._languageService.doHover(document, position);
|
|
8646
8662
|
return hover;
|
|
8647
8663
|
};
|
|
8648
|
-
KustoWorker.prototype.setParameters = function (
|
|
8649
|
-
return this._languageService.setParameters(
|
|
8664
|
+
KustoWorker.prototype.setParameters = function (scalarParameters, tabularParameters) {
|
|
8665
|
+
return this._languageService.setParameters(scalarParameters, tabularParameters);
|
|
8650
8666
|
};
|
|
8651
8667
|
KustoWorker.prototype.getClusterReferences = function (uri, cursorOffset) {
|
|
8652
8668
|
var document = this._getTextDocument(uri);
|
package/release/esm/kustoMode.js
CHANGED
|
@@ -35,7 +35,7 @@ export function setupMode(defaults, monacoInstance) {
|
|
|
35
35
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
36
36
|
more[_i - 1] = arguments[_i];
|
|
37
37
|
}
|
|
38
|
-
var augmentedSetSchema = function (schema, worker,
|
|
38
|
+
var augmentedSetSchema = function (schema, worker, globalScalarParameters, globalTabularParameters) {
|
|
39
39
|
var workerPromise = worker.setSchema(schema);
|
|
40
40
|
workerPromise.then(function () {
|
|
41
41
|
onSchemaChange.fire(schema);
|
|
@@ -43,10 +43,10 @@ export function setupMode(defaults, monacoInstance) {
|
|
|
43
43
|
};
|
|
44
44
|
var worker = client.getLanguageServiceWorker.apply(client, [first].concat(more));
|
|
45
45
|
return worker.then(function (worker) {
|
|
46
|
-
return (__assign(__assign({}, worker), { setSchema: function (schema) { return augmentedSetSchema(schema, worker); }, setSchemaFromShowSchema: function (schema, connection, database,
|
|
46
|
+
return (__assign(__assign({}, worker), { setSchema: function (schema) { return augmentedSetSchema(schema, worker); }, setSchemaFromShowSchema: function (schema, connection, database, globalScalarParameters, globalTabularParameters) {
|
|
47
47
|
worker
|
|
48
48
|
.normalizeSchema(schema, connection, database)
|
|
49
|
-
.then(function (schema) { return (
|
|
49
|
+
.then(function (schema) { return (globalScalarParameters ? __assign(__assign({}, schema), { globalScalarParameters: globalScalarParameters, globalTabularParameters: globalTabularParameters }) : schema); })
|
|
50
50
|
.then(function (normalized) { return augmentedSetSchema(normalized, worker); });
|
|
51
51
|
} }));
|
|
52
52
|
});
|
|
@@ -194,8 +194,8 @@ var KustoWorker = /** @class */ (function () {
|
|
|
194
194
|
var hover = this._languageService.doHover(document, position);
|
|
195
195
|
return hover;
|
|
196
196
|
};
|
|
197
|
-
KustoWorker.prototype.setParameters = function (
|
|
198
|
-
return this._languageService.setParameters(
|
|
197
|
+
KustoWorker.prototype.setParameters = function (scalarParameters, tabularParameters) {
|
|
198
|
+
return this._languageService.setParameters(scalarParameters, tabularParameters);
|
|
199
199
|
};
|
|
200
200
|
KustoWorker.prototype.getClusterReferences = function (uri, cursorOffset) {
|
|
201
201
|
var document = this._getTextDocument(uri);
|
|
@@ -9,6 +9,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
13
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
14
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
15
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
16
|
+
r[k] = a[j];
|
|
17
|
+
return r;
|
|
18
|
+
};
|
|
12
19
|
/// <reference path="../../node_modules/@kusto/language-service/Kusto.JavaScript.Client.d.ts" />
|
|
13
20
|
/// <reference path="../../node_modules/@kusto/language-service-next/Kusto.Language.Bridge.d.ts" />
|
|
14
21
|
/// <reference path="../typings/refs.d.ts" />
|
|
@@ -793,13 +800,15 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
793
800
|
resolve(undefined);
|
|
794
801
|
});
|
|
795
802
|
};
|
|
796
|
-
KustoLanguageService.prototype.setParameters = function (
|
|
803
|
+
KustoLanguageService.prototype.setParameters = function (scalarParameters, tabularParameters) {
|
|
797
804
|
if (!this._languageSettings.useIntellisenseV2 || this._schema.clusterType !== 'Engine') {
|
|
798
805
|
throw new Error('setParameters requires intellisense V2 and Engine cluster');
|
|
799
806
|
}
|
|
800
|
-
this._schema.
|
|
801
|
-
|
|
802
|
-
|
|
807
|
+
this._schema.globalScalarParameters = scalarParameters;
|
|
808
|
+
this._schema.globalTabularParameters = tabularParameters;
|
|
809
|
+
var scalarSymbols = scalarParameters.map(function (param) { return KustoLanguageService.createParameterSymbol(param); });
|
|
810
|
+
var tabularSymbols = tabularParameters.map(function (param) { return KustoLanguageService.createTabularParameterSymbol(param); });
|
|
811
|
+
this._kustoJsSchemaV2 = this._kustoJsSchemaV2.WithParameters(KustoLanguageService.toBridgeList(__spreadArrays(scalarSymbols, tabularSymbols)));
|
|
803
812
|
return Promise.resolve(undefined);
|
|
804
813
|
};
|
|
805
814
|
/**
|
|
@@ -808,10 +817,10 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
808
817
|
* @param clusterConnectionString cluster connection string
|
|
809
818
|
* @param databaseInContextName name of database in context
|
|
810
819
|
*/
|
|
811
|
-
KustoLanguageService.prototype.setSchemaFromShowSchema = function (schema, clusterConnectionString, databaseInContextName,
|
|
820
|
+
KustoLanguageService.prototype.setSchemaFromShowSchema = function (schema, clusterConnectionString, databaseInContextName, globalScalarParameters, globalTabularParameters) {
|
|
812
821
|
var _this = this;
|
|
813
822
|
return this.normalizeSchema(schema, clusterConnectionString, databaseInContextName).then(function (normalized) {
|
|
814
|
-
return _this.setSchema(__assign(__assign({}, normalized), {
|
|
823
|
+
return _this.setSchema(__assign(__assign({}, normalized), { globalScalarParameters: globalScalarParameters, globalTabularParameters: globalTabularParameters }));
|
|
815
824
|
});
|
|
816
825
|
};
|
|
817
826
|
/**
|
|
@@ -847,11 +856,12 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
847
856
|
docstring: DocString,
|
|
848
857
|
entityType: tableEntity,
|
|
849
858
|
columns: OrderedColumns.map(function (_a) {
|
|
850
|
-
var Name = _a.Name, Type = _a.Type, DocString = _a.DocString, CslType = _a.CslType;
|
|
859
|
+
var Name = _a.Name, Type = _a.Type, DocString = _a.DocString, CslType = _a.CslType, Examples = _a.Examples;
|
|
851
860
|
return ({
|
|
852
861
|
name: Name,
|
|
853
862
|
type: CslType,
|
|
854
863
|
docstring: DocString,
|
|
864
|
+
examples: Examples,
|
|
855
865
|
});
|
|
856
866
|
}),
|
|
857
867
|
});
|
|
@@ -1476,12 +1486,17 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
1476
1486
|
return "let " + fn.name + " = " + signature + " " + fn.body;
|
|
1477
1487
|
};
|
|
1478
1488
|
KustoLanguageService.createColumnSymbol = function (col) {
|
|
1479
|
-
return new sym.ColumnSymbol(col.name, sym.ScalarTypes.GetSymbol(getCslTypeNameFromClrType(col.type)), col.docstring, null);
|
|
1489
|
+
return new sym.ColumnSymbol(col.name, sym.ScalarTypes.GetSymbol(getCslTypeNameFromClrType(col.type)), col.docstring, null, null, col.examples ? KustoLanguageService.toBridgeList(col.examples) : null);
|
|
1480
1490
|
};
|
|
1481
1491
|
KustoLanguageService.createParameterSymbol = function (param) {
|
|
1482
1492
|
var paramSymbol = Kusto.Language.Symbols.ScalarTypes.GetSymbol(getCslTypeNameFromClrType(param.type));
|
|
1483
1493
|
return new sym.ParameterSymbol(param.name, paramSymbol, null);
|
|
1484
1494
|
};
|
|
1495
|
+
KustoLanguageService.createTabularParameterSymbol = function (param) {
|
|
1496
|
+
var columnSymbols = param.columns.map(function (col) { return KustoLanguageService.createColumnSymbol(col); });
|
|
1497
|
+
var para = new Kusto.Language.Symbols.TableSymbol.$ctor4(param.name, columnSymbols);
|
|
1498
|
+
return new sym.ParameterSymbol(param.name, para, param.docstring);
|
|
1499
|
+
};
|
|
1485
1500
|
KustoLanguageService.createParameter = function (param) {
|
|
1486
1501
|
if (!param.columns) {
|
|
1487
1502
|
var paramSymbol = Kusto.Language.Symbols.ScalarTypes.GetSymbol(getCslTypeNameFromClrType(param.type));
|
|
@@ -1502,7 +1517,7 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
1502
1517
|
return KustoLanguageService.createParameter(param);
|
|
1503
1518
|
});
|
|
1504
1519
|
// TODO: handle outputColumns (right now it doesn't seem to be implemented for any function).
|
|
1505
|
-
return new sym.FunctionSymbol.$
|
|
1520
|
+
return new sym.FunctionSymbol.$ctor14(fn.name, fn.body, KustoLanguageService.toBridgeList(parameters), fn.docstring);
|
|
1506
1521
|
};
|
|
1507
1522
|
var createTableSymbol = function (tbl) {
|
|
1508
1523
|
var _a;
|
|
@@ -1531,6 +1546,7 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
1531
1546
|
return databaseSymbol;
|
|
1532
1547
|
};
|
|
1533
1548
|
KustoLanguageService.prototype.convertToKustoJsSchemaV2 = function (schema) {
|
|
1549
|
+
var _a, _b;
|
|
1534
1550
|
var cached = this._schemaCache[schema.cluster.connectionString];
|
|
1535
1551
|
// create a cache entry for the cluster if non yet exists.
|
|
1536
1552
|
if (!cached) {
|
|
@@ -1574,12 +1590,12 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
1574
1590
|
if (databaseInContext) {
|
|
1575
1591
|
globalState = globalState.WithDatabase(databaseInContext);
|
|
1576
1592
|
}
|
|
1577
|
-
// Inject global parameters to global scope.
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
globalState = globalState.WithParameters(KustoLanguageService.toBridgeList(
|
|
1593
|
+
// Inject global scalar parameters to global scope.
|
|
1594
|
+
var scalarParameters = ((_a = schema.globalScalarParameters) !== null && _a !== void 0 ? _a : []).map(function (param) { return KustoLanguageService.createParameterSymbol(param); });
|
|
1595
|
+
// Inject global tabular parameters to global scope.
|
|
1596
|
+
var tabularParameters = ((_b = schema.globalTabularParameters) !== null && _b !== void 0 ? _b : []).map(function (param) { return KustoLanguageService.createTabularParameterSymbol(param); });
|
|
1597
|
+
if (tabularParameters.length || scalarParameters.length) {
|
|
1598
|
+
globalState = globalState.WithParameters(KustoLanguageService.toBridgeList(__spreadArrays(scalarParameters, tabularParameters)));
|
|
1583
1599
|
}
|
|
1584
1600
|
return globalState;
|
|
1585
1601
|
};
|
package/release/esm/monaco.d.ts
CHANGED
|
@@ -73,7 +73,8 @@ declare module monaco.languages.kusto {
|
|
|
73
73
|
schema: any,
|
|
74
74
|
clusterConnectionString: string,
|
|
75
75
|
databaseInContextName: string,
|
|
76
|
-
|
|
76
|
+
globalScalarParameters: ScalarParameter[],
|
|
77
|
+
globalTabularParameters: TabularParameter[]
|
|
77
78
|
): Promise<void>;
|
|
78
79
|
normalizeSchema(
|
|
79
80
|
schema: any,
|
|
@@ -121,7 +122,7 @@ declare module monaco.languages.kusto {
|
|
|
121
122
|
doRangeFormat(uri: string, range: ls.Range): Promise<ls.TextEdit[]>;
|
|
122
123
|
doCurrentCommandFormat(uri: string, caretPosition: ls.Position): Promise<ls.TextEdit[]>;
|
|
123
124
|
doValidation(uri: string, intervals: { start: number; end: number }[], includeWarnings?: boolean, includeSuggestions?: boolean): Promise<ls.Diagnostic[]>;
|
|
124
|
-
setParameters(
|
|
125
|
+
setParameters(scalarParameters: ScalarParameter[], tabularParameters: TabularParameter): void;
|
|
125
126
|
/**
|
|
126
127
|
* Get all the database references from the current command.
|
|
127
128
|
* If database's schema is already cached in previous calls to setSchema or addDatabaseToSchema it will not be returned.
|
|
@@ -193,6 +194,10 @@ declare module monaco.languages.kusto {
|
|
|
193
194
|
cslDefaultValue?: string;
|
|
194
195
|
}
|
|
195
196
|
|
|
197
|
+
export interface TabularParameter extends ScalarParameter {
|
|
198
|
+
columns: Column[]
|
|
199
|
+
}
|
|
200
|
+
|
|
196
201
|
// an input parameter either be a scalar in which case it has a name, type and cslType, or it can be columnar, in which case
|
|
197
202
|
// it will have a name, and a list of scalar types which are the column types.
|
|
198
203
|
export type InputParameter = ScalarParameter & { columns?: ScalarParameter[] };
|