@kusto/monaco-kusto 5.3.9 → 5.3.11

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kusto/monaco-kusto",
3
- "version": "5.3.9",
3
+ "version": "5.3.11",
4
4
  "description": "CSL, KQL plugin for the Monaco Editor",
5
5
  "author": {
6
6
  "name": "Microsoft"
@@ -18,8 +18,8 @@
18
18
  },
19
19
  "scripts": {
20
20
  "copy_runtime_deps_to_out": "mcopy ./node_modules/@kusto/language-service/Kusto.JavaScript.Client.min.js ./out/vs/language/kusto/kusto.javascript.client.min.js && mcopy ./node_modules/@kusto/language-service-next/Kusto.Language.Bridge.min.js ./out/vs/language/kusto/Kusto.Language.Bridge.min.js && mcopy ./node_modules/@kusto/language-service/bridge.min.js ./out/vs/language/kusto/bridge.min.js && node ./node_modules/copy-dir-cli/bin/copy ./node_modules/monaco-editor-core/dev/vs ./out/vs",
21
- "compile": "tsc -p ./src/tsconfig.json && tsc -p ./src/tsconfig.esm.json",
22
- "watch": "echo dev > test/mode.txt && tsc -p ./src/tsconfig.watch.json && npm run copy_runtime_deps_to_out && concurrently \"live-server ./ \" \"tsc -w -p ./src/tsconfig.watch.json \"",
21
+ "compile": "tsc -p ./tsconfig.json && tsc -p ./tsconfig.esm.json",
22
+ "watch": "echo dev > test/mode.txt && tsc -p ./tsconfig.watch.json && npm run copy_runtime_deps_to_out && concurrently \"live-server ./ \" \"tsc -w -p ./tsconfig.watch.json \"",
23
23
  "test_release": "echo release > test/mode.txt && http-server -c-1 -p 8080 ./ -o index.html",
24
24
  "copy_types_to_release": "mcopy ./src/monaco.d.ts ./release/esm/monaco.d.ts && mcopy ./out/amd/monaco.contribution.d.ts ./release/esm/monaco.contribution.d.ts && mcopy ./src/monaco.d.ts ./release/min/monaco.d.ts && mcopy ./out/amd/monaco.contribution.d.ts ./release/min/monaco.contribution.d.ts && mcopy ./node_modules/@kusto/language-service/Kusto.JavaScript.Client.min.js ./release/min/kusto.javascript.client.min.js && mcopy ./node_modules/@kusto/language-service-next/Kusto.Language.Bridge.min.js ./release/min/Kusto.Language.Bridge.min.js && mcopy ./node_modules/@kusto/language-service/bridge.min.js ./release/min/bridge.min.js && mcopy ./node_modules/@kusto/language-service/newtonsoft.json.min.js ./release/min/newtonsoft.json.min.js",
25
25
  "prepublishOnly": "mkdirp release && npm run compile && node ./scripts/release.js && node ./scripts/bundle.js && npm run copy_runtime_deps_to_out && npm run copy_types_to_release",
@@ -46,11 +46,11 @@
46
46
  "monaco-plugin-helpers": "^1.0.3",
47
47
  "object-assign": "4.1.0",
48
48
  "requirejs": "^2.3.6",
49
- "terser": "^4.6.7",
49
+ "terser": "^5.16.2",
50
50
  "ts-jest": "^26.1.1",
51
- "typescript": "3.9.7",
52
- "vscode-languageserver-types": "3.16.0",
51
+ "typescript": "^4.0.0",
53
52
  "vscode-languageserver-textdocument": "1.0.4",
53
+ "vscode-languageserver-types": "3.16.0",
54
54
  "xregexp": "^3.2.0"
55
55
  },
56
56
  "dependencies": {
@@ -64,7 +64,7 @@
64
64
  "rootDir": "src",
65
65
  "globals": {
66
66
  "ts-jest": {
67
- "tsConfigFile": "src/tsconfig.json"
67
+ "tsConfigFile": "./tsconfig.json"
68
68
  }
69
69
  },
70
70
  "transform": {
@@ -79,10 +79,5 @@
79
79
  "json",
80
80
  "node"
81
81
  ]
82
- },
83
- "prettier": {
84
- "printWidth": 120,
85
- "tabWidth": 4,
86
- "singleQuote": true
87
82
  }
88
83
  }
