@kusto/monaco-kusto 9.0.0 → 10.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/package.json +3 -3
- package/release/dev/Kusto.Language.Bridge.min.js +1 -1
- package/release/dev/kusto.javascript.client.min.js +1 -1
- package/release/dev/kustoMode.js +2 -2
- package/release/dev/kustoWorker.js +76 -73
- package/release/dev/{main-adf33640.js → main-294a6b51.js} +2 -2
- package/release/dev/monaco.contribution.js +2 -2
- package/release/dev/{schema-9a35b99a.js → schema-54b655bf.js} +2 -2
- package/release/esm/kusto.worker.js +19 -13
- package/release/esm/kustoWorker.d.ts +4 -1
- package/release/esm/kustoWorker.js +2 -2
- package/release/esm/languageService/kustoLanguageService.d.ts +4 -1
- package/release/esm/languageService/kustoLanguageService.js +14 -11
- package/release/esm/languageService/schema.d.ts +1 -1
- package/release/esm/{schema-6a20da13.js → schema-36990b62.js} +1 -1
- package/release/esm/types.d.ts +4 -1
- package/release/min/Kusto.Language.Bridge.min.js +1 -1
- package/release/min/kusto.javascript.client.min.js +1 -1
- package/release/min/kustoMode.js +2 -2
- package/release/min/kustoWorker.js +3 -3
- package/release/min/{main-6b448f4d.js → main-c837860e.js} +2 -2
- package/release/min/monaco.contribution.js +2 -2
- package/release/min/{schema-7077f0b7.js → schema-12149a69.js} +2 -2
package/release/dev/kustoMode.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version:
|
|
3
|
+
* monaco-kusto version: 10.0.0(fa56d460f46889968e17cb8726a1a42a2d90d24f)
|
|
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
|
-
define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './main-
|
|
8
|
+
define('vs/language/kusto/kustoMode', ['exports', 'vs/editor/editor.main', './main-294a6b51'], (function (exports, monaco, main) { 'use strict';
|
|
9
9
|
|
|
10
10
|
function _interopNamespaceDefault(e) {
|
|
11
11
|
var n = Object.create(null);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version:
|
|
3
|
+
* monaco-kusto version: 10.0.0(fa56d460f46889968e17cb8726a1a42a2d90d24f)
|
|
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
|
-
define('vs/language/kusto/kustoWorker', ['exports', './main-
|
|
8
|
+
define('vs/language/kusto/kustoWorker', ['exports', './main-294a6b51', './schema-54b655bf'], (function (exports, main, schema) { 'use strict';
|
|
9
9
|
|
|
10
10
|
function _slicedToArray$2(arr, i) { return _arrayWithHoles$2(arr) || _iterableToArrayLimit$2(arr, i) || _unsupportedIterableToArray$3(arr, i) || _nonIterableRest$2(); }
|
|
11
11
|
function _nonIterableRest$2() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -4266,22 +4266,26 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-adf33640', './schema
|
|
|
4266
4266
|
}
|
|
4267
4267
|
}, {
|
|
4268
4268
|
key: "addClusterToSchema",
|
|
4269
|
-
value: function addClusterToSchema(document, clusterName,
|
|
4269
|
+
value: function addClusterToSchema(document, clusterName, databases) {
|
|
4270
4270
|
var clusterNameOnly = Kusto.Language.KustoFacts.GetHostName(clusterName);
|
|
4271
4271
|
var cluster = this._kustoJsSchemaV2.GetCluster$1(clusterNameOnly);
|
|
4272
4272
|
if (cluster) {
|
|
4273
4273
|
// add databases that are not already in the cluster.
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4274
|
+
databases.filter(function (_ref4) {
|
|
4275
|
+
var name = _ref4.name;
|
|
4276
|
+
return !cluster.GetDatabase(name);
|
|
4277
|
+
}).forEach(function (_ref5) {
|
|
4278
|
+
var name = _ref5.name,
|
|
4279
|
+
alternativeName = _ref5.alternativeName;
|
|
4280
|
+
var symbol = new sym.DatabaseSymbol.$ctor3(name, alternativeName || null, undefined, false);
|
|
4278
4281
|
cluster = cluster.AddDatabase(symbol);
|
|
4279
4282
|
});
|
|
4280
4283
|
}
|
|
4281
4284
|
if (!cluster) {
|
|
4282
|
-
var databaseSymbols =
|
|
4283
|
-
var
|
|
4284
|
-
|
|
4285
|
+
var databaseSymbols = databases.map(function (_ref6) {
|
|
4286
|
+
var name = _ref6.name,
|
|
4287
|
+
alternativeName = _ref6.alternativeName;
|
|
4288
|
+
return new sym.DatabaseSymbol.$ctor3(name, alternativeName || null, undefined, false);
|
|
4285
4289
|
});
|
|
4286
4290
|
var databaseSymbolsList = new (List(sym.DatabaseSymbol).$ctor1)(databaseSymbols);
|
|
4287
4291
|
cluster = new sym.ClusterSymbol.$ctor1(clusterNameOnly, databaseSymbolsList, false);
|
|
@@ -4378,53 +4382,53 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-adf33640', './schema
|
|
|
4378
4382
|
value: function normalizeSchema(schema, clusterConnectionString, databaseInContextName, databaseInContextAlternateName) {
|
|
4379
4383
|
var databases = Object.keys(schema.Databases).map(function (key) {
|
|
4380
4384
|
return schema.Databases[key];
|
|
4381
|
-
}).map(function (
|
|
4382
|
-
var
|
|
4383
|
-
var Name =
|
|
4384
|
-
Tables =
|
|
4385
|
-
ExternalTables =
|
|
4386
|
-
MaterializedViews =
|
|
4387
|
-
Functions =
|
|
4388
|
-
|
|
4389
|
-
EntityGroups =
|
|
4390
|
-
MinorVersion =
|
|
4391
|
-
MajorVersion =
|
|
4385
|
+
}).map(function (_ref7) {
|
|
4386
|
+
var _ref10;
|
|
4387
|
+
var Name = _ref7.Name,
|
|
4388
|
+
Tables = _ref7.Tables,
|
|
4389
|
+
ExternalTables = _ref7.ExternalTables,
|
|
4390
|
+
MaterializedViews = _ref7.MaterializedViews,
|
|
4391
|
+
Functions = _ref7.Functions,
|
|
4392
|
+
_ref7$EntityGroups = _ref7.EntityGroups,
|
|
4393
|
+
EntityGroups = _ref7$EntityGroups === void 0 ? {} : _ref7$EntityGroups,
|
|
4394
|
+
MinorVersion = _ref7.MinorVersion,
|
|
4395
|
+
MajorVersion = _ref7.MajorVersion;
|
|
4392
4396
|
return {
|
|
4393
4397
|
name: Name,
|
|
4394
|
-
alternateName: databaseInContextAlternateName
|
|
4398
|
+
alternateName: databaseInContextAlternateName,
|
|
4395
4399
|
minorVersion: MinorVersion,
|
|
4396
4400
|
majorVersion: MajorVersion,
|
|
4397
|
-
entityGroups: Object.entries(EntityGroups).map(function (
|
|
4398
|
-
var
|
|
4399
|
-
name =
|
|
4400
|
-
members =
|
|
4401
|
+
entityGroups: Object.entries(EntityGroups).map(function (_ref8) {
|
|
4402
|
+
var _ref9 = _slicedToArray(_ref8, 2),
|
|
4403
|
+
name = _ref9[0],
|
|
4404
|
+
members = _ref9[1];
|
|
4401
4405
|
return {
|
|
4402
4406
|
name: name,
|
|
4403
4407
|
members: members
|
|
4404
4408
|
};
|
|
4405
4409
|
}),
|
|
4406
|
-
tables: (
|
|
4407
|
-
var
|
|
4408
|
-
tableContainer =
|
|
4410
|
+
tables: (_ref10 = []).concat.apply(_ref10, _toConsumableArray([[Tables, 'Table'], [MaterializedViews, 'MaterializedView'], [ExternalTables, 'ExternalTable']].filter(function (_ref11) {
|
|
4411
|
+
var _ref12 = _slicedToArray(_ref11, 1),
|
|
4412
|
+
tableContainer = _ref12[0];
|
|
4409
4413
|
return tableContainer;
|
|
4410
|
-
}).map(function (
|
|
4411
|
-
var
|
|
4412
|
-
tableContainer =
|
|
4413
|
-
tableEntity =
|
|
4414
|
-
return Object.values(tableContainer).map(function (
|
|
4415
|
-
var Name =
|
|
4416
|
-
OrderedColumns =
|
|
4417
|
-
DocString =
|
|
4414
|
+
}).map(function (_ref13) {
|
|
4415
|
+
var _ref14 = _slicedToArray(_ref13, 2),
|
|
4416
|
+
tableContainer = _ref14[0],
|
|
4417
|
+
tableEntity = _ref14[1];
|
|
4418
|
+
return Object.values(tableContainer).map(function (_ref15) {
|
|
4419
|
+
var Name = _ref15.Name,
|
|
4420
|
+
OrderedColumns = _ref15.OrderedColumns,
|
|
4421
|
+
DocString = _ref15.DocString;
|
|
4418
4422
|
return {
|
|
4419
4423
|
name: Name,
|
|
4420
4424
|
docstring: DocString,
|
|
4421
4425
|
entityType: tableEntity,
|
|
4422
|
-
columns: OrderedColumns.map(function (
|
|
4423
|
-
var Name =
|
|
4424
|
-
|
|
4425
|
-
var DocString =
|
|
4426
|
-
CslType =
|
|
4427
|
-
Examples =
|
|
4426
|
+
columns: OrderedColumns.map(function (_ref16) {
|
|
4427
|
+
var Name = _ref16.Name;
|
|
4428
|
+
_ref16.Type;
|
|
4429
|
+
var DocString = _ref16.DocString,
|
|
4430
|
+
CslType = _ref16.CslType,
|
|
4431
|
+
Examples = _ref16.Examples;
|
|
4428
4432
|
return {
|
|
4429
4433
|
name: Name,
|
|
4430
4434
|
type: CslType,
|
|
@@ -4437,11 +4441,11 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-adf33640', './schema
|
|
|
4437
4441
|
}))),
|
|
4438
4442
|
functions: Object.keys(Functions).map(function (key) {
|
|
4439
4443
|
return Functions[key];
|
|
4440
|
-
}).map(function (
|
|
4441
|
-
var Name =
|
|
4442
|
-
Body =
|
|
4443
|
-
DocString =
|
|
4444
|
-
InputParameters =
|
|
4444
|
+
}).map(function (_ref17) {
|
|
4445
|
+
var Name = _ref17.Name,
|
|
4446
|
+
Body = _ref17.Body,
|
|
4447
|
+
DocString = _ref17.DocString,
|
|
4448
|
+
InputParameters = _ref17.InputParameters;
|
|
4445
4449
|
return {
|
|
4446
4450
|
name: Name,
|
|
4447
4451
|
body: Body,
|
|
@@ -4550,10 +4554,10 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-adf33640', './schema
|
|
|
4550
4554
|
value: function getCommandsInDocumentV1(document) {
|
|
4551
4555
|
this.parseDocumentV1(document, k.ParseMode.CommandTokensOnly);
|
|
4552
4556
|
var commands = this.toArray(this._parser.Results);
|
|
4553
|
-
return Promise.resolve(commands.map(function (
|
|
4554
|
-
var AbsoluteStart =
|
|
4555
|
-
AbsoluteEnd =
|
|
4556
|
-
Text =
|
|
4557
|
+
return Promise.resolve(commands.map(function (_ref18) {
|
|
4558
|
+
var AbsoluteStart = _ref18.AbsoluteStart,
|
|
4559
|
+
AbsoluteEnd = _ref18.AbsoluteEnd,
|
|
4560
|
+
Text = _ref18.Text;
|
|
4557
4561
|
return {
|
|
4558
4562
|
absoluteStart: AbsoluteStart,
|
|
4559
4563
|
absoluteEnd: AbsoluteEnd,
|
|
@@ -4629,10 +4633,10 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-adf33640', './schema
|
|
|
4629
4633
|
var commands = this.toArray(script.Blocks).filter(function (command) {
|
|
4630
4634
|
return command.Text.trim() != '';
|
|
4631
4635
|
});
|
|
4632
|
-
return Promise.resolve(commands.map(function (
|
|
4633
|
-
var Start =
|
|
4634
|
-
End =
|
|
4635
|
-
Text =
|
|
4636
|
+
return Promise.resolve(commands.map(function (_ref19) {
|
|
4637
|
+
var Start = _ref19.Start,
|
|
4638
|
+
End = _ref19.End,
|
|
4639
|
+
Text = _ref19.Text;
|
|
4636
4640
|
return {
|
|
4637
4641
|
absoluteStart: Start,
|
|
4638
4642
|
absoluteEnd: End,
|
|
@@ -5244,10 +5248,10 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-adf33640', './schema
|
|
|
5244
5248
|
}
|
|
5245
5249
|
|
|
5246
5250
|
// This is a cluster manger
|
|
5247
|
-
var
|
|
5248
|
-
accounts =
|
|
5249
|
-
services =
|
|
5250
|
-
connectionString =
|
|
5251
|
+
var _ref20 = schema,
|
|
5252
|
+
accounts = _ref20.accounts,
|
|
5253
|
+
services = _ref20.services,
|
|
5254
|
+
connectionString = _ref20.connectionString;
|
|
5251
5255
|
new k.KustoIntelliSenseAccountEntity();
|
|
5252
5256
|
new k.KustoIntelliSenseServiceEntity();
|
|
5253
5257
|
this._rulesProvider = new k.ClusterManagerIntelliSenseRulesProvider.$ctor1(new Bridge.ArrayEnumerable(accounts), new Bridge.ArrayEnumerable(services), connectionString);
|
|
@@ -5306,7 +5310,6 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-adf33640', './schema
|
|
|
5306
5310
|
minorVersion: 0,
|
|
5307
5311
|
entityGroups: [],
|
|
5308
5312
|
name: 'Kuskus',
|
|
5309
|
-
alternateName: null,
|
|
5310
5313
|
tables: [{
|
|
5311
5314
|
name: 'KustoLogs',
|
|
5312
5315
|
columns: [{
|
|
@@ -5371,7 +5374,7 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-adf33640', './schema
|
|
|
5371
5374
|
var kCluster = new k.KustoIntelliSenseClusterEntity();
|
|
5372
5375
|
var kDatabaseInContext = undefined;
|
|
5373
5376
|
kCluster.ConnectionString = schema$1.cluster.connectionString;
|
|
5374
|
-
var
|
|
5377
|
+
var _databases = [];
|
|
5375
5378
|
schema$1.cluster.databases.forEach(function (database) {
|
|
5376
5379
|
var kDatabase = new k.KustoIntelliSenseDatabaseEntity();
|
|
5377
5380
|
kDatabase.Name = database.name;
|
|
@@ -5396,12 +5399,12 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-adf33640', './schema
|
|
|
5396
5399
|
});
|
|
5397
5400
|
kDatabase.Tables = new Bridge.ArrayEnumerable(tables);
|
|
5398
5401
|
kDatabase.Functions = new Bridge.ArrayEnumerable(functions);
|
|
5399
|
-
|
|
5402
|
+
_databases.push(kDatabase);
|
|
5400
5403
|
if (database.name == currentDatabaseName) {
|
|
5401
5404
|
kDatabaseInContext = kDatabase;
|
|
5402
5405
|
}
|
|
5403
5406
|
});
|
|
5404
|
-
kCluster.Databases = new Bridge.ArrayEnumerable(
|
|
5407
|
+
kCluster.Databases = new Bridge.ArrayEnumerable(_databases);
|
|
5405
5408
|
var kSchema = new k.KustoIntelliSenseQuerySchema(kCluster, kDatabaseInContext);
|
|
5406
5409
|
return kSchema;
|
|
5407
5410
|
case 'ClusterManager':
|
|
@@ -5513,7 +5516,7 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-adf33640', './schema
|
|
|
5513
5516
|
var tableSymbols = (db.tables || []).map(this.createTableSymbol);
|
|
5514
5517
|
var functionSymbols = (db.functions || []).map(this.createFunctionSymbol);
|
|
5515
5518
|
var entityGroupsSymbols = (db.entityGroups || []).map(this.createEntityGroupSymbol);
|
|
5516
|
-
var databaseSymbol = new sym.DatabaseSymbol.$ctor2(db.name, db.alternateName, tableSymbols.concat(functionSymbols).concat(entityGroupsSymbols));
|
|
5519
|
+
var databaseSymbol = new sym.DatabaseSymbol.$ctor2(db.name, db.alternateName || null, tableSymbols.concat(functionSymbols).concat(entityGroupsSymbols));
|
|
5517
5520
|
return databaseSymbol;
|
|
5518
5521
|
}
|
|
5519
5522
|
}, {
|
|
@@ -5546,13 +5549,13 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-adf33640', './schema
|
|
|
5546
5549
|
}
|
|
5547
5550
|
}, {
|
|
5548
5551
|
key: "createTableSymbol",
|
|
5549
|
-
value: function createTableSymbol(
|
|
5552
|
+
value: function createTableSymbol(_ref21) {
|
|
5550
5553
|
var _mvQuery;
|
|
5551
|
-
var name =
|
|
5552
|
-
columns =
|
|
5553
|
-
entityType =
|
|
5554
|
-
docstring =
|
|
5555
|
-
tbl = _objectWithoutProperties(
|
|
5554
|
+
var name = _ref21.name,
|
|
5555
|
+
columns = _ref21.columns,
|
|
5556
|
+
entityType = _ref21.entityType,
|
|
5557
|
+
docstring = _ref21.docstring,
|
|
5558
|
+
tbl = _objectWithoutProperties(_ref21, _excluded);
|
|
5556
5559
|
var columnSymbols = new Bridge.ArrayEnumerable(columns.map(function (col) {
|
|
5557
5560
|
return KustoLanguageService.createColumnSymbol(col);
|
|
5558
5561
|
}));
|
|
@@ -5622,13 +5625,13 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-adf33640', './schema
|
|
|
5622
5625
|
}
|
|
5623
5626
|
}, {
|
|
5624
5627
|
key: "addClusterToSchema",
|
|
5625
|
-
value: function addClusterToSchema(uri, clusterName,
|
|
5628
|
+
value: function addClusterToSchema(uri, clusterName, databases) {
|
|
5626
5629
|
var document = this._getTextDocument(uri);
|
|
5627
5630
|
if (!document) {
|
|
5628
5631
|
console.error("addClusterToSchema: document is ".concat(document, ". uri is ").concat(uri));
|
|
5629
5632
|
return Promise.resolve();
|
|
5630
5633
|
}
|
|
5631
|
-
return this._languageService.addClusterToSchema(document, clusterName,
|
|
5634
|
+
return this._languageService.addClusterToSchema(document, clusterName, databases);
|
|
5632
5635
|
}
|
|
5633
5636
|
}, {
|
|
5634
5637
|
key: "addDatabaseToSchema",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version:
|
|
3
|
+
* monaco-kusto version: 10.0.0(fa56d460f46889968e17cb8726a1a42a2d90d24f)
|
|
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
|
-
define('vs/language/kusto/main-
|
|
8
|
+
define('vs/language/kusto/main-294a6b51', ['exports'], (function (exports) { 'use strict';
|
|
9
9
|
|
|
10
10
|
/* --------------------------------------------------------------------------------------------
|
|
11
11
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version:
|
|
3
|
+
* monaco-kusto version: 10.0.0(fa56d460f46889968e17cb8726a1a42a2d90d24f)
|
|
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
|
-
define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/editor/editor.main', './schema-
|
|
8
|
+
define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/editor/editor.main', './schema-54b655bf'], (function (require, exports, monaco, schema) { 'use strict';
|
|
9
9
|
|
|
10
10
|
function _interopNamespaceDefault(e) {
|
|
11
11
|
var n = Object.create(null);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version:
|
|
3
|
+
* monaco-kusto version: 10.0.0(fa56d460f46889968e17cb8726a1a42a2d90d24f)
|
|
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
|
-
define('vs/language/kusto/schema-
|
|
8
|
+
define('vs/language/kusto/schema-54b655bf', ['exports'], (function (exports) { 'use strict';
|
|
9
9
|
|
|
10
10
|
// Definition of schema object in the context of language services. This model is exposed to consumers of this library.
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version:
|
|
3
|
+
* monaco-kusto version: 10.0.0(fa56d460f46889968e17cb8726a1a42a2d90d24f)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import * as worker from 'monaco-editor/esm/vs/editor/editor.worker';
|
|
9
9
|
import * as ls from 'vscode-languageserver-types';
|
|
10
10
|
import XRegExp from 'xregexp';
|
|
11
|
-
import { d as getEntityDataTypeFromCslType, a as getCallName, b as getExpression, g as getCslTypeNameFromClrType } from './schema-
|
|
11
|
+
import { d as getEntityDataTypeFromCslType, a as getCallName, b as getExpression, g as getCslTypeNameFromClrType } from './schema-36990b62.js';
|
|
12
12
|
import '@kusto/language-service/bridge.min';
|
|
13
13
|
import '@kusto/language-service/Kusto.JavaScript.Client.min';
|
|
14
14
|
import '@kusto/language-service/newtonsoft.json.min';
|
|
@@ -743,20 +743,27 @@ class KustoLanguageService {
|
|
|
743
743
|
// both intervals intersect if either the start or the end of interval A is inside interval B.
|
|
744
744
|
block.Start >= changeStart && block.Start <= changeEnd || changeStart >= block.Start && changeStart <= block.End + 1) : false);
|
|
745
745
|
}
|
|
746
|
-
addClusterToSchema(document, clusterName,
|
|
746
|
+
addClusterToSchema(document, clusterName, databases) {
|
|
747
747
|
let clusterNameOnly = Kusto.Language.KustoFacts.GetHostName(clusterName);
|
|
748
748
|
let cluster = this._kustoJsSchemaV2.GetCluster$1(clusterNameOnly);
|
|
749
749
|
if (cluster) {
|
|
750
750
|
// add databases that are not already in the cluster.
|
|
751
|
-
|
|
752
|
-
|
|
751
|
+
databases.filter(({
|
|
752
|
+
name
|
|
753
|
+
}) => !cluster.GetDatabase(name)).forEach(({
|
|
754
|
+
name,
|
|
755
|
+
alternativeName
|
|
756
|
+
}) => {
|
|
757
|
+
const symbol = new sym.DatabaseSymbol.$ctor3(name, alternativeName || null, undefined, false);
|
|
753
758
|
cluster = cluster.AddDatabase(symbol);
|
|
754
759
|
});
|
|
755
760
|
}
|
|
756
761
|
if (!cluster) {
|
|
757
|
-
const databaseSymbols =
|
|
758
|
-
|
|
759
|
-
|
|
762
|
+
const databaseSymbols = databases.map(({
|
|
763
|
+
name,
|
|
764
|
+
alternativeName
|
|
765
|
+
}) => {
|
|
766
|
+
return new sym.DatabaseSymbol.$ctor3(name, alternativeName || null, undefined, false);
|
|
760
767
|
});
|
|
761
768
|
const databaseSymbolsList = new (List(sym.DatabaseSymbol).$ctor1)(databaseSymbols);
|
|
762
769
|
cluster = new sym.ClusterSymbol.$ctor1(clusterNameOnly, databaseSymbolsList, false);
|
|
@@ -844,7 +851,7 @@ class KustoLanguageService {
|
|
|
844
851
|
MajorVersion
|
|
845
852
|
}) => ({
|
|
846
853
|
name: Name,
|
|
847
|
-
alternateName: databaseInContextAlternateName
|
|
854
|
+
alternateName: databaseInContextAlternateName,
|
|
848
855
|
minorVersion: MinorVersion,
|
|
849
856
|
majorVersion: MajorVersion,
|
|
850
857
|
entityGroups: Object.entries(EntityGroups).map(([name, members]) => ({
|
|
@@ -1344,7 +1351,6 @@ class KustoLanguageService {
|
|
|
1344
1351
|
minorVersion: 0,
|
|
1345
1352
|
entityGroups: [],
|
|
1346
1353
|
name: 'Kuskus',
|
|
1347
|
-
alternateName: null,
|
|
1348
1354
|
tables: [{
|
|
1349
1355
|
name: 'KustoLogs',
|
|
1350
1356
|
columns: [{
|
|
@@ -1525,7 +1531,7 @@ class KustoLanguageService {
|
|
|
1525
1531
|
const tableSymbols = (db.tables || []).map(this.createTableSymbol);
|
|
1526
1532
|
const functionSymbols = (db.functions || []).map(this.createFunctionSymbol);
|
|
1527
1533
|
const entityGroupsSymbols = (db.entityGroups || []).map(this.createEntityGroupSymbol);
|
|
1528
|
-
const databaseSymbol = new sym.DatabaseSymbol.$ctor2(db.name, db.alternateName, tableSymbols.concat(functionSymbols).concat(entityGroupsSymbols));
|
|
1534
|
+
const databaseSymbol = new sym.DatabaseSymbol.$ctor2(db.name, db.alternateName || null, tableSymbols.concat(functionSymbols).concat(entityGroupsSymbols));
|
|
1529
1535
|
return databaseSymbol;
|
|
1530
1536
|
}
|
|
1531
1537
|
convertToKustoJsSchemaV2(schema) {
|
|
@@ -1948,13 +1954,13 @@ class KustoWorkerImpl {
|
|
|
1948
1954
|
setSchema(schema) {
|
|
1949
1955
|
return this._languageService.setSchema(schema);
|
|
1950
1956
|
}
|
|
1951
|
-
addClusterToSchema(uri, clusterName,
|
|
1957
|
+
addClusterToSchema(uri, clusterName, databases) {
|
|
1952
1958
|
const document = this._getTextDocument(uri);
|
|
1953
1959
|
if (!document) {
|
|
1954
1960
|
console.error(`addClusterToSchema: document is ${document}. uri is ${uri}`);
|
|
1955
1961
|
return Promise.resolve();
|
|
1956
1962
|
}
|
|
1957
|
-
return this._languageService.addClusterToSchema(document, clusterName,
|
|
1963
|
+
return this._languageService.addClusterToSchema(document, clusterName, databases);
|
|
1958
1964
|
}
|
|
1959
1965
|
addDatabaseToSchema(uri, clusterName, databaseSchema) {
|
|
1960
1966
|
const document = this._getTextDocument(uri);
|
|
@@ -23,7 +23,10 @@ export declare class KustoWorkerImpl {
|
|
|
23
23
|
private _languageSettings;
|
|
24
24
|
constructor(ctx: worker.IWorkerContext, createData: ICreateData);
|
|
25
25
|
setSchema(schema: Schema): Promise<void>;
|
|
26
|
-
addClusterToSchema(uri: string, clusterName: string,
|
|
26
|
+
addClusterToSchema(uri: string, clusterName: string, databases: readonly {
|
|
27
|
+
name: string;
|
|
28
|
+
alternativeName?: string;
|
|
29
|
+
}[]): Promise<void>;
|
|
27
30
|
addDatabaseToSchema(uri: string, clusterName: string, databaseSchema: Database): Promise<void>;
|
|
28
31
|
setSchemaFromShowSchema(schema: any, clusterConnectionString: string, databaseInContextName: string): Promise<void>;
|
|
29
32
|
normalizeSchema(schema: showSchema.Result, clusterConnectionString: string, databaseInContextName: string): Promise<import("./languageService/schema").EngineSchema>;
|
|
@@ -11,13 +11,13 @@ var KustoWorkerImpl = /** @class */ (function () {
|
|
|
11
11
|
KustoWorkerImpl.prototype.setSchema = function (schema) {
|
|
12
12
|
return this._languageService.setSchema(schema);
|
|
13
13
|
};
|
|
14
|
-
KustoWorkerImpl.prototype.addClusterToSchema = function (uri, clusterName,
|
|
14
|
+
KustoWorkerImpl.prototype.addClusterToSchema = function (uri, clusterName, databases) {
|
|
15
15
|
var document = this._getTextDocument(uri);
|
|
16
16
|
if (!document) {
|
|
17
17
|
console.error("addClusterToSchema: document is ".concat(document, ". uri is ").concat(uri));
|
|
18
18
|
return Promise.resolve();
|
|
19
19
|
}
|
|
20
|
-
return this._languageService.addClusterToSchema(document, clusterName,
|
|
20
|
+
return this._languageService.addClusterToSchema(document, clusterName, databases);
|
|
21
21
|
};
|
|
22
22
|
KustoWorkerImpl.prototype.addDatabaseToSchema = function (uri, clusterName, databaseSchema) {
|
|
23
23
|
var document = this._getTextDocument(uri);
|
|
@@ -125,7 +125,10 @@ export interface LanguageService {
|
|
|
125
125
|
getDatabaseReferences(document: TextDocument, cursorOffset: number): Promise<DatabaseReference[]>;
|
|
126
126
|
getClusterReferences(document: TextDocument, cursorOffset: number): Promise<ClusterReference[]>;
|
|
127
127
|
addDatabaseToSchema(document: TextDocument, clusterName: string, databaseSchema: Database): Promise<void>;
|
|
128
|
-
addClusterToSchema(document: TextDocument, clusterName: string,
|
|
128
|
+
addClusterToSchema(document: TextDocument, clusterName: string, databases: readonly {
|
|
129
|
+
name: string;
|
|
130
|
+
alternativeName?: string;
|
|
131
|
+
}[]): Promise<void>;
|
|
129
132
|
}
|
|
130
133
|
export type CmSchema = {
|
|
131
134
|
accounts: k.KustoIntelliSenseAccountEntity[];
|
|
@@ -838,22 +838,26 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
838
838
|
: false;
|
|
839
839
|
});
|
|
840
840
|
};
|
|
841
|
-
KustoLanguageService.prototype.addClusterToSchema = function (document, clusterName,
|
|
841
|
+
KustoLanguageService.prototype.addClusterToSchema = function (document, clusterName, databases) {
|
|
842
842
|
var clusterNameOnly = Kusto.Language.KustoFacts.GetHostName(clusterName);
|
|
843
843
|
var cluster = this._kustoJsSchemaV2.GetCluster$1(clusterNameOnly);
|
|
844
844
|
if (cluster) {
|
|
845
845
|
// add databases that are not already in the cluster.
|
|
846
|
-
|
|
847
|
-
.filter(function (
|
|
848
|
-
|
|
849
|
-
|
|
846
|
+
databases
|
|
847
|
+
.filter(function (_a) {
|
|
848
|
+
var name = _a.name;
|
|
849
|
+
return !cluster.GetDatabase(name);
|
|
850
|
+
})
|
|
851
|
+
.forEach(function (_a) {
|
|
852
|
+
var name = _a.name, alternativeName = _a.alternativeName;
|
|
853
|
+
var symbol = new sym.DatabaseSymbol.$ctor3(name, alternativeName || null, undefined, false);
|
|
850
854
|
cluster = cluster.AddDatabase(symbol);
|
|
851
855
|
});
|
|
852
856
|
}
|
|
853
857
|
if (!cluster) {
|
|
854
|
-
var databaseSymbols =
|
|
855
|
-
var
|
|
856
|
-
return
|
|
858
|
+
var databaseSymbols = databases.map(function (_a) {
|
|
859
|
+
var name = _a.name, alternativeName = _a.alternativeName;
|
|
860
|
+
return new sym.DatabaseSymbol.$ctor3(name, alternativeName || null, undefined, false);
|
|
857
861
|
});
|
|
858
862
|
var databaseSymbolsList = new (List(sym.DatabaseSymbol).$ctor1)(databaseSymbols);
|
|
859
863
|
cluster = new sym.ClusterSymbol.$ctor1(clusterNameOnly, databaseSymbolsList, false);
|
|
@@ -934,7 +938,7 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
934
938
|
var Name = _a.Name, Tables = _a.Tables, ExternalTables = _a.ExternalTables, MaterializedViews = _a.MaterializedViews, Functions = _a.Functions, _b = _a.EntityGroups, EntityGroups = _b === void 0 ? {} : _b, MinorVersion = _a.MinorVersion, MajorVersion = _a.MajorVersion;
|
|
935
939
|
return ({
|
|
936
940
|
name: Name,
|
|
937
|
-
alternateName: databaseInContextAlternateName
|
|
941
|
+
alternateName: databaseInContextAlternateName,
|
|
938
942
|
minorVersion: MinorVersion,
|
|
939
943
|
majorVersion: MajorVersion,
|
|
940
944
|
entityGroups: Object.entries(EntityGroups).map(function (_a) {
|
|
@@ -1432,7 +1436,6 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
1432
1436
|
minorVersion: 0,
|
|
1433
1437
|
entityGroups: [],
|
|
1434
1438
|
name: 'Kuskus',
|
|
1435
|
-
alternateName: null,
|
|
1436
1439
|
tables: [
|
|
1437
1440
|
{
|
|
1438
1441
|
name: 'KustoLogs',
|
|
@@ -1636,7 +1639,7 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
1636
1639
|
var tableSymbols = (db.tables || []).map(this.createTableSymbol);
|
|
1637
1640
|
var functionSymbols = (db.functions || []).map(this.createFunctionSymbol);
|
|
1638
1641
|
var entityGroupsSymbols = (db.entityGroups || []).map(this.createEntityGroupSymbol);
|
|
1639
|
-
var databaseSymbol = new sym.DatabaseSymbol.$ctor2(db.name, db.alternateName, tableSymbols.concat(functionSymbols).concat(entityGroupsSymbols));
|
|
1642
|
+
var databaseSymbol = new sym.DatabaseSymbol.$ctor2(db.name, db.alternateName || null, tableSymbols.concat(functionSymbols).concat(entityGroupsSymbols));
|
|
1640
1643
|
return databaseSymbol;
|
|
1641
1644
|
};
|
|
1642
1645
|
KustoLanguageService.prototype.convertToKustoJsSchemaV2 = function (schema) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version:
|
|
3
|
+
* monaco-kusto version: 10.0.0(fa56d460f46889968e17cb8726a1a42a2d90d24f)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
package/release/esm/types.d.ts
CHANGED
|
@@ -129,7 +129,10 @@ export interface KustoWorker {
|
|
|
129
129
|
* - hosting app calls addClusterToSchema with the list of databases.
|
|
130
130
|
* - now, when user type `cluster('help').database(` then the auto complete list will show all the databases.
|
|
131
131
|
*/
|
|
132
|
-
addClusterToSchema(uri: string, clusterName: string,
|
|
132
|
+
addClusterToSchema(uri: string, clusterName: string, databases: readonly {
|
|
133
|
+
name: string;
|
|
134
|
+
alternativeName?: string;
|
|
135
|
+
}[]): Promise<void>;
|
|
133
136
|
}
|
|
134
137
|
/**
|
|
135
138
|
* A function that get a model Uri and returns a kusto worker that knows how to work
|