@kusto/monaco-kusto 5.1.0 → 5.1.3
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/kustoWorker.js +12 -5
- package/release/esm/kustoWorker.js +2 -2
- package/release/esm/languageService/kustoLanguageService.js +10 -3
- package/release/esm/monaco.d.ts +1 -1
- package/release/min/kusto.javascript.client.min.js +1 -1
- package/release/min/kustoMode.js +1 -1
- package/release/min/kustoWorker.js +2 -2
- package/release/min/monaco.contribution.js +1 -1
- package/release/min/monaco.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kusto/monaco-kusto",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.3",
|
|
4
4
|
"description": "CSL, KQL plugin for the Monaco Editor",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Microsoft"
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"xregexp": "^3.2.0"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@kusto/language-service": "
|
|
58
|
-
"@kusto/language-service-next": "0.0.
|
|
57
|
+
"@kusto/language-service": "0.0.36",
|
|
58
|
+
"@kusto/language-service-next": "0.0.55"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"monaco-editor": "0.33.0"
|
|
@@ -7004,7 +7004,9 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
7004
7004
|
// as '\$0'
|
|
7005
7005
|
var _a = kItem.AfterText && kItem.AfterText.length > 0
|
|
7006
7006
|
? {
|
|
7007
|
-
|
|
7007
|
+
// Need to escape dollar sign since it is used as a placeholder in snippet.
|
|
7008
|
+
// Usually dollar sign is not a valid character in a function name, but grafana uses macros that start with dollars.
|
|
7009
|
+
textToInsert: kItem.EditText.replace('$', '\\$') + "$0" + kItem.AfterText,
|
|
7008
7010
|
format: ls.InsertTextFormat.Snippet,
|
|
7009
7011
|
}
|
|
7010
7012
|
: {
|
|
@@ -7225,7 +7227,8 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
7225
7227
|
var warningAndSuggestionDiagnostics = block.Service.GetAnalyzerDiagnostics(null, true);
|
|
7226
7228
|
var filterredDiagnostics = _this.toArray(warningAndSuggestionDiagnostics).filter(function (d) {
|
|
7227
7229
|
var _a;
|
|
7228
|
-
var allowSeverity = (enableWarnings && d.Severity === 'Warning') ||
|
|
7230
|
+
var allowSeverity = (enableWarnings && d.Severity === 'Warning') ||
|
|
7231
|
+
(enableSuggestions && d.Severity === 'Suggestion');
|
|
7229
7232
|
var allowCode = !((_a = _this._languageSettings.disabledDiagnoticCodes) === null || _a === void 0 ? void 0 : _a.includes(d.Code));
|
|
7230
7233
|
return allowSeverity && allowCode;
|
|
7231
7234
|
});
|
|
@@ -7908,7 +7911,11 @@ define('vs/language/kusto/languageService/kustoLanguageService',["require", "exp
|
|
|
7908
7911
|
return Promise.resolve(undefined);
|
|
7909
7912
|
}
|
|
7910
7913
|
// Errors, Warnings and Suggestions are already shown in getDiagnostics. we don't want them in doHover.
|
|
7911
|
-
items = items.filter(function (item) {
|
|
7914
|
+
items = items.filter(function (item) {
|
|
7915
|
+
return item.Kind !== k2.QuickInfoKind.Error &&
|
|
7916
|
+
item.Kind !== k2.QuickInfoKind.Suggestion &&
|
|
7917
|
+
item.Kind !== k2.QuickInfoKind.Warning;
|
|
7918
|
+
});
|
|
7912
7919
|
var itemsText = items.map(function (item) { return item.Text.replace('\n\n', '\n* * *\n'); });
|
|
7913
7920
|
// separate items by horizontal line.
|
|
7914
7921
|
var text = itemsText.join('\n* * *\n');
|
|
@@ -8562,9 +8569,9 @@ define('vs/language/kusto/kustoWorker',["require", "exports", "./languageService
|
|
|
8562
8569
|
var completions = this._languageService.doComplete(document, position);
|
|
8563
8570
|
return completions;
|
|
8564
8571
|
};
|
|
8565
|
-
KustoWorker.prototype.doValidation = function (uri, intervals) {
|
|
8572
|
+
KustoWorker.prototype.doValidation = function (uri, intervals, includeWarnings, includeSuggestions) {
|
|
8566
8573
|
var document = this._getTextDocument(uri);
|
|
8567
|
-
var diagnostics = this._languageService.doValidation(document, intervals);
|
|
8574
|
+
var diagnostics = this._languageService.doValidation(document, intervals, includeWarnings, includeSuggestions);
|
|
8568
8575
|
return diagnostics;
|
|
8569
8576
|
};
|
|
8570
8577
|
KustoWorker.prototype.doRangeFormat = function (uri, range) {
|
|
@@ -137,9 +137,9 @@ var KustoWorker = /** @class */ (function () {
|
|
|
137
137
|
var completions = this._languageService.doComplete(document, position);
|
|
138
138
|
return completions;
|
|
139
139
|
};
|
|
140
|
-
KustoWorker.prototype.doValidation = function (uri, intervals) {
|
|
140
|
+
KustoWorker.prototype.doValidation = function (uri, intervals, includeWarnings, includeSuggestions) {
|
|
141
141
|
var document = this._getTextDocument(uri);
|
|
142
|
-
var diagnostics = this._languageService.doValidation(document, intervals);
|
|
142
|
+
var diagnostics = this._languageService.doValidation(document, intervals, includeWarnings, includeSuggestions);
|
|
143
143
|
return diagnostics;
|
|
144
144
|
};
|
|
145
145
|
KustoWorker.prototype.doRangeFormat = function (uri, range) {
|
|
@@ -360,7 +360,9 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
360
360
|
// as '\$0'
|
|
361
361
|
var _a = kItem.AfterText && kItem.AfterText.length > 0
|
|
362
362
|
? {
|
|
363
|
-
|
|
363
|
+
// Need to escape dollar sign since it is used as a placeholder in snippet.
|
|
364
|
+
// Usually dollar sign is not a valid character in a function name, but grafana uses macros that start with dollars.
|
|
365
|
+
textToInsert: kItem.EditText.replace('$', '\\$') + "$0" + kItem.AfterText,
|
|
364
366
|
format: ls.InsertTextFormat.Snippet,
|
|
365
367
|
}
|
|
366
368
|
: {
|
|
@@ -581,7 +583,8 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
581
583
|
var warningAndSuggestionDiagnostics = block.Service.GetAnalyzerDiagnostics(null, true);
|
|
582
584
|
var filterredDiagnostics = _this.toArray(warningAndSuggestionDiagnostics).filter(function (d) {
|
|
583
585
|
var _a;
|
|
584
|
-
var allowSeverity = (enableWarnings && d.Severity === 'Warning') ||
|
|
586
|
+
var allowSeverity = (enableWarnings && d.Severity === 'Warning') ||
|
|
587
|
+
(enableSuggestions && d.Severity === 'Suggestion');
|
|
585
588
|
var allowCode = !((_a = _this._languageSettings.disabledDiagnoticCodes) === null || _a === void 0 ? void 0 : _a.includes(d.Code));
|
|
586
589
|
return allowSeverity && allowCode;
|
|
587
590
|
});
|
|
@@ -1264,7 +1267,11 @@ var KustoLanguageService = /** @class */ (function () {
|
|
|
1264
1267
|
return Promise.resolve(undefined);
|
|
1265
1268
|
}
|
|
1266
1269
|
// Errors, Warnings and Suggestions are already shown in getDiagnostics. we don't want them in doHover.
|
|
1267
|
-
items = items.filter(function (item) {
|
|
1270
|
+
items = items.filter(function (item) {
|
|
1271
|
+
return item.Kind !== k2.QuickInfoKind.Error &&
|
|
1272
|
+
item.Kind !== k2.QuickInfoKind.Suggestion &&
|
|
1273
|
+
item.Kind !== k2.QuickInfoKind.Warning;
|
|
1274
|
+
});
|
|
1268
1275
|
var itemsText = items.map(function (item) { return item.Text.replace('\n\n', '\n* * *\n'); });
|
|
1269
1276
|
// separate items by horizontal line.
|
|
1270
1277
|
var text = itemsText.join('\n* * *\n');
|
package/release/esm/monaco.d.ts
CHANGED
|
@@ -120,7 +120,7 @@ declare module monaco.languages.kusto {
|
|
|
120
120
|
doDocumentFormat(uri: string): Promise<ls.TextEdit[]>;
|
|
121
121
|
doRangeFormat(uri: string, range: ls.Range): Promise<ls.TextEdit[]>;
|
|
122
122
|
doCurrentCommandFormat(uri: string, caretPosition: ls.Position): Promise<ls.TextEdit[]>;
|
|
123
|
-
doValidation(uri: string, intervals: { start: number; end: number }[]): Promise<ls.Diagnostic[]>;
|
|
123
|
+
doValidation(uri: string, intervals: { start: number; end: number }[], includeWarnings?: boolean, includeSuggestions?: boolean): Promise<ls.Diagnostic[]>;
|
|
124
124
|
setParameters(parameters: ScalarParameter[]): void;
|
|
125
125
|
/**
|
|
126
126
|
* Get all the database references from the current command.
|