@kusto/monaco-kusto 14.0.1 → 14.1.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/README.md +81 -14
- package/package.json +1 -1
- package/release/dev/kustoMode.js +2 -2
- package/release/dev/kustoWorker.js +25 -5
- package/release/dev/{main-6dbedcd3.js → main-374ffef1.js} +2 -2
- package/release/dev/monaco.contribution.js +2 -2
- package/release/dev/{schema-954f3274.js → schema-778d43e4.js} +2 -2
- package/release/dev/{types-dde70929.js → types-330e461e.js} +2 -2
- package/release/esm/{globals-5d7a5fa1.js → globals-bfe000bf.js} +1 -1
- package/release/esm/kusto.worker.js +23 -5
- package/release/esm/kustoMode.js +2 -2
- package/release/esm/languageServiceManager/kustoLanguageService.js +19 -2
- package/release/esm/languageServiceManager/schema.d.ts +18 -0
- package/release/esm/monaco.contribution.js +4 -4
- package/release/esm/{schema-2df06016.js → schema-9bf4386b.js} +1 -1
- package/release/min/kustoMode.js +2 -2
- package/release/min/kustoWorker.js +4 -4
- package/release/min/{main-29cd5afc.js → main-f8f8d919.js} +2 -2
- package/release/min/monaco.contribution.js +2 -2
- package/release/min/{schema-2dd5f468.js → schema-d1f6d06d.js} +2 -2
- package/release/min/{types-cdb0d790.js → types-5ec10ded.js} +2 -2
package/README.md
CHANGED
|
@@ -56,6 +56,24 @@ There are 2 APIs to set a Kusto schema:
|
|
|
56
56
|
interface `Result` in `schema.ts`), so when this method is used, it also
|
|
57
57
|
requires a cluster URI and the name of the database in context.
|
|
58
58
|
|
|
59
|
+
### Schema Parsing Flow
|
|
60
|
+
|
|
61
|
+
The schema parsing process in Monaco-Kusto involves several components, starting from the Kusto command and ending with language features in the editor. Here is how the flow works:
|
|
62
|
+
|
|
63
|
+
Below is a diagram illustrating the schema parsing flow:
|
|
64
|
+
|
|
65
|
+

|
|
66
|
+
|
|
67
|
+
## Getting Started: Running the Local Demo App
|
|
68
|
+
|
|
69
|
+
To quickly try Monaco-Kusto locally, run the following command from the `package` folder:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
yarn start
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
This will start a local development server and open the demo app at http://localhost:7777.
|
|
76
|
+
|
|
59
77
|
## Contributing
|
|
60
78
|
|
|
61
79
|
Every PR should come with a test that checks it.
|
|
@@ -89,8 +107,71 @@ Every PR should come with a test that checks it.
|
|
|
89
107
|
> Before running `yarn test:it` or `yarn test:it:watch`, first run `yarn test:it:serve`.
|
|
90
108
|
> These scripts (`test:it` and `test:it:watch`) do **not** automatically rebuild the project, so running the server ensures your latest code is tested.
|
|
91
109
|
|
|
110
|
+
## Running Monaco-Kusto Locally in Azure-Kusto-WebUX
|
|
111
|
+
|
|
112
|
+
To run monaco-kusto locally inside the Azure-Kusto-WebUX project (which should exist outside this project folder with the original project name `Azure-Kusto-WebUX`), you can use the provided script:
|
|
113
|
+
|
|
114
|
+
```sh
|
|
115
|
+
./debug-monaco-kusto.sh
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Script Modes: KustoWeb and Fabric
|
|
119
|
+
|
|
120
|
+
There are two ways to run the script:
|
|
121
|
+
|
|
122
|
+
- **KustoWeb (default):** The script is currently set up to run the `kustoweb` app inside Azure-Kusto-WebUX. This is the default behavior.
|
|
123
|
+
- **Fabric:** To run the Fabric app instead, simply comment out the Step 4 section for KustoWeb and uncomment the Step 4 section for Fabric in `debug-monaco-kusto.sh`.
|
|
124
|
+
|
|
125
|
+
This allows you to easily switch between running KustoWeb and Fabric for local development.
|
|
126
|
+
|
|
127
|
+
### Project Structure Requirements
|
|
128
|
+
|
|
129
|
+
For the debug-monaco-kusto.sh script to work, ensure that your project structure resembles the following, with both `monaco-kusto` and `Azure-Kusto-WebUX` as sibling folders:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
/your-workspace-root
|
|
133
|
+
|-- monaco-kusto
|
|
134
|
+
| |-- ...
|
|
135
|
+
| |-- debug-monaco-kusto.sh
|
|
136
|
+
| |-- ...
|
|
137
|
+
|
|
|
138
|
+
|-- Azure-Kusto-WebUX
|
|
139
|
+
`-- ...
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The important part is that the `Azure-Kusto-WebUX` folder is a sibling to `monaco-kusto`, and that its `node_modules` folder and `package.json` file are at its root. The script relies on this structure to copy files and run the correct build steps.
|
|
143
|
+
|
|
144
|
+
## Architecture Overview
|
|
145
|
+
|
|
146
|
+
This section provides a high-level overview of the main files and their responsibilities in the project.
|
|
147
|
+
|
|
148
|
+