@@ -113,23 +113,69 @@ define('vs/language/kusto/languageService/kustoMonarchLanguageDefinition',["requ
113
113
  exports.KustoLanguageDefinition = {
114
114
  name: 'kusto',
115
115
  mimeTypes: ['text/kusto'],
116
- displayName: "Kusto",
117
- defaultToken: "invalid",
118
- brackets: [['[', ']', 'delimiter.square'],
119
- ['(', ')', 'delimiter.parenthesis']],
116
+ displayName: 'Kusto',
117
+ defaultToken: 'invalid',
118
+ brackets: [
119
+ ['[', ']', 'delimiter.square'],
120
+ ['(', ')', 'delimiter.parenthesis'],
121
+ ],
120
122
  wordDefinition: /(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
121
123
  // .slice() call is for creating a shallow copy of the array since bridge.net shoves a $type property on the array which monaco doesn't like.
122
124
  promotedOperatorCommandTokens: Kusto.Data.IntelliSense.CslCommandParser.PromotedOperatorCommandTokens.slice(0),
123
125
  operatorCommandTokens: Kusto.Data.IntelliSense.CslCommandParser.OperatorCommandTokens.slice(0),
124
126
  keywords: [
125
- 'by', 'on', 'contains', 'notcontains', 'containscs', 'notcontainscs', 'startswith', 'has', 'matches', 'regex', 'true',
126
- 'false', 'and', 'or', 'typeof', 'int', 'string', 'date', 'datetime', 'time', 'long', 'real', '​boolean', 'bool'
127
+ 'by',
128
+ 'on',
129
+ 'contains',
130
+ 'notcontains',
131
+ 'containscs',
132
+ 'notcontainscs',
133
+ 'startswith',
134
+ 'has',
135
+ 'matches',
136
+ 'regex',
137
+ 'true',
138
+ 'false',
139
+ 'and',
140
+ 'or',
141
+ 'typeof',
142
+ 'int',
143
+ 'string',
144
+ 'date',
145
+ 'datetime',
146
+ 'time',
147
+ 'long',
148
+ 'real',
149
+ '​boolean',
150
+ 'bool',
127
151
  ],
128
152
  operators: ['+', '-', '*', '/', '>', '<', '==', '<>', '<=', '>=', '~', '!~'],
129
153
  builtinFunctions: [
130
- 'countof', 'bin', 'extentid', 'extract', 'extractjson', 'floor', 'iif', 'isnull', 'isnotnull', 'notnull', 'isempty',
131
- 'isnotempty', 'notempty', 'now', 're2', 'strcat', 'strlen', 'toupper',
132
- 'tostring', 'count', 'cnt', 'sum', 'min', 'max', 'avg'
154
+ 'countof',
155
+ 'bin',
156
+ 'extentid',
157
+ 'extract',
158
+ 'extractjson',
159
+ 'floor',
160
+ 'iif',
161
+ 'isnull',
162
+ 'isnotnull',
163
+ 'notnull',
164
+ 'isempty',
165
+ 'isnotempty',
166
+ 'notempty',
167
+ 'now',
168
+ 're2',
169
+ 'strcat',
170
+ 'strlen',
171
+ 'toupper',
172
+ 'tostring',
173
+ 'count',
174
+ 'cnt',
175
+ 'sum',
176
+ 'min',
177
+ 'max',
178
+ 'avg',
133
179
  ],
134
180
  tokenizer: {
135
181
  root: [
@@ -142,7 +188,9 @@ define('vs/language/kusto/languageService/kustoMonarchLanguageDefinition',["requ
142
188
  [/[;,.]/, 'delimiter'],
143
189
  [/[()\[\]]/, '@brackets'],
144
190
  [/[<>=!%&+\-*/|~^]/, 'operator'],
145
- [/[\w@#\-$]+/, {
191
+ [
192
+ /[\w@#\-$]+/,
193
+ {
146
194
  cases: {
147
195
  '@keywords': 'keyword',
148
196
  '@promotedOperatorCommandTokens': 'operator.sql',
@@ -150,41 +198,44 @@ define('vs/language/kusto/languageService/kustoMonarchLanguageDefinition',["requ
150
198
  '@operators': 'operator',
151
199
  '@builtinFunctions': 'predefined',
152
200
  '@default': 'identifier',
153
- }
154
- }],
201
+ },
202
+ },
203
+ ],
155
204
  ],
156
205
  whitespace: [[/\s+/, 'white']],
157
- comments: [["\\/\\/+.*", "comment"]],
206
+ comments: [['\\/\\/+.*', 'comment']],
158
207
  numbers: [
159
208
  [/0[xX][0-9a-fA-F]*/, 'number'],
160
209
  [/[$][+-]*\d*(\.\d*)?/, 'number'],
161
- [/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/, 'number']
210
+ [/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/, 'number'],
162
211
  ],
163
212
  strings: [
164
213
  [/H'/, { token: 'string.quote', bracket: '@open', next: '@string' }],
165
214
  [/h'/, { token: 'string.quote', bracket: '@open', next: '@string' }],
166
- [/'/, { token: 'string.quote', bracket: '@open', next: '@string' }]
215
+ [/'/, { token: 'string.quote', bracket: '@open', next: '@string' }],
167
216
  ],
168
217
  string: [
169
218
  [/[^']+/, 'string'],
170
219
  [/''/, 'string'],
171
- [/'/, { token: 'string.quote', bracket: '@close', next: '@pop' }]
220
+ [/'/, { token: 'string.quote', bracket: '@close', next: '@pop' }],
172
221
  ],
173
222
  dqstrings: [
174
223
  [/H"/, { token: 'string.quote', bracket: '@open', next: '@dqstring' }],
175
224
  [/h"/, { token: 'string.quote', bracket: '@open', next: '@dqstring' }],
176
- [/"/, { token: 'string.quote', bracket: '@open', next: '@dqstring' }]
225
+ [/"/, { token: 'string.quote', bracket: '@open', next: '@dqstring' }],
177
226
  ],
178
227
  dqstring: [
179
228
  [/[^"]+/, 'string'],
180
229
  [/""/, 'string'],
181
- [/"/, { token: 'string.quote', bracket: '@close', next: '@pop' }]
230
+ [/"/, { token: 'string.quote', bracket: '@close', next: '@pop' }],
182
231
  ],
183
- literals: [[/datetime\(\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}(:\d{2}(\.\d{0,3})?)?)?\)/, 'number'],
232
+ literals: [
233
+ [/datetime\(\d{4}-\d{2}-\d{2}(\s+\d{2}:\d{2}(:\d{2}(\.\d{0,3})?)?)?\)/, 'number'],
184
234
  [/time\((\d+(s(ec(onds?)?)?|m(in(utes?)?)?|h(ours?)?|d(ays?)?)|(\s*(('[^']+')|("[^"]+"))\s*))\)/, 'number'],
185
235
  [/guid\([\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}\)/, 'number'],
186
- [/typeof\((int|string|date|datetime|time|long|real|boolean|bool)\)/, 'number']]
187
- }
236
+ [/typeof\((int|string|date|datetime|time|long|real|boolean|bool)\)/, 'number'],
237
+ ],
238
+ },
188
239
  };
189
240
  });
190
241
 
@@ -2260,7 +2311,6 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
2260
2311
  var Uri = monaco.Uri;
2261
2312
  var Range = monaco.Range;
2262
2313
  var ClassificationKind = Kusto.Language.Editor.ClassificationKind;
2263
- // --- diagnostics ---
2264
2314
  var DiagnosticsAdapter = /** @class */ (function () {
2265
2315
  function DiagnosticsAdapter(_monacoInstance, _languageId, _worker, defaults, onSchemaChange) {
2266
2316
  var _this = this;
@@ -2403,9 +2453,9 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
2403
2453
  }
2404
2454
  else {
2405
2455
  // Add custom popup for syntax error: icon, header and message as markdown
2406
- var header = syntaxErrorAsMarkDown.header ? "**" + syntaxErrorAsMarkDown.header + "** \n\n" : '';
2407
- var icon = syntaxErrorAsMarkDown.icon ? "![](" + syntaxErrorAsMarkDown.icon + ")" : '';
2408
- var popupErrorHoverHeaderMessage_1 = icon + " " + header;
2456
+ var header = syntaxErrorAsMarkDown.header ? "**".concat(syntaxErrorAsMarkDown.header, "** \n\n") : '';
2457
+ var icon = syntaxErrorAsMarkDown.icon ? "![](".concat(syntaxErrorAsMarkDown.icon, ")") : '';
2458
+ var popupErrorHoverHeaderMessage_1 = "".concat(icon, " ").concat(header);
2409
2459
  var newDecorations = markers.map(function (marker) {
2410
2460
  return {
2411
2461
  range: {
@@ -2432,8 +2482,7 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
2432
2482
  },
2433
2483
  };
2434
2484
  });
2435
- var oldMarkers = monaco.editor
2436
- .getModelMarkers({
2485
+ var oldMarkers = monaco.editor.getModelMarkers({
2437
2486
  owner: languageId,
2438
2487
  resource: resource,
2439
2488
  });
@@ -2739,7 +2788,7 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
2739
2788
  var classificationColorTriplets = getClassificationColorTriplets();
2740
2789
  var cssInnerHtml = classificationColorTriplets
2741
2790
  .map(function (pair) {
2742
- return ".vs ." + pair.classification + " {color: #" + pair.colorLight + ";} .vs-dark ." + pair.classification + " {color: #" + pair.colorDark + ";}";
2791
+ return ".vs .".concat(pair.classification, " {color: #").concat(pair.colorLight, ";} .vs-dark .").concat(pair.classification, " {color: #").concat(pair.colorDark, ";}");
2743
2792
  })
2744
2793
  .join('\n');
2745
2794
  return cssInnerHtml;
@@ -2840,7 +2889,7 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
2840
2889
  text: textEdit.newText,
2841
2890
  };
2842
2891
  }
2843
- var DOCS_BASE_URL = "https://learn.microsoft.com/azure/data-explorer/kusto/query";
2892
+ var DOCS_BASE_URL = 'https://learn.microsoft.com/azure/data-explorer/kusto/query';
2844
2893
  function formatDocLink(docString) {
2845
2894
  // If the docString is empty, we want to return undefined to prevent an empty documentation popup.
2846
2895
  if (!docString) {
@@ -2850,9 +2899,11 @@ define('vs/language/kusto/languageFeatures',["require", "exports", "vscode-langu
2850
2899
  var urisProxy = new Proxy(target, {
2851
2900
  get: function (_target, prop, _receiver) {
2852
2901
  // The link comes with a postfix of ".md" that we want to remove
2853
- var linkWithoutPostfix = prop.toString().replace(".md", "");
2902
+ var linkWithoutPostfix = prop.toString().replace('.md', '');
2854
2903
  // Sometimes we get the link as a full URL. For example in the main doc link of the item
2855
- var fullURL = linkWithoutPostfix.startsWith("https") ? linkWithoutPostfix : DOCS_BASE_URL + "/" + linkWithoutPostfix;
2904
+ var fullURL = linkWithoutPostfix.startsWith('https')
2905
+ ? linkWithoutPostfix
2906
+ : "".concat(DOCS_BASE_URL, "/").concat(linkWithoutPostfix);
2856
2907
  return monaco.Uri.parse(fullURL);
2857
2908
  },
2858
2909
  });
@@ -3194,7 +3245,7 @@ define('vs/language/kusto/kustoMode',["require", "exports", "./workerManager", "
3194
3245
  for (var _i = 1; _i < arguments.length; _i++) {
3195
3246
  more[_i - 1] = arguments[_i];
3196
3247
  }
3197
- var augmentedSetSchema = function (schema, worker, globalParameters) {
3248
+ var augmentedSetSchema = function (schema, worker, globalScalarParameters, globalTabularParameters) {
3198
3249
  var workerPromise = worker.setSchema(schema);
3199
3250
  workerPromise.then(function () {
3200
3251
  onSchemaChange.fire(schema);
@@ -3202,10 +3253,13 @@ define('vs/language/kusto/kustoMode',["require", "exports", "./workerManager", "
3202
3253
  };
3203
3254
  var worker = client.getLanguageServiceWorker.apply(client, [first].concat(more));
3204
3255
  return worker.then(function (worker) {
3205
- return (__assign(__assign({}, worker), { setSchema: function (schema) { return augmentedSetSchema(schema, worker); }, setSchemaFromShowSchema: function (schema, connection, database, globalParameters) {
3256
+ return (__assign(__assign({}, worker), { setSchema: function (schema) { return augmentedSetSchema(schema, worker); }, setSchemaFromShowSchema: function (schema, connection, database, globalScalarParameters, globalTabularParameters) {
3206
3257
  worker
3207
3258
  .normalizeSchema(schema, connection, database)
3208
- .then(function (schema) { return (globalParameters ? __assign(__assign({}, schema), { globalParameters: globalParameters }) : schema); })
3259
+ .then(function (schema) {
3260
+ return globalScalarParameters
3261
+ ? __assign(__assign({}, schema), { globalScalarParameters: globalScalarParameters, globalTabularParameters: globalTabularParameters }) : schema;
3262
+ })
3209
3263
  .then(function (normalized) { return augmentedSetSchema(normalized, worker); });
3210
3264
  } }));
3211
3265
  });