@kusto/monaco-kusto 9.0.1 → 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 +74 -70
- package/release/dev/{main-3ce9fab8.js → main-294a6b51.js} +2 -2
- package/release/dev/monaco.contribution.js +2 -2
- package/release/dev/{schema-780b30a5.js → schema-54b655bf.js} +2 -2
- package/release/esm/kusto.worker.js +17 -10
- 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 +12 -8
- package/release/esm/{schema-cb0f4140.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-3692c2f3.js → main-c837860e.js} +2 -2
- package/release/min/monaco.contribution.js +2 -2
- package/release/min/{schema-0b9a0786.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-3ce9fab8', './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-3ce9fab8', './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
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-3ce9fab8', './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-3ce9fab8', './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-3ce9fab8', './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-3ce9fab8', './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);
|
|
@@ -5370,7 +5374,7 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-3ce9fab8', './schema
|
|
|
5370
5374
|
var kCluster = new k.KustoIntelliSenseClusterEntity();
|
|
5371
5375
|
var kDatabaseInContext = undefined;
|
|
5372
5376
|
kCluster.ConnectionString = schema$1.cluster.connectionString;
|
|
5373
|
-
var
|
|
5377
|
+
var _databases = [];
|
|
5374
5378
|
schema$1.cluster.databases.forEach(function (database) {
|
|
5375
5379
|
var kDatabase = new k.KustoIntelliSenseDatabaseEntity();
|
|
5376
5380
|
kDatabase.Name = database.name;
|
|
@@ -5395,12 +5399,12 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-3ce9fab8', './schema
|
|
|
5395
5399
|
});
|
|
5396
5400
|
kDatabase.Tables = new Bridge.ArrayEnumerable(tables);
|
|
5397
5401
|
kDatabase.Functions = new Bridge.ArrayEnumerable(functions);
|
|
5398
|
-
|
|
5402
|
+
_databases.push(kDatabase);
|
|
5399
5403
|
if (database.name == currentDatabaseName) {
|
|
5400
5404
|
kDatabaseInContext = kDatabase;
|
|
5401
5405
|
}
|
|
5402
5406
|
});
|
|
5403
|
-
kCluster.Databases = new Bridge.ArrayEnumerable(
|
|
5407
|
+
kCluster.Databases = new Bridge.ArrayEnumerable(_databases);
|
|
5404
5408
|
var kSchema = new k.KustoIntelliSenseQuerySchema(kCluster, kDatabaseInContext);
|
|
5405
5409
|
return kSchema;
|
|
5406
5410
|
case 'ClusterManager':
|
|
@@ -5545,13 +5549,13 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-3ce9fab8', './schema
|
|
|
5545
5549
|
}
|
|
5546
5550
|
}, {
|
|
5547
5551
|
key: "createTableSymbol",
|
|
5548
|
-
value: function createTableSymbol(
|
|
5552
|
+
value: function createTableSymbol(_ref21) {
|
|
5549
5553
|
var _mvQuery;
|
|
5550
|
-
var name =
|
|
5551
|
-
columns =
|
|
5552
|
-
entityType =
|
|
5553
|
-
docstring =
|
|
5554
|
-
tbl = _objectWithoutProperties(
|
|
5554
|
+
var name = _ref21.name,
|
|
5555
|
+
columns = _ref21.columns,
|
|
5556
|
+
entityType = _ref21.entityType,
|
|
5557
|
+
docstring = _ref21.docstring,
|
|
5558
|
+
tbl = _objectWithoutProperties(_ref21, _excluded);
|
|
5555
5559
|
var columnSymbols = new Bridge.ArrayEnumerable(columns.map(function (col) {
|
|
5556
5560
|
return KustoLanguageService.createColumnSymbol(col);
|
|
5557
5561
|
}));
|
|
@@ -5621,13 +5625,13 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-3ce9fab8', './schema
|
|
|
5621
5625
|
}
|
|
5622
5626
|
}, {
|
|
5623
5627
|
key: "addClusterToSchema",
|
|
5624
|
-
value: function addClusterToSchema(uri, clusterName,
|
|
5628
|
+
value: function addClusterToSchema(uri, clusterName, databases) {
|
|
5625
5629
|
var document = this._getTextDocument(uri);
|
|
5626
5630
|
if (!document) {
|
|
5627
5631
|
console.error("addClusterToSchema: document is ".concat(document, ". uri is ").concat(uri));
|
|
5628
5632
|
return Promise.resolve();
|
|
5629
5633
|
}
|
|
5630
|
-
return this._languageService.addClusterToSchema(document, clusterName,
|
|
5634
|
+
return this._languageService.addClusterToSchema(document, clusterName, databases);
|
|
5631
5635
|
}
|
|
5632
5636
|
}, {
|
|
5633
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);
|
|
@@ -1947,13 +1954,13 @@ class KustoWorkerImpl {
|
|
|
1947
1954
|
setSchema(schema) {
|
|
1948
1955
|
return this._languageService.setSchema(schema);
|
|
1949
1956
|
}
|
|
1950
|
-
addClusterToSchema(uri, clusterName,
|
|
1957
|
+
addClusterToSchema(uri, clusterName, databases) {
|
|
1951
1958
|
const document = this._getTextDocument(uri);
|
|
1952
1959
|
if (!document) {
|
|
1953
1960
|
console.error(`addClusterToSchema: document is ${document}. uri is ${uri}`);
|
|
1954
1961
|
return Promise.resolve();
|
|
1955
1962
|
}
|
|
1956
|
-
return this._languageService.addClusterToSchema(document, clusterName,
|
|
1963
|
+
return this._languageService.addClusterToSchema(document, clusterName, databases);
|
|
1957
1964
|
}
|
|
1958
1965
|
addDatabaseToSchema(uri, clusterName, databaseSchema) {
|
|
1959
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);
|
|
@@ -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
|