|
|
149
|
+
|
|
150
|
+
- **`monaco.contribution`**
|
|
151
|
+
Declares and exports the Kusto language as a Monaco Editor contribution, making it available for registration and use externally.
|
|
152
|
+
|
|
153
|
+
- **`kustoMode`** Sets up and registers the Kusto language in Monaco Editor, wiring together language features, workers, and configuration.
|
|
154
|
+
|
|
155
|
+
- **`workerManager`** Manages the lifecycle and communication with web workers that run language services in the background.
|
|
156
|
+
|
|
157
|
+
- **`kustoWorker`** Implements the actual worker logic, handling requests for language features from the main thread.
|
|
158
|
+
|
|
159
|
+
- **`kustoLanguageService`**
|
|
160
|
+
Implements the core logic for Kusto language features such as parsing, validation, and providing language intelligence (completion, diagnostics, etc.).
|
|
161
|
+
Uses the `language-service-next` library, which was originally created in C# and migrated to TypeScript using bridgejs.
|
|
162
|
+
|
|
163
|
+
- **`languageFeatures`**
|
|
164
|
+
Contains adapters and implementations for Monaco Editor language features (completion, hover, formatting, folding, etc.) specific to Kusto.
|
|
165
|
+
|
|
166
|
+
- **`monacoInstance`**
|
|
167
|
+
Represents the Monaco Editor instance itself. It is responsible for editor creation, configuration, and interaction with the registered Kusto language features.
|
|
168
|
+
|
|
92
169
|
## Changelog
|
|
93
170
|
|
|
171
|
+
### 14.1.0
|
|
172
|
+
|
|
173
|
+
- feat: support graph schema
|
|
174
|
+
|
|
94
175
|
### 14.0.1
|
|
95
176
|
|
|
96
177
|
- chore: Update @kusto/language-service-next upgrade to 12.2.0
|
|
@@ -1014,17 +1095,3 @@ Every PR should come with a test that checks it.
|
|
|
1014
1095
|
#### Bug fixes
|
|
1015
1096
|
|
|
1016
1097
|
- setSchema does not update syntax highlighting
|
|
1017
|
-
|
|
1018
|
-
# Contributing
|
|
1019
|
-
|
|
1020
|
-
This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
|
1021
|
-
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
|
|
1022
|
-
the rights to use your contribution. For details, visit https://cla.microsoft.com.
|
|
1023
|
-
|
|
1024
|
-
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
|
|
1025
|
-
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
|
|
1026
|
-
provided by the bot. You will only need to do this once across all repos using our CLA.
|
|
1027
|
-
|
|
1028
|
-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
1029
|
-
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
|
|
1030
|
-
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
package/package.json
CHANGED
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: 14.0
|
|
3
|
+
* monaco-kusto version: 14.1.0(a07433e158c993af04f2cfb3a1453ddac68ec2bd)
|
|
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-374ffef1', './types-330e461e'], (function (exports, monaco, main, types$1) { '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: 14.0
|
|
3
|
+
* monaco-kusto version: 14.1.0(a07433e158c993af04f2cfb3a1453ddac68ec2bd)
|
|
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-374ffef1', './schema-778d43e4'], (function (exports, main, schema) { 'use strict';
|
|
9
9
|
|
|
10
10
|
function _slicedToArray$2(r, e) { return _arrayWithHoles$2(r) || _iterableToArrayLimit$2(r, e) || _unsupportedIterableToArray$3(r, e) || _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."); }
|
|
@@ -4229,7 +4229,8 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-6dbedcd3', './schema
|
|
|
4229
4229
|
_ref6$EntityGroups = _ref6.EntityGroups,
|
|
4230
4230
|
EntityGroups = _ref6$EntityGroups === void 0 ? {} : _ref6$EntityGroups,
|
|
4231
4231
|
MinorVersion = _ref6.MinorVersion,
|
|
4232
|
-
MajorVersion = _ref6.MajorVersion
|
|
4232
|
+
MajorVersion = _ref6.MajorVersion,
|
|
4233
|
+
Graphs = _ref6.Graphs;
|
|
4233
4234
|
return {
|
|
4234
4235
|
name: Name,
|
|
4235
4236
|
alternateName: databaseInContextAlternateName,
|
|
@@ -4303,7 +4304,17 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-6dbedcd3', './schema
|
|
|
4303
4304
|
};
|
|
4304
4305
|
})
|
|
4305
4306
|
};
|
|
4306
|
-
})
|
|
4307
|
+
}),
|
|
4308
|
+
graphs: Object.values(Graphs).reduce(function (graphArray, graph) {
|
|
4309
|
+
var graphEntity = {
|
|
4310
|
+
name: graph.Name,
|
|
4311
|
+
entityType: 'Graph',
|
|
4312
|
+
edges: graph.Edges,
|
|
4313
|
+
nodes: graph.Nodes,
|
|
4314
|
+
snapshots: graph.Snapshots
|
|
4315
|
+
};
|
|
4316
|
+
return [].concat(_toConsumableArray(graphArray), [graphEntity]);
|
|
4317
|
+
}, []) // this is a temporary workaround as graphs are not included in the .show schema as json command output
|
|
4307
4318
|
};
|
|
4308
4319
|
});
|
|
4309
4320
|
return {
|
|
@@ -5323,7 +5334,8 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-6dbedcd3', './schema
|
|
|
5323
5334
|
var tableSymbols = (db.tables || []).map(this.createTableSymbol);
|
|
5324
5335
|
var functionSymbols = (db.functions || []).map(this.createFunctionSymbol);
|
|
5325
5336
|
var entityGroupsSymbols = (db.entityGroups || []).map(this.createEntityGroupSymbol);
|
|
5326
|
-
var
|
|
5337
|
+
var graphModelSymbols = (db.graphs || []).map(this.createGraphModelSymbol);
|
|
5338
|
+
var databaseSymbol = new sym.DatabaseSymbol.$ctor2(db.name, db.alternateName || null, tableSymbols.concat(functionSymbols).concat(entityGroupsSymbols).concat(graphModelSymbols));
|
|
5327
5339
|
return databaseSymbol;
|
|
5328
5340
|
}
|
|
5329
5341
|
}, {
|
|
@@ -5381,6 +5393,14 @@ define('vs/language/kusto/kustoWorker', ['exports', './main-6dbedcd3', './schema
|
|
|
5381
5393
|
value: function createEntityGroupSymbol(entityGroup) {
|
|
5382
5394
|
return new sym.EntityGroupSymbol.$ctor3(entityGroup.name, entityGroup.members.join(), null);
|
|
5383
5395
|
}
|
|
5396
|
+
}, {
|
|
5397
|
+
key: "createGraphModelSymbol",
|
|
5398
|
+
value: function createGraphModelSymbol(graph) {
|
|
5399
|
+
var edges = new Bridge.ArrayEnumerable(graph.edges || []);
|
|
5400
|
+
var nodes = new Bridge.ArrayEnumerable(graph.nodes || []);
|
|
5401
|
+
var snapshots = new Bridge.ArrayEnumerable(graph.snapshots || []);
|
|
5402
|
+
return new sym.GraphModelSymbol.$ctor1(graph.name, edges, nodes, snapshots);
|
|
5403
|
+
}
|
|
5384
5404
|
}]);
|
|
5385
5405
|
}();
|
|
5386
5406
|
var languageService = new KustoLanguageService(KustoLanguageService.dummySchema, {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 14.0
|
|
3
|
+
* monaco-kusto version: 14.1.0(a07433e158c993af04f2cfb3a1453ddac68ec2bd)
|
|
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-374ffef1', ['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: 14.0
|
|
3
|
+
* monaco-kusto version: 14.1.0(a07433e158c993af04f2cfb3a1453ddac68ec2bd)
|
|
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', './types-
|
|
8
|
+
define('vs/language/kusto/monaco.contribution', ['require', 'exports', 'vs/editor/editor.main', './types-330e461e', './schema-778d43e4'], (function (require, exports, monaco, types, 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: 14.0
|
|
3
|
+
* monaco-kusto version: 14.1.0(a07433e158c993af04f2cfb3a1453ddac68ec2bd)
|
|
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-778d43e4', ['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,11 +1,11 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 14.0
|
|
3
|
+
* monaco-kusto version: 14.1.0(a07433e158c993af04f2cfb3a1453ddac68ec2bd)
|
|
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/types-
|
|
8
|
+
define('vs/language/kusto/types-330e461e', ['exports'], (function (exports) { 'use strict';
|
|
9
9
|
|
|
10
10
|
var LANGUAGE_ID = 'kusto';
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 14.0
|
|
3
|
+
* monaco-kusto version: 14.1.0(a07433e158c993af04f2cfb3a1453ddac68ec2bd)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 14.0
|
|
3
|
+
* monaco-kusto version: 14.1.0(a07433e158c993af04f2cfb3a1453ddac68ec2bd)
|
|
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-9bf4386b.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';
|
|
@@ -699,7 +699,8 @@ class KustoLanguageService {
|
|
|
699
699
|
Functions,
|
|
700
700
|
EntityGroups = {},
|
|
701
701
|
MinorVersion,
|
|
702
|
-
MajorVersion
|
|
702
|
+
MajorVersion,
|
|
703
|
+
Graphs
|
|
703
704
|
}) => ({
|
|
704
705
|
name: Name,
|
|
705
706
|
alternateName: databaseInContextAlternateName,
|
|
@@ -750,7 +751,17 @@ class KustoLanguageService {
|
|
|
750
751
|
cslType: col.CslType
|
|
751
752
|
})) : inputParam.Columns
|
|
752
753
|
}))
|
|
753
|
-
}))
|
|
754
|
+
})),
|
|
755
|
+
graphs: Object.values(Graphs).reduce((graphArray, graph) => {
|
|
756
|
+
const graphEntity = {
|
|
757
|
+
name: graph.Name,
|
|
758
|
+
entityType: 'Graph',
|
|
759
|
+
edges: graph.Edges,
|
|
760
|
+
nodes: graph.Nodes,
|
|
761
|
+
snapshots: graph.Snapshots
|
|
762
|
+
};
|
|
763
|
+
return [...graphArray, graphEntity];
|
|
764
|
+
}, []) // this is a temporary workaround as graphs are not included in the .show schema as json command output
|
|
754
765
|
}));
|
|
755
766
|
return {
|
|
756
767
|
clusterType: 'Engine',
|
|
@@ -1355,7 +1366,8 @@ class KustoLanguageService {
|
|
|
1355
1366
|
const tableSymbols = (db.tables || []).map(this.createTableSymbol);
|
|
1356
1367
|
const functionSymbols = (db.functions || []).map(this.createFunctionSymbol);
|
|
1357
1368
|
const entityGroupsSymbols = (db.entityGroups || []).map(this.createEntityGroupSymbol);
|
|
1358
|
-
const
|
|
1369
|
+
const graphModelSymbols = (db.graphs || []).map(this.createGraphModelSymbol);
|
|
1370
|
+
const databaseSymbol = new sym.DatabaseSymbol.$ctor2(db.name, db.alternateName || null, tableSymbols.concat(functionSymbols).concat(entityGroupsSymbols).concat(graphModelSymbols));
|
|
1359
1371
|
return databaseSymbol;
|
|
1360
1372
|
}
|
|
1361
1373
|
convertToKustoJsSchemaV2(schema) {
|
|
@@ -1719,6 +1731,12 @@ class KustoLanguageService {
|
|
|
1719
1731
|
static createEntityGroupSymbol(entityGroup) {
|
|
1720
1732
|
return new sym.EntityGroupSymbol.$ctor3(entityGroup.name, entityGroup.members.join(), null);
|
|
1721
1733
|
}
|
|
1734
|
+
static createGraphModelSymbol(graph) {
|
|
1735
|
+
const edges = new Bridge.ArrayEnumerable(graph.edges || []);
|
|
1736
|
+
const nodes = new Bridge.ArrayEnumerable(graph.nodes || []);
|
|
1737
|
+
const snapshots = new Bridge.ArrayEnumerable(graph.snapshots || []);
|
|
1738
|
+
return new sym.GraphModelSymbol.$ctor1(graph.name, edges, nodes, snapshots);
|
|
1739
|
+
}
|
|
1722
1740
|
}
|
|
1723
1741
|
let languageService = new KustoLanguageService(KustoLanguageService.dummySchema, {
|
|
1724
1742
|
includeControlCommands: true,
|
package/release/esm/kustoMode.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 14.0
|
|
3
|
+
* monaco-kusto version: 14.1.0(a07433e158c993af04f2cfb3a1453ddac68ec2bd)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|
|
@@ -9,7 +9,7 @@ import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
|
9
9
|
import { languages } from 'monaco-editor/esm/vs/editor/editor.api';
|
|
10
10
|
import * as ls from 'vscode-languageserver-types';
|
|
11
11
|
import debounce from 'lodash-es/debounce';
|
|
12
|
-
import { L as LANGUAGE_ID, T as Token, t as tokenTypes } from './globals-
|
|
12
|
+
import { L as LANGUAGE_ID, T as Token, t as tokenTypes } from './globals-bfe000bf.js';
|
|
13
13
|
|
|
14
14
|
class WorkerManager {
|
|
15
15
|
constructor(_monacoInstance, defaults) {
|
|
@@ -814,7 +814,7 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
814
814
|
var databases = Object.keys(schema.Databases)
|
|
815
815
|
.map(function (key) { return schema.Databases[key]; })
|
|
816
816
|
.map(function (_a) {
|
|
817
|
-
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;
|
|
817
|
+
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, Graphs = _a.Graphs;
|
|
818
818
|
return ({
|
|
819
819
|
name: Name,
|
|
820
820
|
alternateName: databaseInContextAlternateName,
|
|
@@ -879,6 +879,16 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
879
879
|
}); }),
|
|
880
880
|
});
|
|
881
881
|
}),
|
|
882
|
+
graphs: Object.values(Graphs).reduce(function (graphArray, graph) {
|
|
883
|
+
var graphEntity = {
|
|
884
|
+
name: graph.Name,
|
|
885
|
+
entityType: 'Graph',
|
|
886
|
+
edges: graph.Edges,
|
|
887
|
+
nodes: graph.Nodes,
|
|
888
|
+
snapshots: graph.Snapshots,
|
|
889
|
+
};
|
|
890
|
+
return __spreadArray(__spreadArray([], graphArray, true), [graphEntity], false);
|
|
891
|
+
}, []), // this is a temporary workaround as graphs are not included in the .show schema as json command output
|
|
882
892
|
});
|
|
883
893
|
});
|
|
884
894
|
return {
|
|
@@ -1467,7 +1477,8 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
1467
1477
|
var tableSymbols = (db.tables || []).map(this.createTableSymbol);
|
|
1468
1478
|
var functionSymbols = (db.functions || []).map(this.createFunctionSymbol);
|
|
1469
1479
|
var entityGroupsSymbols = (db.entityGroups || []).map(this.createEntityGroupSymbol);
|
|
1470
|
-
var
|
|
1480
|
+
var graphModelSymbols = (db.graphs || []).map(this.createGraphModelSymbol);
|
|
1481
|
+
var databaseSymbol = new sym.DatabaseSymbol.$ctor2(db.name, db.alternateName || null, tableSymbols.concat(functionSymbols).concat(entityGroupsSymbols).concat(graphModelSymbols));
|
|
1471
1482
|
return databaseSymbol;
|
|
1472
1483
|
};
|
|
1473
1484
|
KustoLanguageService.prototype.convertToKustoJsSchemaV2 = function (schema) {
|
|
@@ -1737,6 +1748,12 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
1737
1748
|
KustoLanguageService.createEntityGroupSymbol = function (entityGroup) {
|
|
1738
1749
|
return new sym.EntityGroupSymbol.$ctor3(entityGroup.name, entityGroup.members.join(), null);
|
|
1739
1750
|
};
|
|
1751
|
+
KustoLanguageService.createGraphModelSymbol = function (graph) {
|
|
1752
|
+
var edges = new Bridge.ArrayEnumerable(graph.edges || []);
|
|
1753
|
+
var nodes = new Bridge.ArrayEnumerable(graph.nodes || []);
|
|
1754
|
+
var snapshots = new Bridge.ArrayEnumerable(graph.snapshots || []);
|
|
1755
|
+
return new sym.GraphModelSymbol.$ctor1(graph.name, edges, nodes, snapshots);
|
|
1756
|
+
};
|
|
1740
1757
|
return KustoLanguageService;
|
|
1741
1758
|
}());
|
|
1742
1759
|
var languageService = new KustoLanguageService(KustoLanguageService.dummySchema, {
|
|
@@ -50,10 +50,18 @@ export interface Database {
|
|
|
50
50
|
readonly alternateName?: string;
|
|
51
51
|
readonly tables: readonly Table[];
|
|
52
52
|
readonly functions: readonly Function[];
|
|
53
|
+
readonly graphs: readonly Graph[];
|
|
53
54
|
readonly entityGroups: readonly EntityGroup[];
|
|
54
55
|
readonly majorVersion: number;
|
|
55
56
|
readonly minorVersion: number;
|
|
56
57
|
}
|
|
58
|
+
export interface Graph {
|
|
59
|
+
readonly name: string;
|
|
60
|
+
readonly entityType: 'Graph';
|
|
61
|
+
readonly edges: string[];
|
|
62
|
+
readonly nodes: string[];
|
|
63
|
+
readonly snapshots: string[];
|
|
64
|
+
}
|
|
57
65
|
export type ClusterType = 'Engine' | 'DataManagement' | 'ClusterManager';
|
|
58
66
|
export interface EngineSchema {
|
|
59
67
|
readonly clusterType: 'Engine';
|
|
@@ -135,6 +143,15 @@ export declare namespace showSchema {
|
|
|
135
143
|
interface Functions {
|
|
136
144
|
readonly [functionName: string]: Function;
|
|
137
145
|
}
|
|
146
|
+
interface Graph {
|
|
147
|
+
readonly Name: string;
|
|
148
|
+
readonly Nodes: string[];
|
|
149
|
+
readonly Edges: string[];
|
|
150
|
+
readonly Snapshots: string[];
|
|
151
|
+
}
|
|
152
|
+
interface Graphs {
|
|
153
|
+
readonly [graphName: string]: Graph;
|
|
154
|
+
}
|
|
138
155
|
interface Database {
|
|
139
156
|
readonly Name: string;
|
|
140
157
|
readonly Tables: Tables;
|
|
@@ -144,6 +161,7 @@ export declare namespace showSchema {
|
|
|
144
161
|
readonly MajorVersion: number;
|
|
145
162
|
readonly MinorVersion: number;
|
|
146
163
|
readonly Functions: Functions;
|
|
164
|
+
readonly Graphs: Graphs;
|
|
147
165
|
readonly DatabaseAccessMode: string;
|
|
148
166
|
}
|
|
149
167
|
interface Databases {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 14.0
|
|
3
|
+
* monaco-kusto version: 14.1.0(a07433e158c993af04f2cfb3a1453ddac68ec2bd)
|
|
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
8
|
import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
|
|
9
9
|
import { editor } from 'monaco-editor/esm/vs/editor/editor.api';
|
|
10
|
-
import { T as Token, L as LANGUAGE_ID } from './globals-
|
|
11
|
-
import { g as getCslTypeNameFromClrType, a as getCallName, b as getExpression, c as getInputParametersAsCslString, d as getEntityDataTypeFromCslType } from './schema-
|
|
12
|
-
export { s as showSchema } from './schema-
|
|
10
|
+
import { T as Token, L as LANGUAGE_ID } from './globals-bfe000bf.js';
|
|
11
|
+
import { g as getCslTypeNameFromClrType, a as getCallName, b as getExpression, c as getInputParametersAsCslString, d as getEntityDataTypeFromCslType } from './schema-9bf4386b.js';
|
|
12
|
+
export { s as showSchema } from './schema-9bf4386b.js';
|
|
13
13
|
|
|
14
14
|
function getCurrentCommandRange(editor, cursorPosition) {
|
|
15
15
|
const zeroBasedCursorLineNumber = cursorPosition.lineNumber - 1;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!-----------------------------------------------------------------------------
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* monaco-kusto version: 14.0
|
|
3
|
+
* monaco-kusto version: 14.1.0(a07433e158c993af04f2cfb3a1453ddac68ec2bd)
|
|
4
4
|
* Released under the MIT license
|
|
5
5
|
* https://https://github.com/Azure/monaco-kusto/blob/master/README.md
|
|
6
6
|
*-----------------------------------------------------------------------------*/
|