@kusto/monaco-kusto 10.0.6 → 10.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- 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 +45 -31
- package/release/dev/{main-f70a1720.js → main-5c133770.js} +2 -2
- package/release/dev/monaco.contribution.js +2 -2
- package/release/dev/{schema-43c4cc5e.js → schema-5549fea4.js} +2 -2
- package/release/esm/kusto.worker.js +29 -13
- package/release/esm/kustoMode.js +1158 -139
- package/release/esm/languageService/kustoLanguageService.js +23 -12
- package/release/esm/{schema-fbf2f106.js → schema-0961786c.js} +1 -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 +4 -4
- package/release/min/{main-22f9065c.js → main-48530ed8.js} +2 -2
- package/release/min/monaco.contribution.js +2 -2
- package/release/min/{schema-0b8567a7.js → schema-9e266625.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: 10.0.
|
|
3
|
+
* monaco-kusto version: 10.0.8(134ff03184264a9900737e4b5cf93f69540e1c8e)
|
|
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-5c133770'], (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: 10.0.
|
|
3
|
+
* monaco-kusto version: 10.0.8(134ff03184264a9900737e4b5cf93f69540e1c8e)
|
|
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-5c133770', './schema-5549fea4'], (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."); }
|
|
@@ -4311,7 +4311,6 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-f70a1720', './schema
|
|
|
4311
4311
|
}, {
|
|
4312
4312
|
key: "setSchema",
|
|
4313
4313
|
value: function setSchema(schema) {
|
|
4314
|
-
var _this7 = this;
|
|
4315
4314
|
this._schema = schema;
|
|
4316
4315
|
// We support intellisenseV2 only if the clusterType is "Engine", even if the setting is enabled
|
|
4317
4316
|
if (this._languageSettings.useIntellisenseV2 && schema && schema.clusterType === 'Engine') {
|
|
@@ -4322,12 +4321,11 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-f70a1720', './schema
|
|
|
4322
4321
|
}
|
|
4323
4322
|
|
|
4324
4323
|
// 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.
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
});
|
|
4324
|
+
|
|
4325
|
+
var kustoJsSchema = schema ? KustoLanguageService.convertToKustoJsSchema(schema) : undefined;
|
|
4326
|
+
this._kustoJsSchema = kustoJsSchema;
|
|
4327
|
+
this.createRulesProvider(kustoJsSchema, schema.clusterType);
|
|
4328
|
+
return Promise.resolve();
|
|
4331
4329
|
}
|
|
4332
4330
|
}, {
|
|
4333
4331
|
key: "setParameters",
|
|
@@ -4346,6 +4344,12 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-f70a1720', './schema
|
|
|
4346
4344
|
});
|
|
4347
4345
|
this._kustoJsSchemaV2 = this._kustoJsSchemaV2.WithParameters(KustoLanguageService.toBridgeList([].concat(_toConsumableArray(scalarSymbols), _toConsumableArray(tabularSymbols))));
|
|
4348
4346
|
this._script = (_this$_script = this._script) === null || _this$_script === void 0 ? void 0 : _this$_script.WithGlobals(this._kustoJsSchemaV2);
|
|
4347
|
+
|
|
4348
|
+
// Set parameters is only working with the below code. It didn't used to need this, why does it now?!?
|
|
4349
|
+
// Copy+pasted from setSchema
|
|
4350
|
+
var kustoJsSchema = KustoLanguageService.convertToKustoJsSchema(this._schema);
|
|
4351
|
+
this._kustoJsSchema = kustoJsSchema;
|
|
4352
|
+
this.createRulesProvider(kustoJsSchema, this._schema.clusterType);
|
|
4349
4353
|
return Promise.resolve(undefined);
|
|
4350
4354
|
}
|
|
4351
4355
|
|
|
@@ -4361,13 +4365,11 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-f70a1720', './schema
|
|
|
4361
4365
|
}, {
|
|
4362
4366
|
key: "setSchemaFromShowSchema",
|
|
4363
4367
|
value: function setSchemaFromShowSchema(schema, clusterConnectionString, databaseInContextName, globalScalarParameters, globalTabularParameters, databaseInContextAlternateName) {
|
|
4364
|
-
var
|
|
4365
|
-
return this.
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
}));
|
|
4370
|
-
});
|
|
4368
|
+
var normalized = this._normalizeSchema(schema, clusterConnectionString, databaseInContextName, databaseInContextAlternateName);
|
|
4369
|
+
return this.setSchema(_objectSpread(_objectSpread({}, normalized), {}, {
|
|
4370
|
+
globalScalarParameters: globalScalarParameters,
|
|
4371
|
+
globalTabularParameters: globalTabularParameters
|
|
4372
|
+
}));
|
|
4371
4373
|
}
|
|
4372
4374
|
|
|
4373
4375
|
/**
|
|
@@ -4378,8 +4380,8 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-f70a1720', './schema
|
|
|
4378
4380
|
* @param databaseInContextAlternateName database in context alternate name
|
|
4379
4381
|
*/
|
|
4380
4382
|
}, {
|
|
4381
|
-
key: "
|
|
4382
|
-
value: function
|
|
4383
|
+
key: "_normalizeSchema",
|
|
4384
|
+
value: function _normalizeSchema(schema, clusterConnectionString, databaseInContextName, databaseInContextAlternateName) {
|
|
4383
4385
|
var databases = Object.keys(schema.Databases).map(function (key) {
|
|
4384
4386
|
return schema.Databases[key];
|
|
4385
4387
|
}).map(function (_ref7) {
|
|
@@ -4469,7 +4471,7 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-f70a1720', './schema
|
|
|
4469
4471
|
})
|
|
4470
4472
|
};
|
|
4471
4473
|
});
|
|
4472
|
-
|
|
4474
|
+
return {
|
|
4473
4475
|
clusterType: 'Engine',
|
|
4474
4476
|
cluster: {
|
|
4475
4477
|
connectionString: clusterConnectionString,
|
|
@@ -4479,7 +4481,19 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-f70a1720', './schema
|
|
|
4479
4481
|
return db.name === databaseInContextName;
|
|
4480
4482
|
})[0]
|
|
4481
4483
|
};
|
|
4482
|
-
|
|
4484
|
+
}
|
|
4485
|
+
|
|
4486
|
+
/**
|
|
4487
|
+
* Converts the result of .show schema as json to a normalized schema used by kusto language service.
|
|
4488
|
+
* @param schema result of show schema
|
|
4489
|
+
* @param clusterConnectionString cluster connection string`
|
|
4490
|
+
* @param databaseInContextName database in context name
|
|
4491
|
+
* @param databaseInContextAlternateName database in context alternate name
|
|
4492
|
+
*/
|
|
4493
|
+
}, {
|
|
4494
|
+
key: "normalizeSchema",
|
|
4495
|
+
value: function normalizeSchema(schema, clusterConnectionString, databaseInContextName, databaseInContextAlternateName) {
|
|
4496
|
+
return Promise.resolve(this._normalizeSchema(schema, clusterConnectionString, databaseInContextName, databaseInContextAlternateName));
|
|
4483
4497
|
}
|
|
4484
4498
|
}, {
|
|
4485
4499
|
key: "getSchema",
|
|
@@ -4585,7 +4599,7 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-f70a1720', './schema
|
|
|
4585
4599
|
}, {
|
|
4586
4600
|
key: "getFormattedCommandsInDocumentV2",
|
|
4587
4601
|
value: function getFormattedCommandsInDocumentV2(document, rangeStart, rangeEnd) {
|
|
4588
|
-
var
|
|
4602
|
+
var _this7 = this;
|
|
4589
4603
|
var script = this.parseDocumentV2(document);
|
|
4590
4604
|
var commands = this.toArray(script.Blocks).filter(function (command) {
|
|
4591
4605
|
if (!command.Text || command.Text.trim() == '') return false;
|
|
@@ -4611,9 +4625,9 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-f70a1720', './schema
|
|
|
4611
4625
|
};
|
|
4612
4626
|
}
|
|
4613
4627
|
var formattedCommands = commands.map(function (command) {
|
|
4614
|
-
var _formatterOptions$ind,
|
|
4615
|
-
var formatterOptions =
|
|
4616
|
-
var formatter = Kusto.Language.Editor.FormattingOptions.Default.WithIndentationSize((_formatterOptions$ind = formatterOptions === null || formatterOptions === void 0 ? void 0 : formatterOptions.indentationSize) !== null && _formatterOptions$ind !== void 0 ? _formatterOptions$ind : 4).WithInsertMissingTokens(false).WithPipeOperatorStyle((
|
|
4628
|
+
var _formatterOptions$ind, _this7$toPlacementSty;
|
|
4629
|
+
var formatterOptions = _this7._languageSettings.formatter;
|
|
4630
|
+
var formatter = Kusto.Language.Editor.FormattingOptions.Default.WithIndentationSize((_formatterOptions$ind = formatterOptions === null || formatterOptions === void 0 ? void 0 : formatterOptions.indentationSize) !== null && _formatterOptions$ind !== void 0 ? _formatterOptions$ind : 4).WithInsertMissingTokens(false).WithPipeOperatorStyle((_this7$toPlacementSty = _this7.toPlacementStyle(formatterOptions === null || formatterOptions === void 0 ? void 0 : formatterOptions.pipeOperatorStyle)) !== null && _this7$toPlacementSty !== void 0 ? _this7$toPlacementSty : k2.PlacementStyle.Smart).WithSemicolonStyle(Kusto.Language.Editor.PlacementStyle.None).WithBrackettingStyle(k2.BrackettingStyle.Diagonal);
|
|
4617
4631
|
if (rangeStart == null || rangeEnd == null || rangeStart === command.Start && rangeEnd === command.End) {
|
|
4618
4632
|
var result = command.Service.GetFormattedText(formatter);
|
|
4619
4633
|
return result.Text;
|
|
@@ -4744,7 +4758,7 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-f70a1720', './schema
|
|
|
4744
4758
|
}, {
|
|
4745
4759
|
key: "getRenderInfo",
|
|
4746
4760
|
value: function getRenderInfo(document, cursorOffset) {
|
|
4747
|
-
var
|
|
4761
|
+
var _this8 = this;
|
|
4748
4762
|
var parsedAndAnalyzed = this.parseAndAnalyze(document, cursorOffset);
|
|
4749
4763
|
if (!parsedAndAnalyzed) {
|
|
4750
4764
|
return Promise.resolve(undefined);
|
|
@@ -4784,7 +4798,7 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-f70a1720', './schema
|
|
|
4784
4798
|
break;
|
|
4785
4799
|
case 'ycolumns':
|
|
4786
4800
|
case 'anomalycolumns':
|
|
4787
|
-
var nameNodes =
|
|
4801
|
+
var nameNodes = _this8.toArray(property.Element$1.Expression.Names);
|
|
4788
4802
|
var values = nameNodes.map(function (nameNode) {
|
|
4789
4803
|
return nameNode.Element$1.SimpleName;
|
|
4790
4804
|
});
|
|
@@ -5064,14 +5078,14 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-f70a1720', './schema
|
|
|
5064
5078
|
}, {
|
|
5065
5079
|
key: "getClassificationsFromParseResult",
|
|
5066
5080
|
value: function getClassificationsFromParseResult() {
|
|
5067
|
-
var
|
|
5081
|
+
var _this9 = this;
|
|
5068
5082
|
var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
5069
5083
|
var classifications = this.toArray(this._parser.Results).map(function (command) {
|
|
5070
|
-
return
|
|
5084
|
+
return _this9.toArray(command.Tokens);
|
|
5071
5085
|
}).reduce(function (prev, curr) {
|
|
5072
5086
|
return prev.concat(curr);
|
|
5073
5087
|
}, []).map(function (cslCommandToken) {
|
|
5074
|
-
var range = new k2.ClassifiedRange(
|
|
5088
|
+
var range = new k2.ClassifiedRange(_this9.tokenKindToClassificationKind(cslCommandToken.TokenKind), cslCommandToken.AbsoluteStart + offset, cslCommandToken.Length);
|
|
5075
5089
|
return range;
|
|
5076
5090
|
});
|
|
5077
5091
|
return classifications;
|
|
@@ -5452,10 +5466,10 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-f70a1720', './schema
|
|
|
5452
5466
|
}, {
|
|
5453
5467
|
key: "inputParameterToSignature",
|
|
5454
5468
|
value: function inputParameterToSignature(params) {
|
|
5455
|
-
var
|
|
5469
|
+
var _this10 = this;
|
|
5456
5470
|
var signatureWithoutParens = params.map(function (param) {
|
|
5457
5471
|
if (param.columns) {
|
|
5458
|
-
var tableSignature =
|
|
5472
|
+
var tableSignature = _this10.scalarParametersToSignature(param.columns);
|
|
5459
5473
|
return "".concat(param.name, ": ").concat(tableSignature);
|
|
5460
5474
|
} else {
|
|
5461
5475
|
return "".concat(param.name, ": ").concat(param.cslType);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 10.0.
|
|
3
|
+
* monaco-kusto version: 10.0.8(134ff03184264a9900737e4b5cf93f69540e1c8e)
|
|
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-5c133770', ['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: 10.0.
|
|
3
|
+
* monaco-kusto version: 10.0.8(134ff03184264a9900737e4b5cf93f69540e1c8e)
|
|
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-5549fea4'], (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: 10.0.
|
|
3
|
+
* monaco-kusto version: 10.0.8(134ff03184264a9900737e4b5cf93f69540e1c8e)
|
|
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-5549fea4', ['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: 10.0.
|
|
3
|
+
* monaco-kusto version: 10.0.8(134ff03184264a9900737e4b5cf93f69540e1c8e)
|
|
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-0961786c.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';
|
|
@@ -795,12 +795,11 @@ class KustoLanguageService {
|
|
|
795
795
|
}
|
|
796
796
|
|
|
797
797
|
// 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.
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
});
|
|
798
|
+
|
|
799
|
+
const kustoJsSchema = schema ? KustoLanguageService.convertToKustoJsSchema(schema) : undefined;
|
|
800
|
+
this._kustoJsSchema = kustoJsSchema;
|
|
801
|
+
this.createRulesProvider(kustoJsSchema, schema.clusterType);
|
|
802
|
+
return Promise.resolve();
|
|
804
803
|
}
|
|
805
804
|
setParameters(scalarParameters, tabularParameters) {
|
|
806
805
|
if (!this._languageSettings.useIntellisenseV2 || this._schema.clusterType !== 'Engine') {
|
|
@@ -812,6 +811,12 @@ class KustoLanguageService {
|
|
|
812
811
|
const tabularSymbols = tabularParameters.map(param => KustoLanguageService.createTabularParameterSymbol(param));
|
|
813
812
|
this._kustoJsSchemaV2 = this._kustoJsSchemaV2.WithParameters(KustoLanguageService.toBridgeList([...scalarSymbols, ...tabularSymbols]));
|
|
814
813
|
this._script = this._script?.WithGlobals(this._kustoJsSchemaV2);
|
|
814
|
+
|
|
815
|
+
// Set parameters is only working with the below code. It didn't used to need this, why does it now?!?
|
|
816
|
+
// Copy+pasted from setSchema
|
|
817
|
+
const kustoJsSchema = KustoLanguageService.convertToKustoJsSchema(this._schema);
|
|
818
|
+
this._kustoJsSchema = kustoJsSchema;
|
|
819
|
+
this.createRulesProvider(kustoJsSchema, this._schema.clusterType);
|
|
815
820
|
return Promise.resolve(undefined);
|
|
816
821
|
}
|
|
817
822
|
|
|
@@ -825,11 +830,12 @@ class KustoLanguageService {
|
|
|
825
830
|
* @param databaseInContextAlternateName alternate name of database in context
|
|
826
831
|
*/
|
|
827
832
|
setSchemaFromShowSchema(schema, clusterConnectionString, databaseInContextName, globalScalarParameters, globalTabularParameters, databaseInContextAlternateName) {
|
|
828
|
-
|
|
833
|
+
const normalized = this._normalizeSchema(schema, clusterConnectionString, databaseInContextName, databaseInContextAlternateName);
|
|
834
|
+
return this.setSchema({
|
|
829
835
|
...normalized,
|
|
830
836
|
globalScalarParameters,
|
|
831
837
|
globalTabularParameters
|
|
832
|
-
})
|
|
838
|
+
});
|
|
833
839
|
}
|
|
834
840
|
|
|
835
841
|
/**
|
|
@@ -839,7 +845,7 @@ class KustoLanguageService {
|
|
|
839
845
|
* @param databaseInContextName database in context name
|
|
840
846
|
* @param databaseInContextAlternateName database in context alternate name
|
|
841
847
|
*/
|
|
842
|
-
|
|
848
|
+
_normalizeSchema(schema, clusterConnectionString, databaseInContextName, databaseInContextAlternateName) {
|
|
843
849
|
const databases = Object.keys(schema.Databases).map(key => schema.Databases[key]).map(({
|
|
844
850
|
Name,
|
|
845
851
|
Tables,
|
|
@@ -901,7 +907,7 @@ class KustoLanguageService {
|
|
|
901
907
|
}))
|
|
902
908
|
}))
|
|
903
909
|
}));
|
|
904
|
-
|
|
910
|
+
return {
|
|
905
911
|
clusterType: 'Engine',
|
|
906
912
|
cluster: {
|
|
907
913
|
connectionString: clusterConnectionString,
|
|
@@ -909,7 +915,17 @@ class KustoLanguageService {
|
|
|
909
915
|
},
|
|
910
916
|
database: databases.filter(db => db.name === databaseInContextName)[0]
|
|
911
917
|
};
|
|
912
|
-
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* Converts the result of .show schema as json to a normalized schema used by kusto language service.
|
|
922
|
+
* @param schema result of show schema
|
|
923
|
+
* @param clusterConnectionString cluster connection string`
|
|
924
|
+
* @param databaseInContextName database in context name
|
|
925
|
+
* @param databaseInContextAlternateName database in context alternate name
|
|
926
|
+
*/
|
|
927
|
+
normalizeSchema(schema, clusterConnectionString, databaseInContextName, databaseInContextAlternateName) {
|
|
928
|
+
return Promise.resolve(this._normalizeSchema(schema, clusterConnectionString, databaseInContextName, databaseInContextAlternateName));
|
|
913
929
|
}
|
|
914
930
|
getSchema() {
|
|
915
931
|
return Promise.resolve(this._schema);
|