@kusto/monaco-kusto 5.6.5 → 6.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 +26 -16
- package/release/dev/commandFormatter.d.ts +6 -0
- package/release/dev/commandHighlighter.d.ts +20 -0
- package/release/dev/extendedEditor.d.ts +7 -0
- package/release/dev/kustoMode.d.ts +8 -0
- package/release/dev/kustoMode.js +1732 -3278
- package/release/dev/kustoWorker.d.ts +92 -0
- package/release/dev/kustoWorker.js +5663 -8534
- package/release/dev/languageFeatures.d.ts +91 -0
- package/release/dev/languageService/kustoLanguageService.d.ts +142 -0
- package/release/dev/languageService/kustoMonarchLanguageDefinition.d.ts +1 -0
- package/release/dev/languageService/renderInfo.d.ts +31 -0
- package/release/dev/languageService/schema.d.ts +144 -0
- package/release/dev/languageService/settings.d.ts +30 -0
- package/release/dev/main-24a15f15.js +1958 -0
- package/release/dev/monaco.contribution.d.ts +15 -0
- package/release/dev/monaco.contribution.js +462 -308
- package/release/dev/workerManager.d.ts +23 -0
- package/release/esm/commandFormatter.d.ts +6 -0
- package/release/esm/commandHighlighter.d.ts +20 -0
- package/release/esm/extendedEditor.d.ts +7 -0
- package/release/esm/kusto.worker.js +2224 -5
- package/release/esm/kustoMode.d.ts +8 -0
- package/release/esm/kustoMode.js +1120 -88
- package/release/esm/kustoWorker.d.ts +92 -0
- package/release/esm/languageFeatures.d.ts +91 -0
- package/release/esm/languageService/kustoLanguageService.d.ts +142 -0
- package/release/esm/languageService/kustoMonarchLanguageDefinition.d.ts +1 -0
- package/release/esm/languageService/renderInfo.d.ts +31 -0
- package/release/esm/languageService/schema.d.ts +144 -0
- package/release/esm/languageService/settings.d.ts +30 -0
- package/release/esm/monaco.contribution.d.ts +1 -0
- package/release/esm/monaco.contribution.js +424 -180
- package/release/esm/workerManager.d.ts +23 -0
- package/release/min/commandFormatter.d.ts +6 -0
- package/release/min/commandHighlighter.d.ts +20 -0
- package/release/min/extendedEditor.d.ts +7 -0
- package/release/min/kustoMode.d.ts +8 -0
- package/release/min/kustoMode.js +2 -11
- package/release/min/kustoWorker.d.ts +92 -0
- package/release/min/kustoWorker.js +10 -53
- package/release/min/languageFeatures.d.ts +91 -0
- package/release/min/languageService/kustoLanguageService.d.ts +142 -0
- package/release/min/languageService/kustoMonarchLanguageDefinition.d.ts +1 -0
- package/release/min/languageService/renderInfo.d.ts +31 -0
- package/release/min/languageService/schema.d.ts +144 -0
- package/release/min/languageService/settings.d.ts +30 -0
- package/release/min/main-1108181b.js +7 -0
- package/release/min/monaco.contribution.d.ts +1 -0
- package/release/min/monaco.contribution.js +2 -2
- package/release/min/monaco.d.ts +1 -318
- package/release/min/workerManager.d.ts +23 -0
- package/release/{esm/monaco.d.ts → monaco.d.ts} +1 -0
- package/release/esm/_deps/lodash/lodash.js +0 -17209
- package/release/esm/_deps/vscode-languageserver-types/main.js +0 -1908
- package/release/esm/_deps/xregexp/xregexp-all.js +0 -4652
- package/release/esm/commandFormatter.js +0 -36
- package/release/esm/commandHighlighter.js +0 -51
- package/release/esm/extendedEditor.js +0 -38
- package/release/esm/kustoWorker.js +0 -245
- package/release/esm/languageFeatures.js +0 -1030
- package/release/esm/languageService/kustoLanguageService.js +0 -1912
- package/release/esm/languageService/kustoMonarchLanguageDefinition.js +0 -127
- package/release/esm/languageService/schema.js +0 -64
- package/release/esm/workerManager.js +0 -102
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
var KustoCommandFormatter = /** @class */ (function () {
|
|
2
|
-
function KustoCommandFormatter(editor) {
|
|
3
|
-
var _this = this;
|
|
4
|
-
this.editor = editor;
|
|
5
|
-
this.actionAdded = false;
|
|
6
|
-
// selection also represents no selection - for example the event gets triggered when moving cursor from point
|
|
7
|
-
// a to point b. in the case start position will equal end position.
|
|
8
|
-
editor.onDidChangeCursorSelection(function (changeEvent) {
|
|
9
|
-
if (_this.editor.getModel().getLanguageId() !== 'kusto') {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
// Theoretically you would expect this code to run only once in onDidCreateEditor.
|
|
13
|
-
// Turns out that onDidCreateEditor is fired before the IStandaloneEditor is completely created (it is emmited by
|
|
14
|
-
// the super ctor before the child ctor was able to fully run).
|
|
15
|
-
// Thus we don't have a key binding provided yet when onDidCreateEditor is run, which is essential to call addAction.
|
|
16
|
-
// By adding the action here in onDidChangeCursorSelection we're making sure that the editor has a key binding provider,
|
|
17
|
-
// and we just need to make sure that this happens only once.
|
|
18
|
-
if (!_this.actionAdded) {
|
|
19
|
-
editor.addAction({
|
|
20
|
-
id: 'editor.action.kusto.formatCurrentCommand',
|
|
21
|
-
label: 'Format Command Under Cursor',
|
|
22
|
-
keybindings: [
|
|
23
|
-
monaco.KeyMod.chord(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyK, monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyF),
|
|
24
|
-
],
|
|
25
|
-
run: function (ed) {
|
|
26
|
-
editor.trigger('KustoCommandFormatter', 'editor.action.formatSelection', null);
|
|
27
|
-
},
|
|
28
|
-
contextMenuGroupId: '1_modification',
|
|
29
|
-
});
|
|
30
|
-
_this.actionAdded = true;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
return KustoCommandFormatter;
|
|
35
|
-
}());
|
|
36
|
-
export default KustoCommandFormatter;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Highlights the command that surround cursor location
|
|
3
|
-
*/
|
|
4
|
-
var KustoCommandHighlighter = /** @class */ (function () {
|
|
5
|
-
/**
|
|
6
|
-
* Register to cursor movement and seleciton events.
|
|
7
|
-
* @param editor monaco editor instance
|
|
8
|
-
*/
|
|
9
|
-
function KustoCommandHighlighter(editor) {
|
|
10
|
-
var _this = this;
|
|
11
|
-
this.editor = editor;
|
|
12
|
-
this.disposables = [];
|
|
13
|
-
this.decorations = [];
|
|
14
|
-
// Note that selection update is triggered not only for selection changes, but also just when no text selection is occuring and cursor just moves around.
|
|
15
|
-
// This case is counted as a 0-length selection starting and ending on the cursor position.
|
|
16
|
-
this.editor.onDidChangeCursorSelection(function (changeEvent) {
|
|
17
|
-
if (_this.editor.getModel().getLanguageId() !== 'kusto') {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
_this.highlightCommandUnderCursor(changeEvent);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
KustoCommandHighlighter.prototype.getId = function () {
|
|
24
|
-
return KustoCommandHighlighter.ID;
|
|
25
|
-
};
|
|
26
|
-
KustoCommandHighlighter.prototype.dispose = function () {
|
|
27
|
-
this.disposables.forEach(function (d) { return d.dispose(); });
|
|
28
|
-
};
|
|
29
|
-
KustoCommandHighlighter.prototype.highlightCommandUnderCursor = function (changeEvent) {
|
|
30
|
-
// Looks like the user selected a bunch of text. we don't want to highlight the entire command in this case - since highlighting
|
|
31
|
-
// the text is more helpful.
|
|
32
|
-
if (!changeEvent.selection.isEmpty()) {
|
|
33
|
-
this.decorations = this.editor.deltaDecorations(this.decorations, []);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
var commandRange = this.editor.getCurrentCommandRange(changeEvent.selection.getStartPosition());
|
|
37
|
-
var decorations = [
|
|
38
|
-
{
|
|
39
|
-
range: commandRange,
|
|
40
|
-
options: KustoCommandHighlighter.CURRENT_COMMAND_HIGHLIGHT,
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
this.decorations = this.editor.deltaDecorations(this.decorations, decorations);
|
|
44
|
-
};
|
|
45
|
-
KustoCommandHighlighter.ID = 'editor.contrib.kustoCommandHighliter';
|
|
46
|
-
KustoCommandHighlighter.CURRENT_COMMAND_HIGHLIGHT = {
|
|
47
|
-
className: 'selectionHighlight',
|
|
48
|
-
};
|
|
49
|
-
return KustoCommandHighlighter;
|
|
50
|
-
}());
|
|
51
|
-
export default KustoCommandHighlighter;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extending ICode editor to contain additional kusto-specific methods.
|
|
3
|
-
* note that the extend method needs to be called at least once to take affect, otherwise this here code is useless.
|
|
4
|
-
*/
|
|
5
|
-
export function extend(editor) {
|
|
6
|
-
var proto = Object.getPrototypeOf(editor);
|
|
7
|
-
proto.getCurrentCommandRange = function (cursorPosition) {
|
|
8
|
-
var editor = this;
|
|
9
|
-
var zeroBasedCursorLineNumber = cursorPosition.lineNumber - 1;
|
|
10
|
-
var lines = this.getModel().getLinesContent();
|
|
11
|
-
var commandOrdinal = 0;
|
|
12
|
-
var linesWithCommandOrdinal = [];
|
|
13
|
-
for (var lineNumber = 0; lineNumber < lines.length; lineNumber++) {
|
|
14
|
-
var isEmptyLine = lines[lineNumber].trim() === '';
|
|
15
|
-
if (isEmptyLine) {
|
|
16
|
-
// increase commandCounter - we'll be starting a new command.
|
|
17
|
-
linesWithCommandOrdinal.push({ commandOrdinal: commandOrdinal++, lineNumber: lineNumber });
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
linesWithCommandOrdinal.push({ commandOrdinal: commandOrdinal, lineNumber: lineNumber });
|
|
21
|
-
}
|
|
22
|
-
// No need to keep scanning if we're past our line and we've seen an empty line.
|
|
23
|
-
if (lineNumber > zeroBasedCursorLineNumber &&
|
|
24
|
-
commandOrdinal > linesWithCommandOrdinal[zeroBasedCursorLineNumber].commandOrdinal) {
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
var currentCommandOrdinal = linesWithCommandOrdinal[zeroBasedCursorLineNumber].commandOrdinal;
|
|
29
|
-
var currentCommandLines = linesWithCommandOrdinal.filter(function (line) { return line.commandOrdinal === currentCommandOrdinal; });
|
|
30
|
-
var currentCommandStartLine = currentCommandLines[0].lineNumber + 1;
|
|
31
|
-
var currentCommandEndLine = currentCommandLines[currentCommandLines.length - 1].lineNumber + 1;
|
|
32
|
-
// End-column of 1 means no characters will be highlighted - since columns are 1-based in monaco apis.
|
|
33
|
-
// Start-column of 1 and End column of 2 means 1st character is selected.
|
|
34
|
-
// Thus if a line has n column and we need to provide n+1 so that the entire line will be highlighted.
|
|
35
|
-
var commandEndColumn = lines[currentCommandEndLine - 1].length + 1;
|
|
36
|
-
return new monaco.Range(currentCommandStartLine, 1, currentCommandEndLine, commandEndColumn);
|
|
37
|
-
};
|
|
38
|
-
}
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import * as kustoService from './languageService/kustoLanguageService';
|
|
2
|
-
import * as ls from './_deps/vscode-languageserver-types/main';
|
|
3
|
-
var KustoWorker = /** @class */ (function () {
|
|
4
|
-
function KustoWorker(ctx, createData) {
|
|
5
|
-
this._ctx = ctx;
|
|
6
|
-
this._languageSettings = createData.languageSettings;
|
|
7
|
-
this._languageService = kustoService.getKustoLanguageService();
|
|
8
|
-
this._languageService.configure(this._languageSettings);
|
|
9
|
-
}
|
|
10
|
-
// --- language service host ---------------
|
|
11
|
-
KustoWorker.prototype.setSchema = function (schema) {
|
|
12
|
-
return this._languageService.setSchema(schema);
|
|
13
|
-
};
|
|
14
|
-
KustoWorker.prototype.addClusterToSchema = function (uri, clusterName, databasesNames) {
|
|
15
|
-
var document = this._getTextDocument(uri);
|
|
16
|
-
if (!document) {
|
|
17
|
-
console.error("addClusterToSchema: document is ".concat(document, ". uri is ").concat(uri));
|
|
18
|
-
return Promise.resolve();
|
|
19
|
-
}
|
|
20
|
-
return this._languageService.addClusterToSchema(document, clusterName, databasesNames);
|
|
21
|
-
};
|
|
22
|
-
KustoWorker.prototype.addDatabaseToSchema = function (uri, clusterName, databaseSchema) {
|
|
23
|
-
var document = this._getTextDocument(uri);
|
|
24
|
-
if (!document) {
|
|
25
|
-
console.error("addDatabaseToSchema: document is ".concat(document, ". uri is ").concat(uri));
|
|
26
|
-
return Promise.resolve();
|
|
27
|
-
}
|
|
28
|
-
return this._languageService.addDatabaseToSchema(document, clusterName, databaseSchema);
|
|
29
|
-
};
|
|
30
|
-
KustoWorker.prototype.setSchemaFromShowSchema = function (schema, clusterConnectionString, databaseInContextName) {
|
|
31
|
-
return this._languageService.setSchemaFromShowSchema(schema, clusterConnectionString, databaseInContextName);
|
|
32
|
-
};
|
|
33
|
-
KustoWorker.prototype.normalizeSchema = function (schema, clusterConnectionString, databaseInContextName) {
|
|
34
|
-
return this._languageService.normalizeSchema(schema, clusterConnectionString, databaseInContextName);
|
|
35
|
-
};
|
|
36
|
-
KustoWorker.prototype.getSchema = function () {
|
|
37
|
-
return this._languageService.getSchema();
|
|
38
|
-
};
|
|
39
|
-
KustoWorker.prototype.getCommandInContext = function (uri, cursorOffset) {
|
|
40
|
-
var document = this._getTextDocument(uri);
|
|
41
|
-
if (!document) {
|
|
42
|
-
console.error("getCommandInContext: document is ".concat(document, ". uri is ").concat(uri));
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
var commandInContext = this._languageService.getCommandInContext(document, cursorOffset);
|
|
46
|
-
if (commandInContext === undefined) {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
return commandInContext;
|
|
50
|
-
};
|
|
51
|
-
KustoWorker.prototype.getQueryParams = function (uri, cursorOffset) {
|
|
52
|
-
var document = this._getTextDocument(uri);
|
|
53
|
-
if (!document) {
|
|
54
|
-
console.error("getQueryParams: document is ".concat(document, ". uri is ").concat(uri));
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
var queryParams = this._languageService.getQueryParams(document, cursorOffset);
|
|
58
|
-
if (queryParams === undefined) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
return queryParams;
|
|
62
|
-
};
|
|
63
|
-
KustoWorker.prototype.getGlobalParams = function (uri) {
|
|
64
|
-
var document = this._getTextDocument(uri);
|
|
65
|
-
if (!document) {
|
|
66
|
-
console.error("getGLobalParams: document is ".concat(document, ". uri is ").concat(uri));
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
var globalParams = this._languageService.getGlobalParams(document);
|
|
70
|
-
if (globalParams === undefined) {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
return globalParams;
|
|
74
|
-
};
|
|
75
|
-
KustoWorker.prototype.getReferencedSymbols = function (uri, cursorOffset) {
|
|
76
|
-
var document = this._getTextDocument(uri);
|
|
77
|
-
if (!document) {
|
|
78
|
-
console.error("getReferencedGlobalParams: document is ".concat(document, ". uri is ").concat(uri));
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
var referencedParams = this._languageService.getReferencedSymbols(document, cursorOffset);
|
|
82
|
-
if (referencedParams === undefined) {
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
85
|
-
return referencedParams;
|
|
86
|
-
};
|
|
87
|
-
KustoWorker.prototype.getReferencedGlobalParams = function (uri, cursorOffset) {
|
|
88
|
-
var document = this._getTextDocument(uri);
|
|
89
|
-
if (!document) {
|
|
90
|
-
console.error("getReferencedGlobalParams: document is ".concat(document, ". uri is ").concat(uri));
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
var referencedParams = this._languageService.getReferencedGlobalParams(document, cursorOffset);
|
|
94
|
-
if (referencedParams === undefined) {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
return referencedParams;
|
|
98
|
-
};
|
|
99
|
-
KustoWorker.prototype.getRenderInfo = function (uri, cursorOffset) {
|
|
100
|
-
var document = this._getTextDocument(uri);
|
|
101
|
-
if (!document) {
|
|
102
|
-
console.error("getRenderInfo: document is ".concat(document, ". uri is ").concat(uri));
|
|
103
|
-
}
|
|
104
|
-
return this._languageService.getRenderInfo(document, cursorOffset).then(function (result) {
|
|
105
|
-
if (!result) {
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
return result;
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* Get command in context and the command range.
|
|
113
|
-
* This method will basically convert generate microsoft language service interface to monaco interface.
|
|
114
|
-
* @param uri document URI
|
|
115
|
-
* @param cursorOffset offset from start of document to cursor
|
|
116
|
-
*/
|
|
117
|
-
KustoWorker.prototype.getCommandAndLocationInContext = function (uri, cursorOffset) {
|
|
118
|
-
var document = this._getTextDocument(uri);
|
|
119
|
-
if (!document) {
|
|
120
|
-
console.error("getCommandAndLocationInContext: document is ".concat(document, ". uri is ").concat(uri));
|
|
121
|
-
return Promise.resolve(null);
|
|
122
|
-
}
|
|
123
|
-
return this._languageService.getCommandAndLocationInContext(document, cursorOffset).then(function (result) {
|
|
124
|
-
if (!result) {
|
|
125
|
-
return null;
|
|
126
|
-
}
|
|
127
|
-
// convert to monaco object.
|
|
128
|
-
var text = result.text, _a = result.location.range, start = _a.start, end = _a.end;
|
|
129
|
-
var range = new monaco.Range(start.line + 1, start.character + 1, end.line + 1, end.character + 1);
|
|
130
|
-
return {
|
|
131
|
-
range: range,
|
|
132
|
-
text: text,
|
|
133
|
-
};
|
|
134
|
-
});
|
|
135
|
-
};
|
|
136
|
-
KustoWorker.prototype.getCommandsInDocument = function (uri) {
|
|
137
|
-
var document = this._getTextDocument(uri);
|
|
138
|
-
if (!document) {
|
|
139
|
-
console.error("getCommandInDocument: document is ".concat(document, ". uri is ").concat(uri));
|
|
140
|
-
return null;
|
|
141
|
-
}
|
|
142
|
-
return this._languageService.getCommandsInDocument(document);
|
|
143
|
-
};
|
|
144
|
-
KustoWorker.prototype.doComplete = function (uri, position) {
|
|
145
|
-
var document = this._getTextDocument(uri);
|
|
146
|
-
if (!document) {
|
|
147
|
-
return null;
|
|
148
|
-
}
|
|
149
|
-
var completions = this._languageService.doComplete(document, position);
|
|
150
|
-
return completions;
|
|
151
|
-
};
|
|
152
|
-
KustoWorker.prototype.doValidation = function (uri, intervals, includeWarnings, includeSuggestions) {
|
|
153
|
-
var document = this._getTextDocument(uri);
|
|
154
|
-
var diagnostics = this._languageService.doValidation(document, intervals, includeWarnings, includeSuggestions);
|
|
155
|
-
return diagnostics;
|
|
156
|
-
};
|
|
157
|
-
KustoWorker.prototype.getResultActions = function (uri, start, end) {
|
|
158
|
-
var document = this._getTextDocument(uri);
|
|
159
|
-
return this._languageService.getResultActions(document, start, end);
|
|
160
|
-
};
|
|
161
|
-
KustoWorker.prototype.doRangeFormat = function (uri, range) {
|
|
162
|
-
var document = this._getTextDocument(uri);
|
|
163
|
-
var formatted = this._languageService.doRangeFormat(document, range);
|
|
164
|
-
return formatted;
|
|
165
|
-
};
|
|
166
|
-
KustoWorker.prototype.doFolding = function (uri) {
|
|
167
|
-
var document = this._getTextDocument(uri);
|
|
168
|
-
var folding = this._languageService.doFolding(document);
|
|
169
|
-
return folding;
|
|
170
|
-
};
|
|
171
|
-
KustoWorker.prototype.doDocumentFormat = function (uri) {
|
|
172
|
-
var document = this._getTextDocument(uri);
|
|
173
|
-
var formatted = this._languageService.doDocumentFormat(document);
|
|
174
|
-
return formatted;
|
|
175
|
-
};
|
|
176
|
-
KustoWorker.prototype.doCurrentCommandFormat = function (uri, caretPosition) {
|
|
177
|
-
var document = this._getTextDocument(uri);
|
|
178
|
-
var formatted = this._languageService.doCurrentCommandFormat(document, caretPosition);
|
|
179
|
-
return formatted;
|
|
180
|
-
};
|
|
181
|
-
// Colorize document. if offsets provided, will only colorize commands at these offsets. otherwise - will color the entire document.
|
|
182
|
-
KustoWorker.prototype.doColorization = function (uri, colorizationIntervals) {
|
|
183
|
-
var document = this._getTextDocument(uri);
|
|
184
|
-
var colorizationInfo = this._languageService.doColorization(document, colorizationIntervals);
|
|
185
|
-
return colorizationInfo;
|
|
186
|
-
};
|
|
187
|
-
KustoWorker.prototype.getClientDirective = function (text) {
|
|
188
|
-
return this._languageService.getClientDirective(text);
|
|
189
|
-
};
|
|
190
|
-
KustoWorker.prototype.getAdminCommand = function (text) {
|
|
191
|
-
return this._languageService.getAdminCommand(text);
|
|
192
|
-
};
|
|
193
|
-
KustoWorker.prototype.findDefinition = function (uri, position) {
|
|
194
|
-
var document = this._getTextDocument(uri);
|
|
195
|
-
var definition = this._languageService.findDefinition(document, position);
|
|
196
|
-
return definition;
|
|
197
|
-
};
|
|
198
|
-
KustoWorker.prototype.findReferences = function (uri, position) {
|
|
199
|
-
var document = this._getTextDocument(uri);
|
|
200
|
-
var references = this._languageService.findReferences(document, position);
|
|
201
|
-
return references;
|
|
202
|
-
};
|
|
203
|
-
KustoWorker.prototype.doRename = function (uri, position, newName) {
|
|
204
|
-
var document = this._getTextDocument(uri);
|
|
205
|
-
var workspaceEdit = this._languageService.doRename(document, position, newName);
|
|
206
|
-
return workspaceEdit;
|
|
207
|
-
};
|
|
208
|
-
KustoWorker.prototype.doHover = function (uri, position) {
|
|
209
|
-
var document = this._getTextDocument(uri);
|
|
210
|
-
var hover = this._languageService.doHover(document, position);
|
|
211
|
-
return hover;
|
|
212
|
-
};
|
|
213
|
-
KustoWorker.prototype.setParameters = function (scalarParameters, tabularParameters) {
|
|
214
|
-
return this._languageService.setParameters(scalarParameters, tabularParameters);
|
|
215
|
-
};
|
|
216
|
-
KustoWorker.prototype.getClusterReferences = function (uri, cursorOffset) {
|
|
217
|
-
var document = this._getTextDocument(uri);
|
|
218
|
-
if (!document) {
|
|
219
|
-
return Promise.resolve(null);
|
|
220
|
-
}
|
|
221
|
-
return this._languageService.getClusterReferences(document, cursorOffset);
|
|
222
|
-
};
|
|
223
|
-
KustoWorker.prototype.getDatabaseReferences = function (uri, cursorOffset) {
|
|
224
|
-
var document = this._getTextDocument(uri);
|
|
225
|
-
if (!document) {
|
|
226
|
-
return Promise.resolve(null);
|
|
227
|
-
}
|
|
228
|
-
return this._languageService.getDatabaseReferences(document, cursorOffset);
|
|
229
|
-
};
|
|
230
|
-
KustoWorker.prototype._getTextDocument = function (uri) {
|
|
231
|
-
var models = this._ctx.getMirrorModels();
|
|
232
|
-
for (var _i = 0, models_1 = models; _i < models_1.length; _i++) {
|
|
233
|
-
var model = models_1[_i];
|
|
234
|
-
if (model.uri.toString() === uri) {
|
|
235
|
-
return ls.TextDocument.create(uri, this._languageId, model.version, model.getValue());
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
return null;
|
|
239
|
-
};
|
|
240
|
-
return KustoWorker;
|
|
241
|
-
}());
|
|
242
|
-
export { KustoWorker };
|
|
243
|
-
export function create(ctx, createData) {
|
|
244
|
-
return new KustoWorker(ctx, createData);
|
|
245
|
-
}
|