@easyv/biz-components 0.0.52-beta.0 → 0.0.52-beta.2
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/dist/components/easyv-monaco-editor/easyv-monaco-editor.d.ts +12 -0
- package/dist/components/easyv-monaco-editor/easyv-monaco-editor.es.js +15 -2
- package/dist/components/easyv-monaco-editor/easyv-monaco-editor.es.js.map +1 -1
- package/dist/components/easyv-monaco-editor/monaco-setup.es.js +6 -5
- package/dist/components/easyv-monaco-editor/monaco-setup.es.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/stats.html +4949 -0
- package/package.json +3 -2
- package/dist/node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.es.js +0 -70
- package/dist/node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/basic-languages/_.contribution.es.js.map +0 -1
- package/dist/node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution.es.js +0 -21
- package/dist/node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution.es.js.map +0 -1
- package/dist/node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/basic-languages/javascript/javascript.es.js +0 -78
- package/dist/node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/basic-languages/javascript/javascript.es.js.map +0 -1
- package/dist/node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/basic-languages/typescript/typescript.es.js +0 -273
- package/dist/node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/basic-languages/typescript/typescript.es.js.map +0 -1
- package/dist/node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/language/json/jsonMode.es.js +0 -2758
- package/dist/node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/language/json/jsonMode.es.js.map +0 -1
- package/dist/node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/language/json/monaco.contribution.es.js +0 -98
- package/dist/node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/language/json/monaco.contribution.es.js.map +0 -1
- package/dist/node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/language/typescript/monaco.contribution.es.js +0 -287
- package/dist/node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/language/typescript/monaco.contribution.es.js.map +0 -1
- package/dist/node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/language/typescript/tsMode.es.js +0 -1244
- package/dist/node_modules/.pnpm/monaco-editor@0.52.2/node_modules/monaco-editor/esm/vs/language/typescript/tsMode.es.js.map +0 -1
|
@@ -1,2758 +0,0 @@
|
|
|
1
|
-
import * as editor_api from "../../editor/editor.api.es.js";
|
|
2
|
-
/*!-----------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
-
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
|
|
5
|
-
* Released under the MIT license
|
|
6
|
-
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
|
7
|
-
*-----------------------------------------------------------------------------*/
|
|
8
|
-
var __defProp = Object.defineProperty;
|
|
9
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget);
|
|
21
|
-
var monaco_editor_core_exports = {};
|
|
22
|
-
__reExport(monaco_editor_core_exports, editor_api);
|
|
23
|
-
var STOP_WHEN_IDLE_FOR = 2 * 60 * 1e3;
|
|
24
|
-
var WorkerManager = class {
|
|
25
|
-
constructor(defaults) {
|
|
26
|
-
this._defaults = defaults;
|
|
27
|
-
this._worker = null;
|
|
28
|
-
this._client = null;
|
|
29
|
-
this._idleCheckInterval = window.setInterval(() => this._checkIfIdle(), 30 * 1e3);
|
|
30
|
-
this._lastUsedTime = 0;
|
|
31
|
-
this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker());
|
|
32
|
-
}
|
|
33
|
-
_stopWorker() {
|
|
34
|
-
if (this._worker) {
|
|
35
|
-
this._worker.dispose();
|
|
36
|
-
this._worker = null;
|
|
37
|
-
}
|
|
38
|
-
this._client = null;
|
|
39
|
-
}
|
|
40
|
-
dispose() {
|
|
41
|
-
clearInterval(this._idleCheckInterval);
|
|
42
|
-
this._configChangeListener.dispose();
|
|
43
|
-
this._stopWorker();
|
|
44
|
-
}
|
|
45
|
-
_checkIfIdle() {
|
|
46
|
-
if (!this._worker) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
let timePassedSinceLastUsed = Date.now() - this._lastUsedTime;
|
|
50
|
-
if (timePassedSinceLastUsed > STOP_WHEN_IDLE_FOR) {
|
|
51
|
-
this._stopWorker();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
_getClient() {
|
|
55
|
-
this._lastUsedTime = Date.now();
|
|
56
|
-
if (!this._client) {
|
|
57
|
-
this._worker = monaco_editor_core_exports.editor.createWebWorker({
|
|
58
|
-
// module that exports the create() method and returns a `JSONWorker` instance
|
|
59
|
-
moduleId: "vs/language/json/jsonWorker",
|
|
60
|
-
label: this._defaults.languageId,
|
|
61
|
-
// passed in to the create() method
|
|
62
|
-
createData: {
|
|
63
|
-
languageSettings: this._defaults.diagnosticsOptions,
|
|
64
|
-
languageId: this._defaults.languageId,
|
|
65
|
-
enableSchemaRequest: this._defaults.diagnosticsOptions.enableSchemaRequest
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
this._client = this._worker.getProxy();
|
|
69
|
-
}
|
|
70
|
-
return this._client;
|
|
71
|
-
}
|
|
72
|
-
getLanguageServiceWorker(...resources) {
|
|
73
|
-
let _client;
|
|
74
|
-
return this._getClient().then((client) => {
|
|
75
|
-
_client = client;
|
|
76
|
-
}).then((_) => {
|
|
77
|
-
if (this._worker) {
|
|
78
|
-
return this._worker.withSyncedResources(resources);
|
|
79
|
-
}
|
|
80
|
-
}).then((_) => _client);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
var DocumentUri;
|
|
84
|
-
(function(DocumentUri2) {
|
|
85
|
-
function is(value) {
|
|
86
|
-
return typeof value === "string";
|
|
87
|
-
}
|
|
88
|
-
DocumentUri2.is = is;
|
|
89
|
-
})(DocumentUri || (DocumentUri = {}));
|
|
90
|
-
var URI;
|
|
91
|
-
(function(URI2) {
|
|
92
|
-
function is(value) {
|
|
93
|
-
return typeof value === "string";
|
|
94
|
-
}
|
|
95
|
-
URI2.is = is;
|
|
96
|
-
})(URI || (URI = {}));
|
|
97
|
-
var integer;
|
|
98
|
-
(function(integer2) {
|
|
99
|
-
integer2.MIN_VALUE = -2147483648;
|
|
100
|
-
integer2.MAX_VALUE = 2147483647;
|
|
101
|
-
function is(value) {
|
|
102
|
-
return typeof value === "number" && integer2.MIN_VALUE <= value && value <= integer2.MAX_VALUE;
|
|
103
|
-
}
|
|
104
|
-
integer2.is = is;
|
|
105
|
-
})(integer || (integer = {}));
|
|
106
|
-
var uinteger;
|
|
107
|
-
(function(uinteger2) {
|
|
108
|
-
uinteger2.MIN_VALUE = 0;
|
|
109
|
-
uinteger2.MAX_VALUE = 2147483647;
|
|
110
|
-
function is(value) {
|
|
111
|
-
return typeof value === "number" && uinteger2.MIN_VALUE <= value && value <= uinteger2.MAX_VALUE;
|
|
112
|
-
}
|
|
113
|
-
uinteger2.is = is;
|
|
114
|
-
})(uinteger || (uinteger = {}));
|
|
115
|
-
var Position;
|
|
116
|
-
(function(Position3) {
|
|
117
|
-
function create(line, character) {
|
|
118
|
-
if (line === Number.MAX_VALUE) {
|
|
119
|
-
line = uinteger.MAX_VALUE;
|
|
120
|
-
}
|
|
121
|
-
if (character === Number.MAX_VALUE) {
|
|
122
|
-
character = uinteger.MAX_VALUE;
|
|
123
|
-
}
|
|
124
|
-
return { line, character };
|
|
125
|
-
}
|
|
126
|
-
Position3.create = create;
|
|
127
|
-
function is(value) {
|
|
128
|
-
let candidate = value;
|
|
129
|
-
return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
|
|
130
|
-
}
|
|
131
|
-
Position3.is = is;
|
|
132
|
-
})(Position || (Position = {}));
|
|
133
|
-
var Range;
|
|
134
|
-
(function(Range3) {
|
|
135
|
-
function create(one, two, three, four) {
|
|
136
|
-
if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
|
|
137
|
-
return { start: Position.create(one, two), end: Position.create(three, four) };
|
|
138
|
-
} else if (Position.is(one) && Position.is(two)) {
|
|
139
|
-
return { start: one, end: two };
|
|
140
|
-
} else {
|
|
141
|
-
throw new Error(`Range#create called with invalid arguments[${one}, ${two}, ${three}, ${four}]`);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
Range3.create = create;
|
|
145
|
-
function is(value) {
|
|
146
|
-
let candidate = value;
|
|
147
|
-
return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
|
|
148
|
-
}
|
|
149
|
-
Range3.is = is;
|
|
150
|
-
})(Range || (Range = {}));
|
|
151
|
-
var Location;
|
|
152
|
-
(function(Location2) {
|
|
153
|
-
function create(uri, range) {
|
|
154
|
-
return { uri, range };
|
|
155
|
-
}
|
|
156
|
-
Location2.create = create;
|
|
157
|
-
function is(value) {
|
|
158
|
-
let candidate = value;
|
|
159
|
-
return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
|
|
160
|
-
}
|
|
161
|
-
Location2.is = is;
|
|
162
|
-
})(Location || (Location = {}));
|
|
163
|
-
var LocationLink;
|
|
164
|
-
(function(LocationLink2) {
|
|
165
|
-
function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
|
|
166
|
-
return { targetUri, targetRange, targetSelectionRange, originSelectionRange };
|
|
167
|
-
}
|
|
168
|
-
LocationLink2.create = create;
|
|
169
|
-
function is(value) {
|
|
170
|
-
let candidate = value;
|
|
171
|
-
return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
|
|
172
|
-
}
|
|
173
|
-
LocationLink2.is = is;
|
|
174
|
-
})(LocationLink || (LocationLink = {}));
|
|
175
|
-
var Color;
|
|
176
|
-
(function(Color2) {
|
|
177
|
-
function create(red, green, blue, alpha) {
|
|
178
|
-
return {
|
|
179
|
-
red,
|
|
180
|
-
green,
|
|
181
|
-
blue,
|
|
182
|
-
alpha
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
Color2.create = create;
|
|
186
|
-
function is(value) {
|
|
187
|
-
const candidate = value;
|
|
188
|
-
return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1) && Is.numberRange(candidate.green, 0, 1) && Is.numberRange(candidate.blue, 0, 1) && Is.numberRange(candidate.alpha, 0, 1);
|
|
189
|
-
}
|
|
190
|
-
Color2.is = is;
|
|
191
|
-
})(Color || (Color = {}));
|
|
192
|
-
var ColorInformation;
|
|
193
|
-
(function(ColorInformation2) {
|
|
194
|
-
function create(range, color) {
|
|
195
|
-
return {
|
|
196
|
-
range,
|
|
197
|
-
color
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
ColorInformation2.create = create;
|
|
201
|
-
function is(value) {
|
|
202
|
-
const candidate = value;
|
|
203
|
-
return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);
|
|
204
|
-
}
|
|
205
|
-
ColorInformation2.is = is;
|
|
206
|
-
})(ColorInformation || (ColorInformation = {}));
|
|
207
|
-
var ColorPresentation;
|
|
208
|
-
(function(ColorPresentation2) {
|
|
209
|
-
function create(label, textEdit, additionalTextEdits) {
|
|
210
|
-
return {
|
|
211
|
-
label,
|
|
212
|
-
textEdit,
|
|
213
|
-
additionalTextEdits
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
ColorPresentation2.create = create;
|
|
217
|
-
function is(value) {
|
|
218
|
-
const candidate = value;
|
|
219
|
-
return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
|
|
220
|
-
}
|
|
221
|
-
ColorPresentation2.is = is;
|
|
222
|
-
})(ColorPresentation || (ColorPresentation = {}));
|
|
223
|
-
var FoldingRangeKind;
|
|
224
|
-
(function(FoldingRangeKind2) {
|
|
225
|
-
FoldingRangeKind2.Comment = "comment";
|
|
226
|
-
FoldingRangeKind2.Imports = "imports";
|
|
227
|
-
FoldingRangeKind2.Region = "region";
|
|
228
|
-
})(FoldingRangeKind || (FoldingRangeKind = {}));
|
|
229
|
-
var FoldingRange;
|
|
230
|
-
(function(FoldingRange2) {
|
|
231
|
-
function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {
|
|
232
|
-
const result = {
|
|
233
|
-
startLine,
|
|
234
|
-
endLine
|
|
235
|
-
};
|
|
236
|
-
if (Is.defined(startCharacter)) {
|
|
237
|
-
result.startCharacter = startCharacter;
|
|
238
|
-
}
|
|
239
|
-
if (Is.defined(endCharacter)) {
|
|
240
|
-
result.endCharacter = endCharacter;
|
|
241
|
-
}
|
|
242
|
-
if (Is.defined(kind)) {
|
|
243
|
-
result.kind = kind;
|
|
244
|
-
}
|
|
245
|
-
if (Is.defined(collapsedText)) {
|
|
246
|
-
result.collapsedText = collapsedText;
|
|
247
|
-
}
|
|
248
|
-
return result;
|
|
249
|
-
}
|
|
250
|
-
FoldingRange2.create = create;
|
|
251
|
-
function is(value) {
|
|
252
|
-
const candidate = value;
|
|
253
|
-
return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine) && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter)) && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter)) && (Is.undefined(candidate.kind) || Is.string(candidate.kind));
|
|
254
|
-
}
|
|
255
|
-
FoldingRange2.is = is;
|
|
256
|
-
})(FoldingRange || (FoldingRange = {}));
|
|
257
|
-
var DiagnosticRelatedInformation;
|
|
258
|
-
(function(DiagnosticRelatedInformation2) {
|
|
259
|
-
function create(location, message) {
|
|
260
|
-
return {
|
|
261
|
-
location,
|
|
262
|
-
message
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
DiagnosticRelatedInformation2.create = create;
|
|
266
|
-
function is(value) {
|
|
267
|
-
let candidate = value;
|
|
268
|
-
return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
|
|
269
|
-
}
|
|
270
|
-
DiagnosticRelatedInformation2.is = is;
|
|
271
|
-
})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));
|
|
272
|
-
var DiagnosticSeverity;
|
|
273
|
-
(function(DiagnosticSeverity2) {
|
|
274
|
-
DiagnosticSeverity2.Error = 1;
|
|
275
|
-
DiagnosticSeverity2.Warning = 2;
|
|
276
|
-
DiagnosticSeverity2.Information = 3;
|
|
277
|
-
DiagnosticSeverity2.Hint = 4;
|
|
278
|
-
})(DiagnosticSeverity || (DiagnosticSeverity = {}));
|
|
279
|
-
var DiagnosticTag;
|
|
280
|
-
(function(DiagnosticTag2) {
|
|
281
|
-
DiagnosticTag2.Unnecessary = 1;
|
|
282
|
-
DiagnosticTag2.Deprecated = 2;
|
|
283
|
-
})(DiagnosticTag || (DiagnosticTag = {}));
|
|
284
|
-
var CodeDescription;
|
|
285
|
-
(function(CodeDescription2) {
|
|
286
|
-
function is(value) {
|
|
287
|
-
const candidate = value;
|
|
288
|
-
return Is.objectLiteral(candidate) && Is.string(candidate.href);
|
|
289
|
-
}
|
|
290
|
-
CodeDescription2.is = is;
|
|
291
|
-
})(CodeDescription || (CodeDescription = {}));
|
|
292
|
-
var Diagnostic;
|
|
293
|
-
(function(Diagnostic2) {
|
|
294
|
-
function create(range, message, severity, code, source, relatedInformation) {
|
|
295
|
-
let result = { range, message };
|
|
296
|
-
if (Is.defined(severity)) {
|
|
297
|
-
result.severity = severity;
|
|
298
|
-
}
|
|
299
|
-
if (Is.defined(code)) {
|
|
300
|
-
result.code = code;
|
|
301
|
-
}
|
|
302
|
-
if (Is.defined(source)) {
|
|
303
|
-
result.source = source;
|
|
304
|
-
}
|
|
305
|
-
if (Is.defined(relatedInformation)) {
|
|
306
|
-
result.relatedInformation = relatedInformation;
|
|
307
|
-
}
|
|
308
|
-
return result;
|
|
309
|
-
}
|
|
310
|
-
Diagnostic2.create = create;
|
|
311
|
-
function is(value) {
|
|
312
|
-
var _a;
|
|
313
|
-
let candidate = value;
|
|
314
|
-
return Is.defined(candidate) && Range.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
|
|
315
|
-
}
|
|
316
|
-
Diagnostic2.is = is;
|
|
317
|
-
})(Diagnostic || (Diagnostic = {}));
|
|
318
|
-
var Command;
|
|
319
|
-
(function(Command2) {
|
|
320
|
-
function create(title, command, ...args) {
|
|
321
|
-
let result = { title, command };
|
|
322
|
-
if (Is.defined(args) && args.length > 0) {
|
|
323
|
-
result.arguments = args;
|
|
324
|
-
}
|
|
325
|
-
return result;
|
|
326
|
-
}
|
|
327
|
-
Command2.create = create;
|
|
328
|
-
function is(value) {
|
|
329
|
-
let candidate = value;
|
|
330
|
-
return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
|
|
331
|
-
}
|
|
332
|
-
Command2.is = is;
|
|
333
|
-
})(Command || (Command = {}));
|
|
334
|
-
var TextEdit;
|
|
335
|
-
(function(TextEdit2) {
|
|
336
|
-
function replace(range, newText) {
|
|
337
|
-
return { range, newText };
|
|
338
|
-
}
|
|
339
|
-
TextEdit2.replace = replace;
|
|
340
|
-
function insert(position, newText) {
|
|
341
|
-
return { range: { start: position, end: position }, newText };
|
|
342
|
-
}
|
|
343
|
-
TextEdit2.insert = insert;
|
|
344
|
-
function del(range) {
|
|
345
|
-
return { range, newText: "" };
|
|
346
|
-
}
|
|
347
|
-
TextEdit2.del = del;
|
|
348
|
-
function is(value) {
|
|
349
|
-
const candidate = value;
|
|
350
|
-
return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range);
|
|
351
|
-
}
|
|
352
|
-
TextEdit2.is = is;
|
|
353
|
-
})(TextEdit || (TextEdit = {}));
|
|
354
|
-
var ChangeAnnotation;
|
|
355
|
-
(function(ChangeAnnotation2) {
|
|
356
|
-
function create(label, needsConfirmation, description) {
|
|
357
|
-
const result = { label };
|
|
358
|
-
if (needsConfirmation !== void 0) {
|
|
359
|
-
result.needsConfirmation = needsConfirmation;
|
|
360
|
-
}
|
|
361
|
-
if (description !== void 0) {
|
|
362
|
-
result.description = description;
|
|
363
|
-
}
|
|
364
|
-
return result;
|
|
365
|
-
}
|
|
366
|
-
ChangeAnnotation2.create = create;
|
|
367
|
-
function is(value) {
|
|
368
|
-
const candidate = value;
|
|
369
|
-
return Is.objectLiteral(candidate) && Is.string(candidate.label) && (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
|
|
370
|
-
}
|
|
371
|
-
ChangeAnnotation2.is = is;
|
|
372
|
-
})(ChangeAnnotation || (ChangeAnnotation = {}));
|
|
373
|
-
var ChangeAnnotationIdentifier;
|
|
374
|
-
(function(ChangeAnnotationIdentifier2) {
|
|
375
|
-
function is(value) {
|
|
376
|
-
const candidate = value;
|
|
377
|
-
return Is.string(candidate);
|
|
378
|
-
}
|
|
379
|
-
ChangeAnnotationIdentifier2.is = is;
|
|
380
|
-
})(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));
|
|
381
|
-
var AnnotatedTextEdit;
|
|
382
|
-
(function(AnnotatedTextEdit2) {
|
|
383
|
-
function replace(range, newText, annotation) {
|
|
384
|
-
return { range, newText, annotationId: annotation };
|
|
385
|
-
}
|
|
386
|
-
AnnotatedTextEdit2.replace = replace;
|
|
387
|
-
function insert(position, newText, annotation) {
|
|
388
|
-
return { range: { start: position, end: position }, newText, annotationId: annotation };
|
|
389
|
-
}
|
|
390
|
-
AnnotatedTextEdit2.insert = insert;
|
|
391
|
-
function del(range, annotation) {
|
|
392
|
-
return { range, newText: "", annotationId: annotation };
|
|
393
|
-
}
|
|
394
|
-
AnnotatedTextEdit2.del = del;
|
|
395
|
-
function is(value) {
|
|
396
|
-
const candidate = value;
|
|
397
|
-
return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
398
|
-
}
|
|
399
|
-
AnnotatedTextEdit2.is = is;
|
|
400
|
-
})(AnnotatedTextEdit || (AnnotatedTextEdit = {}));
|
|
401
|
-
var TextDocumentEdit;
|
|
402
|
-
(function(TextDocumentEdit2) {
|
|
403
|
-
function create(textDocument, edits) {
|
|
404
|
-
return { textDocument, edits };
|
|
405
|
-
}
|
|
406
|
-
TextDocumentEdit2.create = create;
|
|
407
|
-
function is(value) {
|
|
408
|
-
let candidate = value;
|
|
409
|
-
return Is.defined(candidate) && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument) && Array.isArray(candidate.edits);
|
|
410
|
-
}
|
|
411
|
-
TextDocumentEdit2.is = is;
|
|
412
|
-
})(TextDocumentEdit || (TextDocumentEdit = {}));
|
|
413
|
-
var CreateFile;
|
|
414
|
-
(function(CreateFile2) {
|
|
415
|
-
function create(uri, options, annotation) {
|
|
416
|
-
let result = {
|
|
417
|
-
kind: "create",
|
|
418
|
-
uri
|
|
419
|
-
};
|
|
420
|
-
if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
|
|
421
|
-
result.options = options;
|
|
422
|
-
}
|
|
423
|
-
if (annotation !== void 0) {
|
|
424
|
-
result.annotationId = annotation;
|
|
425
|
-
}
|
|
426
|
-
return result;
|
|
427
|
-
}
|
|
428
|
-
CreateFile2.create = create;
|
|
429
|
-
function is(value) {
|
|
430
|
-
let candidate = value;
|
|
431
|
-
return candidate && candidate.kind === "create" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
432
|
-
}
|
|
433
|
-
CreateFile2.is = is;
|
|
434
|
-
})(CreateFile || (CreateFile = {}));
|
|
435
|
-
var RenameFile;
|
|
436
|
-
(function(RenameFile2) {
|
|
437
|
-
function create(oldUri, newUri, options, annotation) {
|
|
438
|
-
let result = {
|
|
439
|
-
kind: "rename",
|
|
440
|
-
oldUri,
|
|
441
|
-
newUri
|
|
442
|
-
};
|
|
443
|
-
if (options !== void 0 && (options.overwrite !== void 0 || options.ignoreIfExists !== void 0)) {
|
|
444
|
-
result.options = options;
|
|
445
|
-
}
|
|
446
|
-
if (annotation !== void 0) {
|
|
447
|
-
result.annotationId = annotation;
|
|
448
|
-
}
|
|
449
|
-
return result;
|
|
450
|
-
}
|
|
451
|
-
RenameFile2.create = create;
|
|
452
|
-
function is(value) {
|
|
453
|
-
let candidate = value;
|
|
454
|
-
return candidate && candidate.kind === "rename" && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === void 0 || (candidate.options.overwrite === void 0 || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === void 0 || Is.boolean(candidate.options.ignoreIfExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
455
|
-
}
|
|
456
|
-
RenameFile2.is = is;
|
|
457
|
-
})(RenameFile || (RenameFile = {}));
|
|
458
|
-
var DeleteFile;
|
|
459
|
-
(function(DeleteFile2) {
|
|
460
|
-
function create(uri, options, annotation) {
|
|
461
|
-
let result = {
|
|
462
|
-
kind: "delete",
|
|
463
|
-
uri
|
|
464
|
-
};
|
|
465
|
-
if (options !== void 0 && (options.recursive !== void 0 || options.ignoreIfNotExists !== void 0)) {
|
|
466
|
-
result.options = options;
|
|
467
|
-
}
|
|
468
|
-
if (annotation !== void 0) {
|
|
469
|
-
result.annotationId = annotation;
|
|
470
|
-
}
|
|
471
|
-
return result;
|
|
472
|
-
}
|
|
473
|
-
DeleteFile2.create = create;
|
|
474
|
-
function is(value) {
|
|
475
|
-
let candidate = value;
|
|
476
|
-
return candidate && candidate.kind === "delete" && Is.string(candidate.uri) && (candidate.options === void 0 || (candidate.options.recursive === void 0 || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === void 0 || Is.boolean(candidate.options.ignoreIfNotExists))) && (candidate.annotationId === void 0 || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
477
|
-
}
|
|
478
|
-
DeleteFile2.is = is;
|
|
479
|
-
})(DeleteFile || (DeleteFile = {}));
|
|
480
|
-
var WorkspaceEdit;
|
|
481
|
-
(function(WorkspaceEdit2) {
|
|
482
|
-
function is(value) {
|
|
483
|
-
let candidate = value;
|
|
484
|
-
return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every((change) => {
|
|
485
|
-
if (Is.string(change.kind)) {
|
|
486
|
-
return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
|
|
487
|
-
} else {
|
|
488
|
-
return TextDocumentEdit.is(change);
|
|
489
|
-
}
|
|
490
|
-
}));
|
|
491
|
-
}
|
|
492
|
-
WorkspaceEdit2.is = is;
|
|
493
|
-
})(WorkspaceEdit || (WorkspaceEdit = {}));
|
|
494
|
-
var TextDocumentIdentifier;
|
|
495
|
-
(function(TextDocumentIdentifier2) {
|
|
496
|
-
function create(uri) {
|
|
497
|
-
return { uri };
|
|
498
|
-
}
|
|
499
|
-
TextDocumentIdentifier2.create = create;
|
|
500
|
-
function is(value) {
|
|
501
|
-
let candidate = value;
|
|
502
|
-
return Is.defined(candidate) && Is.string(candidate.uri);
|
|
503
|
-
}
|
|
504
|
-
TextDocumentIdentifier2.is = is;
|
|
505
|
-
})(TextDocumentIdentifier || (TextDocumentIdentifier = {}));
|
|
506
|
-
var VersionedTextDocumentIdentifier;
|
|
507
|
-
(function(VersionedTextDocumentIdentifier2) {
|
|
508
|
-
function create(uri, version) {
|
|
509
|
-
return { uri, version };
|
|
510
|
-
}
|
|
511
|
-
VersionedTextDocumentIdentifier2.create = create;
|
|
512
|
-
function is(value) {
|
|
513
|
-
let candidate = value;
|
|
514
|
-
return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
|
|
515
|
-
}
|
|
516
|
-
VersionedTextDocumentIdentifier2.is = is;
|
|
517
|
-
})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));
|
|
518
|
-
var OptionalVersionedTextDocumentIdentifier;
|
|
519
|
-
(function(OptionalVersionedTextDocumentIdentifier2) {
|
|
520
|
-
function create(uri, version) {
|
|
521
|
-
return { uri, version };
|
|
522
|
-
}
|
|
523
|
-
OptionalVersionedTextDocumentIdentifier2.create = create;
|
|
524
|
-
function is(value) {
|
|
525
|
-
let candidate = value;
|
|
526
|
-
return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
|
|
527
|
-
}
|
|
528
|
-
OptionalVersionedTextDocumentIdentifier2.is = is;
|
|
529
|
-
})(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));
|
|
530
|
-
var TextDocumentItem;
|
|
531
|
-
(function(TextDocumentItem2) {
|
|
532
|
-
function create(uri, languageId, version, text) {
|
|
533
|
-
return { uri, languageId, version, text };
|
|
534
|
-
}
|
|
535
|
-
TextDocumentItem2.create = create;
|
|
536
|
-
function is(value) {
|
|
537
|
-
let candidate = value;
|
|
538
|
-
return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
|
|
539
|
-
}
|
|
540
|
-
TextDocumentItem2.is = is;
|
|
541
|
-
})(TextDocumentItem || (TextDocumentItem = {}));
|
|
542
|
-
var MarkupKind;
|
|
543
|
-
(function(MarkupKind2) {
|
|
544
|
-
MarkupKind2.PlainText = "plaintext";
|
|
545
|
-
MarkupKind2.Markdown = "markdown";
|
|
546
|
-
function is(value) {
|
|
547
|
-
const candidate = value;
|
|
548
|
-
return candidate === MarkupKind2.PlainText || candidate === MarkupKind2.Markdown;
|
|
549
|
-
}
|
|
550
|
-
MarkupKind2.is = is;
|
|
551
|
-
})(MarkupKind || (MarkupKind = {}));
|
|
552
|
-
var MarkupContent;
|
|
553
|
-
(function(MarkupContent2) {
|
|
554
|
-
function is(value) {
|
|
555
|
-
const candidate = value;
|
|
556
|
-
return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
|
|
557
|
-
}
|
|
558
|
-
MarkupContent2.is = is;
|
|
559
|
-
})(MarkupContent || (MarkupContent = {}));
|
|
560
|
-
var CompletionItemKind;
|
|
561
|
-
(function(CompletionItemKind2) {
|
|
562
|
-
CompletionItemKind2.Text = 1;
|
|
563
|
-
CompletionItemKind2.Method = 2;
|
|
564
|
-
CompletionItemKind2.Function = 3;
|
|
565
|
-
CompletionItemKind2.Constructor = 4;
|
|
566
|
-
CompletionItemKind2.Field = 5;
|
|
567
|
-
CompletionItemKind2.Variable = 6;
|
|
568
|
-
CompletionItemKind2.Class = 7;
|
|
569
|
-
CompletionItemKind2.Interface = 8;
|
|
570
|
-
CompletionItemKind2.Module = 9;
|
|
571
|
-
CompletionItemKind2.Property = 10;
|
|
572
|
-
CompletionItemKind2.Unit = 11;
|
|
573
|
-
CompletionItemKind2.Value = 12;
|
|
574
|
-
CompletionItemKind2.Enum = 13;
|
|
575
|
-
CompletionItemKind2.Keyword = 14;
|
|
576
|
-
CompletionItemKind2.Snippet = 15;
|
|
577
|
-
CompletionItemKind2.Color = 16;
|
|
578
|
-
CompletionItemKind2.File = 17;
|
|
579
|
-
CompletionItemKind2.Reference = 18;
|
|
580
|
-
CompletionItemKind2.Folder = 19;
|
|
581
|
-
CompletionItemKind2.EnumMember = 20;
|
|
582
|
-
CompletionItemKind2.Constant = 21;
|
|
583
|
-
CompletionItemKind2.Struct = 22;
|
|
584
|
-
CompletionItemKind2.Event = 23;
|
|
585
|
-
CompletionItemKind2.Operator = 24;
|
|
586
|
-
CompletionItemKind2.TypeParameter = 25;
|
|
587
|
-
})(CompletionItemKind || (CompletionItemKind = {}));
|
|
588
|
-
var InsertTextFormat;
|
|
589
|
-
(function(InsertTextFormat2) {
|
|
590
|
-
InsertTextFormat2.PlainText = 1;
|
|
591
|
-
InsertTextFormat2.Snippet = 2;
|
|
592
|
-
})(InsertTextFormat || (InsertTextFormat = {}));
|
|
593
|
-
var CompletionItemTag;
|
|
594
|
-
(function(CompletionItemTag2) {
|
|
595
|
-
CompletionItemTag2.Deprecated = 1;
|
|
596
|
-
})(CompletionItemTag || (CompletionItemTag = {}));
|
|
597
|
-
var InsertReplaceEdit;
|
|
598
|
-
(function(InsertReplaceEdit2) {
|
|
599
|
-
function create(newText, insert, replace) {
|
|
600
|
-
return { newText, insert, replace };
|
|
601
|
-
}
|
|
602
|
-
InsertReplaceEdit2.create = create;
|
|
603
|
-
function is(value) {
|
|
604
|
-
const candidate = value;
|
|
605
|
-
return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
|
|
606
|
-
}
|
|
607
|
-
InsertReplaceEdit2.is = is;
|
|
608
|
-
})(InsertReplaceEdit || (InsertReplaceEdit = {}));
|
|
609
|
-
var InsertTextMode;
|
|
610
|
-
(function(InsertTextMode2) {
|
|
611
|
-
InsertTextMode2.asIs = 1;
|
|
612
|
-
InsertTextMode2.adjustIndentation = 2;
|
|
613
|
-
})(InsertTextMode || (InsertTextMode = {}));
|
|
614
|
-
var CompletionItemLabelDetails;
|
|
615
|
-
(function(CompletionItemLabelDetails2) {
|
|
616
|
-
function is(value) {
|
|
617
|
-
const candidate = value;
|
|
618
|
-
return candidate && (Is.string(candidate.detail) || candidate.detail === void 0) && (Is.string(candidate.description) || candidate.description === void 0);
|
|
619
|
-
}
|
|
620
|
-
CompletionItemLabelDetails2.is = is;
|
|
621
|
-
})(CompletionItemLabelDetails || (CompletionItemLabelDetails = {}));
|
|
622
|
-
var CompletionItem;
|
|
623
|
-
(function(CompletionItem2) {
|
|
624
|
-
function create(label) {
|
|
625
|
-
return { label };
|
|
626
|
-
}
|
|
627
|
-
CompletionItem2.create = create;
|
|
628
|
-
})(CompletionItem || (CompletionItem = {}));
|
|
629
|
-
var CompletionList;
|
|
630
|
-
(function(CompletionList2) {
|
|
631
|
-
function create(items, isIncomplete) {
|
|
632
|
-
return { items: items ? items : [], isIncomplete: !!isIncomplete };
|
|
633
|
-
}
|
|
634
|
-
CompletionList2.create = create;
|
|
635
|
-
})(CompletionList || (CompletionList = {}));
|
|
636
|
-
var MarkedString;
|
|
637
|
-
(function(MarkedString2) {
|
|
638
|
-
function fromPlainText(plainText) {
|
|
639
|
-
return plainText.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
|
|
640
|
-
}
|
|
641
|
-
MarkedString2.fromPlainText = fromPlainText;
|
|
642
|
-
function is(value) {
|
|
643
|
-
const candidate = value;
|
|
644
|
-
return Is.string(candidate) || Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value);
|
|
645
|
-
}
|
|
646
|
-
MarkedString2.is = is;
|
|
647
|
-
})(MarkedString || (MarkedString = {}));
|
|
648
|
-
var Hover;
|
|
649
|
-
(function(Hover2) {
|
|
650
|
-
function is(value) {
|
|
651
|
-
let candidate = value;
|
|
652
|
-
return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range.is(value.range));
|
|
653
|
-
}
|
|
654
|
-
Hover2.is = is;
|
|
655
|
-
})(Hover || (Hover = {}));
|
|
656
|
-
var ParameterInformation;
|
|
657
|
-
(function(ParameterInformation2) {
|
|
658
|
-
function create(label, documentation) {
|
|
659
|
-
return documentation ? { label, documentation } : { label };
|
|
660
|
-
}
|
|
661
|
-
ParameterInformation2.create = create;
|
|
662
|
-
})(ParameterInformation || (ParameterInformation = {}));
|
|
663
|
-
var SignatureInformation;
|
|
664
|
-
(function(SignatureInformation2) {
|
|
665
|
-
function create(label, documentation, ...parameters) {
|
|
666
|
-
let result = { label };
|
|
667
|
-
if (Is.defined(documentation)) {
|
|
668
|
-
result.documentation = documentation;
|
|
669
|
-
}
|
|
670
|
-
if (Is.defined(parameters)) {
|
|
671
|
-
result.parameters = parameters;
|
|
672
|
-
} else {
|
|
673
|
-
result.parameters = [];
|
|
674
|
-
}
|
|
675
|
-
return result;
|
|
676
|
-
}
|
|
677
|
-
SignatureInformation2.create = create;
|
|
678
|
-
})(SignatureInformation || (SignatureInformation = {}));
|
|
679
|
-
var DocumentHighlightKind;
|
|
680
|
-
(function(DocumentHighlightKind2) {
|
|
681
|
-
DocumentHighlightKind2.Text = 1;
|
|
682
|
-
DocumentHighlightKind2.Read = 2;
|
|
683
|
-
DocumentHighlightKind2.Write = 3;
|
|
684
|
-
})(DocumentHighlightKind || (DocumentHighlightKind = {}));
|
|
685
|
-
var DocumentHighlight;
|
|
686
|
-
(function(DocumentHighlight2) {
|
|
687
|
-
function create(range, kind) {
|
|
688
|
-
let result = { range };
|
|
689
|
-
if (Is.number(kind)) {
|
|
690
|
-
result.kind = kind;
|
|
691
|
-
}
|
|
692
|
-
return result;
|
|
693
|
-
}
|
|
694
|
-
DocumentHighlight2.create = create;
|
|
695
|
-
})(DocumentHighlight || (DocumentHighlight = {}));
|
|
696
|
-
var SymbolKind;
|
|
697
|
-
(function(SymbolKind2) {
|
|
698
|
-
SymbolKind2.File = 1;
|
|
699
|
-
SymbolKind2.Module = 2;
|
|
700
|
-
SymbolKind2.Namespace = 3;
|
|
701
|
-
SymbolKind2.Package = 4;
|
|
702
|
-
SymbolKind2.Class = 5;
|
|
703
|
-
SymbolKind2.Method = 6;
|
|
704
|
-
SymbolKind2.Property = 7;
|
|
705
|
-
SymbolKind2.Field = 8;
|
|
706
|
-
SymbolKind2.Constructor = 9;
|
|
707
|
-
SymbolKind2.Enum = 10;
|
|
708
|
-
SymbolKind2.Interface = 11;
|
|
709
|
-
SymbolKind2.Function = 12;
|
|
710
|
-
SymbolKind2.Variable = 13;
|
|
711
|
-
SymbolKind2.Constant = 14;
|
|
712
|
-
SymbolKind2.String = 15;
|
|
713
|
-
SymbolKind2.Number = 16;
|
|
714
|
-
SymbolKind2.Boolean = 17;
|
|
715
|
-
SymbolKind2.Array = 18;
|
|
716
|
-
SymbolKind2.Object = 19;
|
|
717
|
-
SymbolKind2.Key = 20;
|
|
718
|
-
SymbolKind2.Null = 21;
|
|
719
|
-
SymbolKind2.EnumMember = 22;
|
|
720
|
-
SymbolKind2.Struct = 23;
|
|
721
|
-
SymbolKind2.Event = 24;
|
|
722
|
-
SymbolKind2.Operator = 25;
|
|
723
|
-
SymbolKind2.TypeParameter = 26;
|
|
724
|
-
})(SymbolKind || (SymbolKind = {}));
|
|
725
|
-
var SymbolTag;
|
|
726
|
-
(function(SymbolTag2) {
|
|
727
|
-
SymbolTag2.Deprecated = 1;
|
|
728
|
-
})(SymbolTag || (SymbolTag = {}));
|
|
729
|
-
var SymbolInformation;
|
|
730
|
-
(function(SymbolInformation2) {
|
|
731
|
-
function create(name, kind, range, uri, containerName) {
|
|
732
|
-
let result = {
|
|
733
|
-
name,
|
|
734
|
-
kind,
|
|
735
|
-
location: { uri, range }
|
|
736
|
-
};
|
|
737
|
-
if (containerName) {
|
|
738
|
-
result.containerName = containerName;
|
|
739
|
-
}
|
|
740
|
-
return result;
|
|
741
|
-
}
|
|
742
|
-
SymbolInformation2.create = create;
|
|
743
|
-
})(SymbolInformation || (SymbolInformation = {}));
|
|
744
|
-
var WorkspaceSymbol;
|
|
745
|
-
(function(WorkspaceSymbol2) {
|
|
746
|
-
function create(name, kind, uri, range) {
|
|
747
|
-
return range !== void 0 ? { name, kind, location: { uri, range } } : { name, kind, location: { uri } };
|
|
748
|
-
}
|
|
749
|
-
WorkspaceSymbol2.create = create;
|
|
750
|
-
})(WorkspaceSymbol || (WorkspaceSymbol = {}));
|
|
751
|
-
var DocumentSymbol;
|
|
752
|
-
(function(DocumentSymbol2) {
|
|
753
|
-
function create(name, detail, kind, range, selectionRange, children) {
|
|
754
|
-
let result = {
|
|
755
|
-
name,
|
|
756
|
-
detail,
|
|
757
|
-
kind,
|
|
758
|
-
range,
|
|
759
|
-
selectionRange
|
|
760
|
-
};
|
|
761
|
-
if (children !== void 0) {
|
|
762
|
-
result.children = children;
|
|
763
|
-
}
|
|
764
|
-
return result;
|
|
765
|
-
}
|
|
766
|
-
DocumentSymbol2.create = create;
|
|
767
|
-
function is(value) {
|
|
768
|
-
let candidate = value;
|
|
769
|
-
return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range.is(candidate.range) && Range.is(candidate.selectionRange) && (candidate.detail === void 0 || Is.string(candidate.detail)) && (candidate.deprecated === void 0 || Is.boolean(candidate.deprecated)) && (candidate.children === void 0 || Array.isArray(candidate.children)) && (candidate.tags === void 0 || Array.isArray(candidate.tags));
|
|
770
|
-
}
|
|
771
|
-
DocumentSymbol2.is = is;
|
|
772
|
-
})(DocumentSymbol || (DocumentSymbol = {}));
|
|
773
|
-
var CodeActionKind;
|
|
774
|
-
(function(CodeActionKind2) {
|
|
775
|
-
CodeActionKind2.Empty = "";
|
|
776
|
-
CodeActionKind2.QuickFix = "quickfix";
|
|
777
|
-
CodeActionKind2.Refactor = "refactor";
|
|
778
|
-
CodeActionKind2.RefactorExtract = "refactor.extract";
|
|
779
|
-
CodeActionKind2.RefactorInline = "refactor.inline";
|
|
780
|
-
CodeActionKind2.RefactorRewrite = "refactor.rewrite";
|
|
781
|
-
CodeActionKind2.Source = "source";
|
|
782
|
-
CodeActionKind2.SourceOrganizeImports = "source.organizeImports";
|
|
783
|
-
CodeActionKind2.SourceFixAll = "source.fixAll";
|
|
784
|
-
})(CodeActionKind || (CodeActionKind = {}));
|
|
785
|
-
var CodeActionTriggerKind;
|
|
786
|
-
(function(CodeActionTriggerKind2) {
|
|
787
|
-
CodeActionTriggerKind2.Invoked = 1;
|
|
788
|
-
CodeActionTriggerKind2.Automatic = 2;
|
|
789
|
-
})(CodeActionTriggerKind || (CodeActionTriggerKind = {}));
|
|
790
|
-
var CodeActionContext;
|
|
791
|
-
(function(CodeActionContext2) {
|
|
792
|
-
function create(diagnostics, only, triggerKind) {
|
|
793
|
-
let result = { diagnostics };
|
|
794
|
-
if (only !== void 0 && only !== null) {
|
|
795
|
-
result.only = only;
|
|
796
|
-
}
|
|
797
|
-
if (triggerKind !== void 0 && triggerKind !== null) {
|
|
798
|
-
result.triggerKind = triggerKind;
|
|
799
|
-
}
|
|
800
|
-
return result;
|
|
801
|
-
}
|
|
802
|
-
CodeActionContext2.create = create;
|
|
803
|
-
function is(value) {
|
|
804
|
-
let candidate = value;
|
|
805
|
-
return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string)) && (candidate.triggerKind === void 0 || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);
|
|
806
|
-
}
|
|
807
|
-
CodeActionContext2.is = is;
|
|
808
|
-
})(CodeActionContext || (CodeActionContext = {}));
|
|
809
|
-
var CodeAction;
|
|
810
|
-
(function(CodeAction2) {
|
|
811
|
-
function create(title, kindOrCommandOrEdit, kind) {
|
|
812
|
-
let result = { title };
|
|
813
|
-
let checkKind = true;
|
|
814
|
-
if (typeof kindOrCommandOrEdit === "string") {
|
|
815
|
-
checkKind = false;
|
|
816
|
-
result.kind = kindOrCommandOrEdit;
|
|
817
|
-
} else if (Command.is(kindOrCommandOrEdit)) {
|
|
818
|
-
result.command = kindOrCommandOrEdit;
|
|
819
|
-
} else {
|
|
820
|
-
result.edit = kindOrCommandOrEdit;
|
|
821
|
-
}
|
|
822
|
-
if (checkKind && kind !== void 0) {
|
|
823
|
-
result.kind = kind;
|
|
824
|
-
}
|
|
825
|
-
return result;
|
|
826
|
-
}
|
|
827
|
-
CodeAction2.create = create;
|
|
828
|
-
function is(value) {
|
|
829
|
-
let candidate = value;
|
|
830
|
-
return candidate && Is.string(candidate.title) && (candidate.diagnostics === void 0 || Is.typedArray(candidate.diagnostics, Diagnostic.is)) && (candidate.kind === void 0 || Is.string(candidate.kind)) && (candidate.edit !== void 0 || candidate.command !== void 0) && (candidate.command === void 0 || Command.is(candidate.command)) && (candidate.isPreferred === void 0 || Is.boolean(candidate.isPreferred)) && (candidate.edit === void 0 || WorkspaceEdit.is(candidate.edit));
|
|
831
|
-
}
|
|
832
|
-
CodeAction2.is = is;
|
|
833
|
-
})(CodeAction || (CodeAction = {}));
|
|
834
|
-
var CodeLens;
|
|
835
|
-
(function(CodeLens2) {
|
|
836
|
-
function create(range, data) {
|
|
837
|
-
let result = { range };
|
|
838
|
-
if (Is.defined(data)) {
|
|
839
|
-
result.data = data;
|
|
840
|
-
}
|
|
841
|
-
return result;
|
|
842
|
-
}
|
|
843
|
-
CodeLens2.create = create;
|
|
844
|
-
function is(value) {
|
|
845
|
-
let candidate = value;
|
|
846
|
-
return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
|
|
847
|
-
}
|
|
848
|
-
CodeLens2.is = is;
|
|
849
|
-
})(CodeLens || (CodeLens = {}));
|
|
850
|
-
var FormattingOptions;
|
|
851
|
-
(function(FormattingOptions2) {
|
|
852
|
-
function create(tabSize, insertSpaces) {
|
|
853
|
-
return { tabSize, insertSpaces };
|
|
854
|
-
}
|
|
855
|
-
FormattingOptions2.create = create;
|
|
856
|
-
function is(value) {
|
|
857
|
-
let candidate = value;
|
|
858
|
-
return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
|
|
859
|
-
}
|
|
860
|
-
FormattingOptions2.is = is;
|
|
861
|
-
})(FormattingOptions || (FormattingOptions = {}));
|
|
862
|
-
var DocumentLink;
|
|
863
|
-
(function(DocumentLink2) {
|
|
864
|
-
function create(range, target, data) {
|
|
865
|
-
return { range, target, data };
|
|
866
|
-
}
|
|
867
|
-
DocumentLink2.create = create;
|
|
868
|
-
function is(value) {
|
|
869
|
-
let candidate = value;
|
|
870
|
-
return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
|
|
871
|
-
}
|
|
872
|
-
DocumentLink2.is = is;
|
|
873
|
-
})(DocumentLink || (DocumentLink = {}));
|
|
874
|
-
var SelectionRange;
|
|
875
|
-
(function(SelectionRange2) {
|
|
876
|
-
function create(range, parent) {
|
|
877
|
-
return { range, parent };
|
|
878
|
-
}
|
|
879
|
-
SelectionRange2.create = create;
|
|
880
|
-
function is(value) {
|
|
881
|
-
let candidate = value;
|
|
882
|
-
return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent));
|
|
883
|
-
}
|
|
884
|
-
SelectionRange2.is = is;
|
|
885
|
-
})(SelectionRange || (SelectionRange = {}));
|
|
886
|
-
var SemanticTokenTypes;
|
|
887
|
-
(function(SemanticTokenTypes2) {
|
|
888
|
-
SemanticTokenTypes2["namespace"] = "namespace";
|
|
889
|
-
SemanticTokenTypes2["type"] = "type";
|
|
890
|
-
SemanticTokenTypes2["class"] = "class";
|
|
891
|
-
SemanticTokenTypes2["enum"] = "enum";
|
|
892
|
-
SemanticTokenTypes2["interface"] = "interface";
|
|
893
|
-
SemanticTokenTypes2["struct"] = "struct";
|
|
894
|
-
SemanticTokenTypes2["typeParameter"] = "typeParameter";
|
|
895
|
-
SemanticTokenTypes2["parameter"] = "parameter";
|
|
896
|
-
SemanticTokenTypes2["variable"] = "variable";
|
|
897
|
-
SemanticTokenTypes2["property"] = "property";
|
|
898
|
-
SemanticTokenTypes2["enumMember"] = "enumMember";
|
|
899
|
-
SemanticTokenTypes2["event"] = "event";
|
|
900
|
-
SemanticTokenTypes2["function"] = "function";
|
|
901
|
-
SemanticTokenTypes2["method"] = "method";
|
|
902
|
-
SemanticTokenTypes2["macro"] = "macro";
|
|
903
|
-
SemanticTokenTypes2["keyword"] = "keyword";
|
|
904
|
-
SemanticTokenTypes2["modifier"] = "modifier";
|
|
905
|
-
SemanticTokenTypes2["comment"] = "comment";
|
|
906
|
-
SemanticTokenTypes2["string"] = "string";
|
|
907
|
-
SemanticTokenTypes2["number"] = "number";
|
|
908
|
-
SemanticTokenTypes2["regexp"] = "regexp";
|
|
909
|
-
SemanticTokenTypes2["operator"] = "operator";
|
|
910
|
-
SemanticTokenTypes2["decorator"] = "decorator";
|
|
911
|
-
})(SemanticTokenTypes || (SemanticTokenTypes = {}));
|
|
912
|
-
var SemanticTokenModifiers;
|
|
913
|
-
(function(SemanticTokenModifiers2) {
|
|
914
|
-
SemanticTokenModifiers2["declaration"] = "declaration";
|
|
915
|
-
SemanticTokenModifiers2["definition"] = "definition";
|
|
916
|
-
SemanticTokenModifiers2["readonly"] = "readonly";
|
|
917
|
-
SemanticTokenModifiers2["static"] = "static";
|
|
918
|
-
SemanticTokenModifiers2["deprecated"] = "deprecated";
|
|
919
|
-
SemanticTokenModifiers2["abstract"] = "abstract";
|
|
920
|
-
SemanticTokenModifiers2["async"] = "async";
|
|
921
|
-
SemanticTokenModifiers2["modification"] = "modification";
|
|
922
|
-
SemanticTokenModifiers2["documentation"] = "documentation";
|
|
923
|
-
SemanticTokenModifiers2["defaultLibrary"] = "defaultLibrary";
|
|
924
|
-
})(SemanticTokenModifiers || (SemanticTokenModifiers = {}));
|
|
925
|
-
var SemanticTokens;
|
|
926
|
-
(function(SemanticTokens2) {
|
|
927
|
-
function is(value) {
|
|
928
|
-
const candidate = value;
|
|
929
|
-
return Is.objectLiteral(candidate) && (candidate.resultId === void 0 || typeof candidate.resultId === "string") && Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === "number");
|
|
930
|
-
}
|
|
931
|
-
SemanticTokens2.is = is;
|
|
932
|
-
})(SemanticTokens || (SemanticTokens = {}));
|
|
933
|
-
var InlineValueText;
|
|
934
|
-
(function(InlineValueText2) {
|
|
935
|
-
function create(range, text) {
|
|
936
|
-
return { range, text };
|
|
937
|
-
}
|
|
938
|
-
InlineValueText2.create = create;
|
|
939
|
-
function is(value) {
|
|
940
|
-
const candidate = value;
|
|
941
|
-
return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text);
|
|
942
|
-
}
|
|
943
|
-
InlineValueText2.is = is;
|
|
944
|
-
})(InlineValueText || (InlineValueText = {}));
|
|
945
|
-
var InlineValueVariableLookup;
|
|
946
|
-
(function(InlineValueVariableLookup2) {
|
|
947
|
-
function create(range, variableName, caseSensitiveLookup) {
|
|
948
|
-
return { range, variableName, caseSensitiveLookup };
|
|
949
|
-
}
|
|
950
|
-
InlineValueVariableLookup2.create = create;
|
|
951
|
-
function is(value) {
|
|
952
|
-
const candidate = value;
|
|
953
|
-
return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === void 0);
|
|
954
|
-
}
|
|
955
|
-
InlineValueVariableLookup2.is = is;
|
|
956
|
-
})(InlineValueVariableLookup || (InlineValueVariableLookup = {}));
|
|
957
|
-
var InlineValueEvaluatableExpression;
|
|
958
|
-
(function(InlineValueEvaluatableExpression2) {
|
|
959
|
-
function create(range, expression) {
|
|
960
|
-
return { range, expression };
|
|
961
|
-
}
|
|
962
|
-
InlineValueEvaluatableExpression2.create = create;
|
|
963
|
-
function is(value) {
|
|
964
|
-
const candidate = value;
|
|
965
|
-
return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === void 0);
|
|
966
|
-
}
|
|
967
|
-
InlineValueEvaluatableExpression2.is = is;
|
|
968
|
-
})(InlineValueEvaluatableExpression || (InlineValueEvaluatableExpression = {}));
|
|
969
|
-
var InlineValueContext;
|
|
970
|
-
(function(InlineValueContext2) {
|
|
971
|
-
function create(frameId, stoppedLocation) {
|
|
972
|
-
return { frameId, stoppedLocation };
|
|
973
|
-
}
|
|
974
|
-
InlineValueContext2.create = create;
|
|
975
|
-
function is(value) {
|
|
976
|
-
const candidate = value;
|
|
977
|
-
return Is.defined(candidate) && Range.is(value.stoppedLocation);
|
|
978
|
-
}
|
|
979
|
-
InlineValueContext2.is = is;
|
|
980
|
-
})(InlineValueContext || (InlineValueContext = {}));
|
|
981
|
-
var InlayHintKind;
|
|
982
|
-
(function(InlayHintKind2) {
|
|
983
|
-
InlayHintKind2.Type = 1;
|
|
984
|
-
InlayHintKind2.Parameter = 2;
|
|
985
|
-
function is(value) {
|
|
986
|
-
return value === 1 || value === 2;
|
|
987
|
-
}
|
|
988
|
-
InlayHintKind2.is = is;
|
|
989
|
-
})(InlayHintKind || (InlayHintKind = {}));
|
|
990
|
-
var InlayHintLabelPart;
|
|
991
|
-
(function(InlayHintLabelPart2) {
|
|
992
|
-
function create(value) {
|
|
993
|
-
return { value };
|
|
994
|
-
}
|
|
995
|
-
InlayHintLabelPart2.create = create;
|
|
996
|
-
function is(value) {
|
|
997
|
-
const candidate = value;
|
|
998
|
-
return Is.objectLiteral(candidate) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.location === void 0 || Location.is(candidate.location)) && (candidate.command === void 0 || Command.is(candidate.command));
|
|
999
|
-
}
|
|
1000
|
-
InlayHintLabelPart2.is = is;
|
|
1001
|
-
})(InlayHintLabelPart || (InlayHintLabelPart = {}));
|
|
1002
|
-
var InlayHint;
|
|
1003
|
-
(function(InlayHint2) {
|
|
1004
|
-
function create(position, label, kind) {
|
|
1005
|
-
const result = { position, label };
|
|
1006
|
-
if (kind !== void 0) {
|
|
1007
|
-
result.kind = kind;
|
|
1008
|
-
}
|
|
1009
|
-
return result;
|
|
1010
|
-
}
|
|
1011
|
-
InlayHint2.create = create;
|
|
1012
|
-
function is(value) {
|
|
1013
|
-
const candidate = value;
|
|
1014
|
-
return Is.objectLiteral(candidate) && Position.is(candidate.position) && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is)) && (candidate.kind === void 0 || InlayHintKind.is(candidate.kind)) && candidate.textEdits === void 0 || Is.typedArray(candidate.textEdits, TextEdit.is) && (candidate.tooltip === void 0 || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip)) && (candidate.paddingLeft === void 0 || Is.boolean(candidate.paddingLeft)) && (candidate.paddingRight === void 0 || Is.boolean(candidate.paddingRight));
|
|
1015
|
-
}
|
|
1016
|
-
InlayHint2.is = is;
|
|
1017
|
-
})(InlayHint || (InlayHint = {}));
|
|
1018
|
-
var StringValue;
|
|
1019
|
-
(function(StringValue2) {
|
|
1020
|
-
function createSnippet(value) {
|
|
1021
|
-
return { kind: "snippet", value };
|
|
1022
|
-
}
|
|
1023
|
-
StringValue2.createSnippet = createSnippet;
|
|
1024
|
-
})(StringValue || (StringValue = {}));
|
|
1025
|
-
var InlineCompletionItem;
|
|
1026
|
-
(function(InlineCompletionItem2) {
|
|
1027
|
-
function create(insertText, filterText, range, command) {
|
|
1028
|
-
return { insertText, filterText, range, command };
|
|
1029
|
-
}
|
|
1030
|
-
InlineCompletionItem2.create = create;
|
|
1031
|
-
})(InlineCompletionItem || (InlineCompletionItem = {}));
|
|
1032
|
-
var InlineCompletionList;
|
|
1033
|
-
(function(InlineCompletionList2) {
|
|
1034
|
-
function create(items) {
|
|
1035
|
-
return { items };
|
|
1036
|
-
}
|
|
1037
|
-
InlineCompletionList2.create = create;
|
|
1038
|
-
})(InlineCompletionList || (InlineCompletionList = {}));
|
|
1039
|
-
var InlineCompletionTriggerKind;
|
|
1040
|
-
(function(InlineCompletionTriggerKind2) {
|
|
1041
|
-
InlineCompletionTriggerKind2.Invoked = 0;
|
|
1042
|
-
InlineCompletionTriggerKind2.Automatic = 1;
|
|
1043
|
-
})(InlineCompletionTriggerKind || (InlineCompletionTriggerKind = {}));
|
|
1044
|
-
var SelectedCompletionInfo;
|
|
1045
|
-
(function(SelectedCompletionInfo2) {
|
|
1046
|
-
function create(range, text) {
|
|
1047
|
-
return { range, text };
|
|
1048
|
-
}
|
|
1049
|
-
SelectedCompletionInfo2.create = create;
|
|
1050
|
-
})(SelectedCompletionInfo || (SelectedCompletionInfo = {}));
|
|
1051
|
-
var InlineCompletionContext;
|
|
1052
|
-
(function(InlineCompletionContext2) {
|
|
1053
|
-
function create(triggerKind, selectedCompletionInfo) {
|
|
1054
|
-
return { triggerKind, selectedCompletionInfo };
|
|
1055
|
-
}
|
|
1056
|
-
InlineCompletionContext2.create = create;
|
|
1057
|
-
})(InlineCompletionContext || (InlineCompletionContext = {}));
|
|
1058
|
-
var WorkspaceFolder;
|
|
1059
|
-
(function(WorkspaceFolder2) {
|
|
1060
|
-
function is(value) {
|
|
1061
|
-
const candidate = value;
|
|
1062
|
-
return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name);
|
|
1063
|
-
}
|
|
1064
|
-
WorkspaceFolder2.is = is;
|
|
1065
|
-
})(WorkspaceFolder || (WorkspaceFolder = {}));
|
|
1066
|
-
var TextDocument;
|
|
1067
|
-
(function(TextDocument2) {
|
|
1068
|
-
function create(uri, languageId, version, content) {
|
|
1069
|
-
return new FullTextDocument(uri, languageId, version, content);
|
|
1070
|
-
}
|
|
1071
|
-
TextDocument2.create = create;
|
|
1072
|
-
function is(value) {
|
|
1073
|
-
let candidate = value;
|
|
1074
|
-
return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount) && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
|
|
1075
|
-
}
|
|
1076
|
-
TextDocument2.is = is;
|
|
1077
|
-
function applyEdits(document, edits) {
|
|
1078
|
-
let text = document.getText();
|
|
1079
|
-
let sortedEdits = mergeSort(edits, (a, b) => {
|
|
1080
|
-
let diff = a.range.start.line - b.range.start.line;
|
|
1081
|
-
if (diff === 0) {
|
|
1082
|
-
return a.range.start.character - b.range.start.character;
|
|
1083
|
-
}
|
|
1084
|
-
return diff;
|
|
1085
|
-
});
|
|
1086
|
-
let lastModifiedOffset = text.length;
|
|
1087
|
-
for (let i = sortedEdits.length - 1; i >= 0; i--) {
|
|
1088
|
-
let e = sortedEdits[i];
|
|
1089
|
-
let startOffset = document.offsetAt(e.range.start);
|
|
1090
|
-
let endOffset = document.offsetAt(e.range.end);
|
|
1091
|
-
if (endOffset <= lastModifiedOffset) {
|
|
1092
|
-
text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
|
|
1093
|
-
} else {
|
|
1094
|
-
throw new Error("Overlapping edit");
|
|
1095
|
-
}
|
|
1096
|
-
lastModifiedOffset = startOffset;
|
|
1097
|
-
}
|
|
1098
|
-
return text;
|
|
1099
|
-
}
|
|
1100
|
-
TextDocument2.applyEdits = applyEdits;
|
|
1101
|
-
function mergeSort(data, compare) {
|
|
1102
|
-
if (data.length <= 1) {
|
|
1103
|
-
return data;
|
|
1104
|
-
}
|
|
1105
|
-
const p = data.length / 2 | 0;
|
|
1106
|
-
const left = data.slice(0, p);
|
|
1107
|
-
const right = data.slice(p);
|
|
1108
|
-
mergeSort(left, compare);
|
|
1109
|
-
mergeSort(right, compare);
|
|
1110
|
-
let leftIdx = 0;
|
|
1111
|
-
let rightIdx = 0;
|
|
1112
|
-
let i = 0;
|
|
1113
|
-
while (leftIdx < left.length && rightIdx < right.length) {
|
|
1114
|
-
let ret = compare(left[leftIdx], right[rightIdx]);
|
|
1115
|
-
if (ret <= 0) {
|
|
1116
|
-
data[i++] = left[leftIdx++];
|
|
1117
|
-
} else {
|
|
1118
|
-
data[i++] = right[rightIdx++];
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
while (leftIdx < left.length) {
|
|
1122
|
-
data[i++] = left[leftIdx++];
|
|
1123
|
-
}
|
|
1124
|
-
while (rightIdx < right.length) {
|
|
1125
|
-
data[i++] = right[rightIdx++];
|
|
1126
|
-
}
|
|
1127
|
-
return data;
|
|
1128
|
-
}
|
|
1129
|
-
})(TextDocument || (TextDocument = {}));
|
|
1130
|
-
var FullTextDocument = class {
|
|
1131
|
-
constructor(uri, languageId, version, content) {
|
|
1132
|
-
this._uri = uri;
|
|
1133
|
-
this._languageId = languageId;
|
|
1134
|
-
this._version = version;
|
|
1135
|
-
this._content = content;
|
|
1136
|
-
this._lineOffsets = void 0;
|
|
1137
|
-
}
|
|
1138
|
-
get uri() {
|
|
1139
|
-
return this._uri;
|
|
1140
|
-
}
|
|
1141
|
-
get languageId() {
|
|
1142
|
-
return this._languageId;
|
|
1143
|
-
}
|
|
1144
|
-
get version() {
|
|
1145
|
-
return this._version;
|
|
1146
|
-
}
|
|
1147
|
-
getText(range) {
|
|
1148
|
-
if (range) {
|
|
1149
|
-
let start = this.offsetAt(range.start);
|
|
1150
|
-
let end = this.offsetAt(range.end);
|
|
1151
|
-
return this._content.substring(start, end);
|
|
1152
|
-
}
|
|
1153
|
-
return this._content;
|
|
1154
|
-
}
|
|
1155
|
-
update(event, version) {
|
|
1156
|
-
this._content = event.text;
|
|
1157
|
-
this._version = version;
|
|
1158
|
-
this._lineOffsets = void 0;
|
|
1159
|
-
}
|
|
1160
|
-
getLineOffsets() {
|
|
1161
|
-
if (this._lineOffsets === void 0) {
|
|
1162
|
-
let lineOffsets = [];
|
|
1163
|
-
let text = this._content;
|
|
1164
|
-
let isLineStart = true;
|
|
1165
|
-
for (let i = 0; i < text.length; i++) {
|
|
1166
|
-
if (isLineStart) {
|
|
1167
|
-
lineOffsets.push(i);
|
|
1168
|
-
isLineStart = false;
|
|
1169
|
-
}
|
|
1170
|
-
let ch = text.charAt(i);
|
|
1171
|
-
isLineStart = ch === "\r" || ch === "\n";
|
|
1172
|
-
if (ch === "\r" && i + 1 < text.length && text.charAt(i + 1) === "\n") {
|
|
1173
|
-
i++;
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
if (isLineStart && text.length > 0) {
|
|
1177
|
-
lineOffsets.push(text.length);
|
|
1178
|
-
}
|
|
1179
|
-
this._lineOffsets = lineOffsets;
|
|
1180
|
-
}
|
|
1181
|
-
return this._lineOffsets;
|
|
1182
|
-
}
|
|
1183
|
-
positionAt(offset) {
|
|
1184
|
-
offset = Math.max(Math.min(offset, this._content.length), 0);
|
|
1185
|
-
let lineOffsets = this.getLineOffsets();
|
|
1186
|
-
let low = 0, high = lineOffsets.length;
|
|
1187
|
-
if (high === 0) {
|
|
1188
|
-
return Position.create(0, offset);
|
|
1189
|
-
}
|
|
1190
|
-
while (low < high) {
|
|
1191
|
-
let mid = Math.floor((low + high) / 2);
|
|
1192
|
-
if (lineOffsets[mid] > offset) {
|
|
1193
|
-
high = mid;
|
|
1194
|
-
} else {
|
|
1195
|
-
low = mid + 1;
|
|
1196
|
-
}
|
|
1197
|
-
}
|
|
1198
|
-
let line = low - 1;
|
|
1199
|
-
return Position.create(line, offset - lineOffsets[line]);
|
|
1200
|
-
}
|
|
1201
|
-
offsetAt(position) {
|
|
1202
|
-
let lineOffsets = this.getLineOffsets();
|
|
1203
|
-
if (position.line >= lineOffsets.length) {
|
|
1204
|
-
return this._content.length;
|
|
1205
|
-
} else if (position.line < 0) {
|
|
1206
|
-
return 0;
|
|
1207
|
-
}
|
|
1208
|
-
let lineOffset = lineOffsets[position.line];
|
|
1209
|
-
let nextLineOffset = position.line + 1 < lineOffsets.length ? lineOffsets[position.line + 1] : this._content.length;
|
|
1210
|
-
return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
|
|
1211
|
-
}
|
|
1212
|
-
get lineCount() {
|
|
1213
|
-
return this.getLineOffsets().length;
|
|
1214
|
-
}
|
|
1215
|
-
};
|
|
1216
|
-
var Is;
|
|
1217
|
-
(function(Is2) {
|
|
1218
|
-
const toString = Object.prototype.toString;
|
|
1219
|
-
function defined(value) {
|
|
1220
|
-
return typeof value !== "undefined";
|
|
1221
|
-
}
|
|
1222
|
-
Is2.defined = defined;
|
|
1223
|
-
function undefined2(value) {
|
|
1224
|
-
return typeof value === "undefined";
|
|
1225
|
-
}
|
|
1226
|
-
Is2.undefined = undefined2;
|
|
1227
|
-
function boolean(value) {
|
|
1228
|
-
return value === true || value === false;
|
|
1229
|
-
}
|
|
1230
|
-
Is2.boolean = boolean;
|
|
1231
|
-
function string(value) {
|
|
1232
|
-
return toString.call(value) === "[object String]";
|
|
1233
|
-
}
|
|
1234
|
-
Is2.string = string;
|
|
1235
|
-
function number(value) {
|
|
1236
|
-
return toString.call(value) === "[object Number]";
|
|
1237
|
-
}
|
|
1238
|
-
Is2.number = number;
|
|
1239
|
-
function numberRange(value, min, max) {
|
|
1240
|
-
return toString.call(value) === "[object Number]" && min <= value && value <= max;
|
|
1241
|
-
}
|
|
1242
|
-
Is2.numberRange = numberRange;
|
|
1243
|
-
function integer2(value) {
|
|
1244
|
-
return toString.call(value) === "[object Number]" && -2147483648 <= value && value <= 2147483647;
|
|
1245
|
-
}
|
|
1246
|
-
Is2.integer = integer2;
|
|
1247
|
-
function uinteger2(value) {
|
|
1248
|
-
return toString.call(value) === "[object Number]" && 0 <= value && value <= 2147483647;
|
|
1249
|
-
}
|
|
1250
|
-
Is2.uinteger = uinteger2;
|
|
1251
|
-
function func(value) {
|
|
1252
|
-
return toString.call(value) === "[object Function]";
|
|
1253
|
-
}
|
|
1254
|
-
Is2.func = func;
|
|
1255
|
-
function objectLiteral(value) {
|
|
1256
|
-
return value !== null && typeof value === "object";
|
|
1257
|
-
}
|
|
1258
|
-
Is2.objectLiteral = objectLiteral;
|
|
1259
|
-
function typedArray(value, check) {
|
|
1260
|
-
return Array.isArray(value) && value.every(check);
|
|
1261
|
-
}
|
|
1262
|
-
Is2.typedArray = typedArray;
|
|
1263
|
-
})(Is || (Is = {}));
|
|
1264
|
-
var DiagnosticsAdapter = class {
|
|
1265
|
-
constructor(_languageId, _worker, configChangeEvent) {
|
|
1266
|
-
this._languageId = _languageId;
|
|
1267
|
-
this._worker = _worker;
|
|
1268
|
-
this._disposables = [];
|
|
1269
|
-
this._listener = /* @__PURE__ */ Object.create(null);
|
|
1270
|
-
const onModelAdd = (model) => {
|
|
1271
|
-
let modeId = model.getLanguageId();
|
|
1272
|
-
if (modeId !== this._languageId) {
|
|
1273
|
-
return;
|
|
1274
|
-
}
|
|
1275
|
-
let handle;
|
|
1276
|
-
this._listener[model.uri.toString()] = model.onDidChangeContent(() => {
|
|
1277
|
-
window.clearTimeout(handle);
|
|
1278
|
-
handle = window.setTimeout(() => this._doValidate(model.uri, modeId), 500);
|
|
1279
|
-
});
|
|
1280
|
-
this._doValidate(model.uri, modeId);
|
|
1281
|
-
};
|
|
1282
|
-
const onModelRemoved = (model) => {
|
|
1283
|
-
monaco_editor_core_exports.editor.setModelMarkers(model, this._languageId, []);
|
|
1284
|
-
let uriStr = model.uri.toString();
|
|
1285
|
-
let listener = this._listener[uriStr];
|
|
1286
|
-
if (listener) {
|
|
1287
|
-
listener.dispose();
|
|
1288
|
-
delete this._listener[uriStr];
|
|
1289
|
-
}
|
|
1290
|
-
};
|
|
1291
|
-
this._disposables.push(monaco_editor_core_exports.editor.onDidCreateModel(onModelAdd));
|
|
1292
|
-
this._disposables.push(monaco_editor_core_exports.editor.onWillDisposeModel(onModelRemoved));
|
|
1293
|
-
this._disposables.push(
|
|
1294
|
-
monaco_editor_core_exports.editor.onDidChangeModelLanguage((event) => {
|
|
1295
|
-
onModelRemoved(event.model);
|
|
1296
|
-
onModelAdd(event.model);
|
|
1297
|
-
})
|
|
1298
|
-
);
|
|
1299
|
-
this._disposables.push(
|
|
1300
|
-
configChangeEvent((_) => {
|
|
1301
|
-
monaco_editor_core_exports.editor.getModels().forEach((model) => {
|
|
1302
|
-
if (model.getLanguageId() === this._languageId) {
|
|
1303
|
-
onModelRemoved(model);
|
|
1304
|
-
onModelAdd(model);
|
|
1305
|
-
}
|
|
1306
|
-
});
|
|
1307
|
-
})
|
|
1308
|
-
);
|
|
1309
|
-
this._disposables.push({
|
|
1310
|
-
dispose: () => {
|
|
1311
|
-
monaco_editor_core_exports.editor.getModels().forEach(onModelRemoved);
|
|
1312
|
-
for (let key in this._listener) {
|
|
1313
|
-
this._listener[key].dispose();
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
});
|
|
1317
|
-
monaco_editor_core_exports.editor.getModels().forEach(onModelAdd);
|
|
1318
|
-
}
|
|
1319
|
-
dispose() {
|
|
1320
|
-
this._disposables.forEach((d) => d && d.dispose());
|
|
1321
|
-
this._disposables.length = 0;
|
|
1322
|
-
}
|
|
1323
|
-
_doValidate(resource, languageId) {
|
|
1324
|
-
this._worker(resource).then((worker2) => {
|
|
1325
|
-
return worker2.doValidation(resource.toString());
|
|
1326
|
-
}).then((diagnostics) => {
|
|
1327
|
-
const markers = diagnostics.map((d) => toDiagnostics(resource, d));
|
|
1328
|
-
let model = monaco_editor_core_exports.editor.getModel(resource);
|
|
1329
|
-
if (model && model.getLanguageId() === languageId) {
|
|
1330
|
-
monaco_editor_core_exports.editor.setModelMarkers(model, languageId, markers);
|
|
1331
|
-
}
|
|
1332
|
-
}).then(void 0, (err) => {
|
|
1333
|
-
console.error(err);
|
|
1334
|
-
});
|
|
1335
|
-
}
|
|
1336
|
-
};
|
|
1337
|
-
function toSeverity(lsSeverity) {
|
|
1338
|
-
switch (lsSeverity) {
|
|
1339
|
-
case DiagnosticSeverity.Error:
|
|
1340
|
-
return monaco_editor_core_exports.MarkerSeverity.Error;
|
|
1341
|
-
case DiagnosticSeverity.Warning:
|
|
1342
|
-
return monaco_editor_core_exports.MarkerSeverity.Warning;
|
|
1343
|
-
case DiagnosticSeverity.Information:
|
|
1344
|
-
return monaco_editor_core_exports.MarkerSeverity.Info;
|
|
1345
|
-
case DiagnosticSeverity.Hint:
|
|
1346
|
-
return monaco_editor_core_exports.MarkerSeverity.Hint;
|
|
1347
|
-
default:
|
|
1348
|
-
return monaco_editor_core_exports.MarkerSeverity.Info;
|
|
1349
|
-
}
|
|
1350
|
-
}
|
|
1351
|
-
function toDiagnostics(resource, diag) {
|
|
1352
|
-
let code = typeof diag.code === "number" ? String(diag.code) : diag.code;
|
|
1353
|
-
return {
|
|
1354
|
-
severity: toSeverity(diag.severity),
|
|
1355
|
-
startLineNumber: diag.range.start.line + 1,
|
|
1356
|
-
startColumn: diag.range.start.character + 1,
|
|
1357
|
-
endLineNumber: diag.range.end.line + 1,
|
|
1358
|
-
endColumn: diag.range.end.character + 1,
|
|
1359
|
-
message: diag.message,
|
|
1360
|
-
code,
|
|
1361
|
-
source: diag.source
|
|
1362
|
-
};
|
|
1363
|
-
}
|
|
1364
|
-
var CompletionAdapter = class {
|
|
1365
|
-
constructor(_worker, _triggerCharacters) {
|
|
1366
|
-
this._worker = _worker;
|
|
1367
|
-
this._triggerCharacters = _triggerCharacters;
|
|
1368
|
-
}
|
|
1369
|
-
get triggerCharacters() {
|
|
1370
|
-
return this._triggerCharacters;
|
|
1371
|
-
}
|
|
1372
|
-
provideCompletionItems(model, position, context, token) {
|
|
1373
|
-
const resource = model.uri;
|
|
1374
|
-
return this._worker(resource).then((worker2) => {
|
|
1375
|
-
return worker2.doComplete(resource.toString(), fromPosition(position));
|
|
1376
|
-
}).then((info) => {
|
|
1377
|
-
if (!info) {
|
|
1378
|
-
return;
|
|
1379
|
-
}
|
|
1380
|
-
const wordInfo = model.getWordUntilPosition(position);
|
|
1381
|
-
const wordRange = new monaco_editor_core_exports.Range(
|
|
1382
|
-
position.lineNumber,
|
|
1383
|
-
wordInfo.startColumn,
|
|
1384
|
-
position.lineNumber,
|
|
1385
|
-
wordInfo.endColumn
|
|
1386
|
-
);
|
|
1387
|
-
const items = info.items.map((entry) => {
|
|
1388
|
-
const item = {
|
|
1389
|
-
label: entry.label,
|
|
1390
|
-
insertText: entry.insertText || entry.label,
|
|
1391
|
-
sortText: entry.sortText,
|
|
1392
|
-
filterText: entry.filterText,
|
|
1393
|
-
documentation: entry.documentation,
|
|
1394
|
-
detail: entry.detail,
|
|
1395
|
-
command: toCommand(entry.command),
|
|
1396
|
-
range: wordRange,
|
|
1397
|
-
kind: toCompletionItemKind(entry.kind)
|
|
1398
|
-
};
|
|
1399
|
-
if (entry.textEdit) {
|
|
1400
|
-
if (isInsertReplaceEdit(entry.textEdit)) {
|
|
1401
|
-
item.range = {
|
|
1402
|
-
insert: toRange(entry.textEdit.insert),
|
|
1403
|
-
replace: toRange(entry.textEdit.replace)
|
|
1404
|
-
};
|
|
1405
|
-
} else {
|
|
1406
|
-
item.range = toRange(entry.textEdit.range);
|
|
1407
|
-
}
|
|
1408
|
-
item.insertText = entry.textEdit.newText;
|
|
1409
|
-
}
|
|
1410
|
-
if (entry.additionalTextEdits) {
|
|
1411
|
-
item.additionalTextEdits = entry.additionalTextEdits.map(toTextEdit);
|
|
1412
|
-
}
|
|
1413
|
-
if (entry.insertTextFormat === InsertTextFormat.Snippet) {
|
|
1414
|
-
item.insertTextRules = monaco_editor_core_exports.languages.CompletionItemInsertTextRule.InsertAsSnippet;
|
|
1415
|
-
}
|
|
1416
|
-
return item;
|
|
1417
|
-
});
|
|
1418
|
-
return {
|
|
1419
|
-
isIncomplete: info.isIncomplete,
|
|
1420
|
-
suggestions: items
|
|
1421
|
-
};
|
|
1422
|
-
});
|
|
1423
|
-
}
|
|
1424
|
-
};
|
|
1425
|
-
function fromPosition(position) {
|
|
1426
|
-
if (!position) {
|
|
1427
|
-
return void 0;
|
|
1428
|
-
}
|
|
1429
|
-
return { character: position.column - 1, line: position.lineNumber - 1 };
|
|
1430
|
-
}
|
|
1431
|
-
function fromRange(range) {
|
|
1432
|
-
if (!range) {
|
|
1433
|
-
return void 0;
|
|
1434
|
-
}
|
|
1435
|
-
return {
|
|
1436
|
-
start: {
|
|
1437
|
-
line: range.startLineNumber - 1,
|
|
1438
|
-
character: range.startColumn - 1
|
|
1439
|
-
},
|
|
1440
|
-
end: { line: range.endLineNumber - 1, character: range.endColumn - 1 }
|
|
1441
|
-
};
|
|
1442
|
-
}
|
|
1443
|
-
function toRange(range) {
|
|
1444
|
-
if (!range) {
|
|
1445
|
-
return void 0;
|
|
1446
|
-
}
|
|
1447
|
-
return new monaco_editor_core_exports.Range(
|
|
1448
|
-
range.start.line + 1,
|
|
1449
|
-
range.start.character + 1,
|
|
1450
|
-
range.end.line + 1,
|
|
1451
|
-
range.end.character + 1
|
|
1452
|
-
);
|
|
1453
|
-
}
|
|
1454
|
-
function isInsertReplaceEdit(edit) {
|
|
1455
|
-
return typeof edit.insert !== "undefined" && typeof edit.replace !== "undefined";
|
|
1456
|
-
}
|
|
1457
|
-
function toCompletionItemKind(kind) {
|
|
1458
|
-
const mItemKind = monaco_editor_core_exports.languages.CompletionItemKind;
|
|
1459
|
-
switch (kind) {
|
|
1460
|
-
case CompletionItemKind.Text:
|
|
1461
|
-
return mItemKind.Text;
|
|
1462
|
-
case CompletionItemKind.Method:
|
|
1463
|
-
return mItemKind.Method;
|
|
1464
|
-
case CompletionItemKind.Function:
|
|
1465
|
-
return mItemKind.Function;
|
|
1466
|
-
case CompletionItemKind.Constructor:
|
|
1467
|
-
return mItemKind.Constructor;
|
|
1468
|
-
case CompletionItemKind.Field:
|
|
1469
|
-
return mItemKind.Field;
|
|
1470
|
-
case CompletionItemKind.Variable:
|
|
1471
|
-
return mItemKind.Variable;
|
|
1472
|
-
case CompletionItemKind.Class:
|
|
1473
|
-
return mItemKind.Class;
|
|
1474
|
-
case CompletionItemKind.Interface:
|
|
1475
|
-
return mItemKind.Interface;
|
|
1476
|
-
case CompletionItemKind.Module:
|
|
1477
|
-
return mItemKind.Module;
|
|
1478
|
-
case CompletionItemKind.Property:
|
|
1479
|
-
return mItemKind.Property;
|
|
1480
|
-
case CompletionItemKind.Unit:
|
|
1481
|
-
return mItemKind.Unit;
|
|
1482
|
-
case CompletionItemKind.Value:
|
|
1483
|
-
return mItemKind.Value;
|
|
1484
|
-
case CompletionItemKind.Enum:
|
|
1485
|
-
return mItemKind.Enum;
|
|
1486
|
-
case CompletionItemKind.Keyword:
|
|
1487
|
-
return mItemKind.Keyword;
|
|
1488
|
-
case CompletionItemKind.Snippet:
|
|
1489
|
-
return mItemKind.Snippet;
|
|
1490
|
-
case CompletionItemKind.Color:
|
|
1491
|
-
return mItemKind.Color;
|
|
1492
|
-
case CompletionItemKind.File:
|
|
1493
|
-
return mItemKind.File;
|
|
1494
|
-
case CompletionItemKind.Reference:
|
|
1495
|
-
return mItemKind.Reference;
|
|
1496
|
-
}
|
|
1497
|
-
return mItemKind.Property;
|
|
1498
|
-
}
|
|
1499
|
-
function toTextEdit(textEdit) {
|
|
1500
|
-
if (!textEdit) {
|
|
1501
|
-
return void 0;
|
|
1502
|
-
}
|
|
1503
|
-
return {
|
|
1504
|
-
range: toRange(textEdit.range),
|
|
1505
|
-
text: textEdit.newText
|
|
1506
|
-
};
|
|
1507
|
-
}
|
|
1508
|
-
function toCommand(c) {
|
|
1509
|
-
return c && c.command === "editor.action.triggerSuggest" ? { id: c.command, title: c.title, arguments: c.arguments } : void 0;
|
|
1510
|
-
}
|
|
1511
|
-
var HoverAdapter = class {
|
|
1512
|
-
constructor(_worker) {
|
|
1513
|
-
this._worker = _worker;
|
|
1514
|
-
}
|
|
1515
|
-
provideHover(model, position, token) {
|
|
1516
|
-
let resource = model.uri;
|
|
1517
|
-
return this._worker(resource).then((worker2) => {
|
|
1518
|
-
return worker2.doHover(resource.toString(), fromPosition(position));
|
|
1519
|
-
}).then((info) => {
|
|
1520
|
-
if (!info) {
|
|
1521
|
-
return;
|
|
1522
|
-
}
|
|
1523
|
-
return {
|
|
1524
|
-
range: toRange(info.range),
|
|
1525
|
-
contents: toMarkedStringArray(info.contents)
|
|
1526
|
-
};
|
|
1527
|
-
});
|
|
1528
|
-
}
|
|
1529
|
-
};
|
|
1530
|
-
function isMarkupContent(thing) {
|
|
1531
|
-
return thing && typeof thing === "object" && typeof thing.kind === "string";
|
|
1532
|
-
}
|
|
1533
|
-
function toMarkdownString(entry) {
|
|
1534
|
-
if (typeof entry === "string") {
|
|
1535
|
-
return {
|
|
1536
|
-
value: entry
|
|
1537
|
-
};
|
|
1538
|
-
}
|
|
1539
|
-
if (isMarkupContent(entry)) {
|
|
1540
|
-
if (entry.kind === "plaintext") {
|
|
1541
|
-
return {
|
|
1542
|
-
value: entry.value.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&")
|
|
1543
|
-
};
|
|
1544
|
-
}
|
|
1545
|
-
return {
|
|
1546
|
-
value: entry.value
|
|
1547
|
-
};
|
|
1548
|
-
}
|
|
1549
|
-
return { value: "```" + entry.language + "\n" + entry.value + "\n```\n" };
|
|
1550
|
-
}
|
|
1551
|
-
function toMarkedStringArray(contents) {
|
|
1552
|
-
if (!contents) {
|
|
1553
|
-
return void 0;
|
|
1554
|
-
}
|
|
1555
|
-
if (Array.isArray(contents)) {
|
|
1556
|
-
return contents.map(toMarkdownString);
|
|
1557
|
-
}
|
|
1558
|
-
return [toMarkdownString(contents)];
|
|
1559
|
-
}
|
|
1560
|
-
var DocumentHighlightAdapter = class {
|
|
1561
|
-
constructor(_worker) {
|
|
1562
|
-
this._worker = _worker;
|
|
1563
|
-
}
|
|
1564
|
-
provideDocumentHighlights(model, position, token) {
|
|
1565
|
-
const resource = model.uri;
|
|
1566
|
-
return this._worker(resource).then((worker2) => worker2.findDocumentHighlights(resource.toString(), fromPosition(position))).then((entries) => {
|
|
1567
|
-
if (!entries) {
|
|
1568
|
-
return;
|
|
1569
|
-
}
|
|
1570
|
-
return entries.map((entry) => {
|
|
1571
|
-
return {
|
|
1572
|
-
range: toRange(entry.range),
|
|
1573
|
-
kind: toDocumentHighlightKind(entry.kind)
|
|
1574
|
-
};
|
|
1575
|
-
});
|
|
1576
|
-
});
|
|
1577
|
-
}
|
|
1578
|
-
};
|
|
1579
|
-
function toDocumentHighlightKind(kind) {
|
|
1580
|
-
switch (kind) {
|
|
1581
|
-
case DocumentHighlightKind.Read:
|
|
1582
|
-
return monaco_editor_core_exports.languages.DocumentHighlightKind.Read;
|
|
1583
|
-
case DocumentHighlightKind.Write:
|
|
1584
|
-
return monaco_editor_core_exports.languages.DocumentHighlightKind.Write;
|
|
1585
|
-
case DocumentHighlightKind.Text:
|
|
1586
|
-
return monaco_editor_core_exports.languages.DocumentHighlightKind.Text;
|
|
1587
|
-
}
|
|
1588
|
-
return monaco_editor_core_exports.languages.DocumentHighlightKind.Text;
|
|
1589
|
-
}
|
|
1590
|
-
var DefinitionAdapter = class {
|
|
1591
|
-
constructor(_worker) {
|
|
1592
|
-
this._worker = _worker;
|
|
1593
|
-
}
|
|
1594
|
-
provideDefinition(model, position, token) {
|
|
1595
|
-
const resource = model.uri;
|
|
1596
|
-
return this._worker(resource).then((worker2) => {
|
|
1597
|
-
return worker2.findDefinition(resource.toString(), fromPosition(position));
|
|
1598
|
-
}).then((definition) => {
|
|
1599
|
-
if (!definition) {
|
|
1600
|
-
return;
|
|
1601
|
-
}
|
|
1602
|
-
return [toLocation(definition)];
|
|
1603
|
-
});
|
|
1604
|
-
}
|
|
1605
|
-
};
|
|
1606
|
-
function toLocation(location) {
|
|
1607
|
-
return {
|
|
1608
|
-
uri: monaco_editor_core_exports.Uri.parse(location.uri),
|
|
1609
|
-
range: toRange(location.range)
|
|
1610
|
-
};
|
|
1611
|
-
}
|
|
1612
|
-
var ReferenceAdapter = class {
|
|
1613
|
-
constructor(_worker) {
|
|
1614
|
-
this._worker = _worker;
|
|
1615
|
-
}
|
|
1616
|
-
provideReferences(model, position, context, token) {
|
|
1617
|
-
const resource = model.uri;
|
|
1618
|
-
return this._worker(resource).then((worker2) => {
|
|
1619
|
-
return worker2.findReferences(resource.toString(), fromPosition(position));
|
|
1620
|
-
}).then((entries) => {
|
|
1621
|
-
if (!entries) {
|
|
1622
|
-
return;
|
|
1623
|
-
}
|
|
1624
|
-
return entries.map(toLocation);
|
|
1625
|
-
});
|
|
1626
|
-
}
|
|
1627
|
-
};
|
|
1628
|
-
var RenameAdapter = class {
|
|
1629
|
-
constructor(_worker) {
|
|
1630
|
-
this._worker = _worker;
|
|
1631
|
-
}
|
|
1632
|
-
provideRenameEdits(model, position, newName, token) {
|
|
1633
|
-
const resource = model.uri;
|
|
1634
|
-
return this._worker(resource).then((worker2) => {
|
|
1635
|
-
return worker2.doRename(resource.toString(), fromPosition(position), newName);
|
|
1636
|
-
}).then((edit) => {
|
|
1637
|
-
return toWorkspaceEdit(edit);
|
|
1638
|
-
});
|
|
1639
|
-
}
|
|
1640
|
-
};
|
|
1641
|
-
function toWorkspaceEdit(edit) {
|
|
1642
|
-
if (!edit || !edit.changes) {
|
|
1643
|
-
return void 0;
|
|
1644
|
-
}
|
|
1645
|
-
let resourceEdits = [];
|
|
1646
|
-
for (let uri in edit.changes) {
|
|
1647
|
-
const _uri = monaco_editor_core_exports.Uri.parse(uri);
|
|
1648
|
-
for (let e of edit.changes[uri]) {
|
|
1649
|
-
resourceEdits.push({
|
|
1650
|
-
resource: _uri,
|
|
1651
|
-
versionId: void 0,
|
|
1652
|
-
textEdit: {
|
|
1653
|
-
range: toRange(e.range),
|
|
1654
|
-
text: e.newText
|
|
1655
|
-
}
|
|
1656
|
-
});
|
|
1657
|
-
}
|
|
1658
|
-
}
|
|
1659
|
-
return {
|
|
1660
|
-
edits: resourceEdits
|
|
1661
|
-
};
|
|
1662
|
-
}
|
|
1663
|
-
var DocumentSymbolAdapter = class {
|
|
1664
|
-
constructor(_worker) {
|
|
1665
|
-
this._worker = _worker;
|
|
1666
|
-
}
|
|
1667
|
-
provideDocumentSymbols(model, token) {
|
|
1668
|
-
const resource = model.uri;
|
|
1669
|
-
return this._worker(resource).then((worker2) => worker2.findDocumentSymbols(resource.toString())).then((items) => {
|
|
1670
|
-
if (!items) {
|
|
1671
|
-
return;
|
|
1672
|
-
}
|
|
1673
|
-
return items.map((item) => {
|
|
1674
|
-
if (isDocumentSymbol(item)) {
|
|
1675
|
-
return toDocumentSymbol(item);
|
|
1676
|
-
}
|
|
1677
|
-
return {
|
|
1678
|
-
name: item.name,
|
|
1679
|
-
detail: "",
|
|
1680
|
-
containerName: item.containerName,
|
|
1681
|
-
kind: toSymbolKind(item.kind),
|
|
1682
|
-
range: toRange(item.location.range),
|
|
1683
|
-
selectionRange: toRange(item.location.range),
|
|
1684
|
-
tags: []
|
|
1685
|
-
};
|
|
1686
|
-
});
|
|
1687
|
-
});
|
|
1688
|
-
}
|
|
1689
|
-
};
|
|
1690
|
-
function isDocumentSymbol(symbol) {
|
|
1691
|
-
return "children" in symbol;
|
|
1692
|
-
}
|
|
1693
|
-
function toDocumentSymbol(symbol) {
|
|
1694
|
-
return {
|
|
1695
|
-
name: symbol.name,
|
|
1696
|
-
detail: symbol.detail ?? "",
|
|
1697
|
-
kind: toSymbolKind(symbol.kind),
|
|
1698
|
-
range: toRange(symbol.range),
|
|
1699
|
-
selectionRange: toRange(symbol.selectionRange),
|
|
1700
|
-
tags: symbol.tags ?? [],
|
|
1701
|
-
children: (symbol.children ?? []).map((item) => toDocumentSymbol(item))
|
|
1702
|
-
};
|
|
1703
|
-
}
|
|
1704
|
-
function toSymbolKind(kind) {
|
|
1705
|
-
let mKind = monaco_editor_core_exports.languages.SymbolKind;
|
|
1706
|
-
switch (kind) {
|
|
1707
|
-
case SymbolKind.File:
|
|
1708
|
-
return mKind.File;
|
|
1709
|
-
case SymbolKind.Module:
|
|
1710
|
-
return mKind.Module;
|
|
1711
|
-
case SymbolKind.Namespace:
|
|
1712
|
-
return mKind.Namespace;
|
|
1713
|
-
case SymbolKind.Package:
|
|
1714
|
-
return mKind.Package;
|
|
1715
|
-
case SymbolKind.Class:
|
|
1716
|
-
return mKind.Class;
|
|
1717
|
-
case SymbolKind.Method:
|
|
1718
|
-
return mKind.Method;
|
|
1719
|
-
case SymbolKind.Property:
|
|
1720
|
-
return mKind.Property;
|
|
1721
|
-
case SymbolKind.Field:
|
|
1722
|
-
return mKind.Field;
|
|
1723
|
-
case SymbolKind.Constructor:
|
|
1724
|
-
return mKind.Constructor;
|
|
1725
|
-
case SymbolKind.Enum:
|
|
1726
|
-
return mKind.Enum;
|
|
1727
|
-
case SymbolKind.Interface:
|
|
1728
|
-
return mKind.Interface;
|
|
1729
|
-
case SymbolKind.Function:
|
|
1730
|
-
return mKind.Function;
|
|
1731
|
-
case SymbolKind.Variable:
|
|
1732
|
-
return mKind.Variable;
|
|
1733
|
-
case SymbolKind.Constant:
|
|
1734
|
-
return mKind.Constant;
|
|
1735
|
-
case SymbolKind.String:
|
|
1736
|
-
return mKind.String;
|
|
1737
|
-
case SymbolKind.Number:
|
|
1738
|
-
return mKind.Number;
|
|
1739
|
-
case SymbolKind.Boolean:
|
|
1740
|
-
return mKind.Boolean;
|
|
1741
|
-
case SymbolKind.Array:
|
|
1742
|
-
return mKind.Array;
|
|
1743
|
-
}
|
|
1744
|
-
return mKind.Function;
|
|
1745
|
-
}
|
|
1746
|
-
var DocumentLinkAdapter = class {
|
|
1747
|
-
constructor(_worker) {
|
|
1748
|
-
this._worker = _worker;
|
|
1749
|
-
}
|
|
1750
|
-
provideLinks(model, token) {
|
|
1751
|
-
const resource = model.uri;
|
|
1752
|
-
return this._worker(resource).then((worker2) => worker2.findDocumentLinks(resource.toString())).then((items) => {
|
|
1753
|
-
if (!items) {
|
|
1754
|
-
return;
|
|
1755
|
-
}
|
|
1756
|
-
return {
|
|
1757
|
-
links: items.map((item) => ({
|
|
1758
|
-
range: toRange(item.range),
|
|
1759
|
-
url: item.target
|
|
1760
|
-
}))
|
|
1761
|
-
};
|
|
1762
|
-
});
|
|
1763
|
-
}
|
|
1764
|
-
};
|
|
1765
|
-
var DocumentFormattingEditProvider = class {
|
|
1766
|
-
constructor(_worker) {
|
|
1767
|
-
this._worker = _worker;
|
|
1768
|
-
}
|
|
1769
|
-
provideDocumentFormattingEdits(model, options, token) {
|
|
1770
|
-
const resource = model.uri;
|
|
1771
|
-
return this._worker(resource).then((worker2) => {
|
|
1772
|
-
return worker2.format(resource.toString(), null, fromFormattingOptions(options)).then((edits) => {
|
|
1773
|
-
if (!edits || edits.length === 0) {
|
|
1774
|
-
return;
|
|
1775
|
-
}
|
|
1776
|
-
return edits.map(toTextEdit);
|
|
1777
|
-
});
|
|
1778
|
-
});
|
|
1779
|
-
}
|
|
1780
|
-
};
|
|
1781
|
-
var DocumentRangeFormattingEditProvider = class {
|
|
1782
|
-
constructor(_worker) {
|
|
1783
|
-
this._worker = _worker;
|
|
1784
|
-
this.canFormatMultipleRanges = false;
|
|
1785
|
-
}
|
|
1786
|
-
provideDocumentRangeFormattingEdits(model, range, options, token) {
|
|
1787
|
-
const resource = model.uri;
|
|
1788
|
-
return this._worker(resource).then((worker2) => {
|
|
1789
|
-
return worker2.format(resource.toString(), fromRange(range), fromFormattingOptions(options)).then((edits) => {
|
|
1790
|
-
if (!edits || edits.length === 0) {
|
|
1791
|
-
return;
|
|
1792
|
-
}
|
|
1793
|
-
return edits.map(toTextEdit);
|
|
1794
|
-
});
|
|
1795
|
-
});
|
|
1796
|
-
}
|
|
1797
|
-
};
|
|
1798
|
-
function fromFormattingOptions(options) {
|
|
1799
|
-
return {
|
|
1800
|
-
tabSize: options.tabSize,
|
|
1801
|
-
insertSpaces: options.insertSpaces
|
|
1802
|
-
};
|
|
1803
|
-
}
|
|
1804
|
-
var DocumentColorAdapter = class {
|
|
1805
|
-
constructor(_worker) {
|
|
1806
|
-
this._worker = _worker;
|
|
1807
|
-
}
|
|
1808
|
-
provideDocumentColors(model, token) {
|
|
1809
|
-
const resource = model.uri;
|
|
1810
|
-
return this._worker(resource).then((worker2) => worker2.findDocumentColors(resource.toString())).then((infos) => {
|
|
1811
|
-
if (!infos) {
|
|
1812
|
-
return;
|
|
1813
|
-
}
|
|
1814
|
-
return infos.map((item) => ({
|
|
1815
|
-
color: item.color,
|
|
1816
|
-
range: toRange(item.range)
|
|
1817
|
-
}));
|
|
1818
|
-
});
|
|
1819
|
-
}
|
|
1820
|
-
provideColorPresentations(model, info, token) {
|
|
1821
|
-
const resource = model.uri;
|
|
1822
|
-
return this._worker(resource).then(
|
|
1823
|
-
(worker2) => worker2.getColorPresentations(resource.toString(), info.color, fromRange(info.range))
|
|
1824
|
-
).then((presentations) => {
|
|
1825
|
-
if (!presentations) {
|
|
1826
|
-
return;
|
|
1827
|
-
}
|
|
1828
|
-
return presentations.map((presentation) => {
|
|
1829
|
-
let item = {
|
|
1830
|
-
label: presentation.label
|
|
1831
|
-
};
|
|
1832
|
-
if (presentation.textEdit) {
|
|
1833
|
-
item.textEdit = toTextEdit(presentation.textEdit);
|
|
1834
|
-
}
|
|
1835
|
-
if (presentation.additionalTextEdits) {
|
|
1836
|
-
item.additionalTextEdits = presentation.additionalTextEdits.map(toTextEdit);
|
|
1837
|
-
}
|
|
1838
|
-
return item;
|
|
1839
|
-
});
|
|
1840
|
-
});
|
|
1841
|
-
}
|
|
1842
|
-
};
|
|
1843
|
-
var FoldingRangeAdapter = class {
|
|
1844
|
-
constructor(_worker) {
|
|
1845
|
-
this._worker = _worker;
|
|
1846
|
-
}
|
|
1847
|
-
provideFoldingRanges(model, context, token) {
|
|
1848
|
-
const resource = model.uri;
|
|
1849
|
-
return this._worker(resource).then((worker2) => worker2.getFoldingRanges(resource.toString(), context)).then((ranges) => {
|
|
1850
|
-
if (!ranges) {
|
|
1851
|
-
return;
|
|
1852
|
-
}
|
|
1853
|
-
return ranges.map((range) => {
|
|
1854
|
-
const result = {
|
|
1855
|
-
start: range.startLine + 1,
|
|
1856
|
-
end: range.endLine + 1
|
|
1857
|
-
};
|
|
1858
|
-
if (typeof range.kind !== "undefined") {
|
|
1859
|
-
result.kind = toFoldingRangeKind(range.kind);
|
|
1860
|
-
}
|
|
1861
|
-
return result;
|
|
1862
|
-
});
|
|
1863
|
-
});
|
|
1864
|
-
}
|
|
1865
|
-
};
|
|
1866
|
-
function toFoldingRangeKind(kind) {
|
|
1867
|
-
switch (kind) {
|
|
1868
|
-
case FoldingRangeKind.Comment:
|
|
1869
|
-
return monaco_editor_core_exports.languages.FoldingRangeKind.Comment;
|
|
1870
|
-
case FoldingRangeKind.Imports:
|
|
1871
|
-
return monaco_editor_core_exports.languages.FoldingRangeKind.Imports;
|
|
1872
|
-
case FoldingRangeKind.Region:
|
|
1873
|
-
return monaco_editor_core_exports.languages.FoldingRangeKind.Region;
|
|
1874
|
-
}
|
|
1875
|
-
return void 0;
|
|
1876
|
-
}
|
|
1877
|
-
var SelectionRangeAdapter = class {
|
|
1878
|
-
constructor(_worker) {
|
|
1879
|
-
this._worker = _worker;
|
|
1880
|
-
}
|
|
1881
|
-
provideSelectionRanges(model, positions, token) {
|
|
1882
|
-
const resource = model.uri;
|
|
1883
|
-
return this._worker(resource).then(
|
|
1884
|
-
(worker2) => worker2.getSelectionRanges(
|
|
1885
|
-
resource.toString(),
|
|
1886
|
-
positions.map(fromPosition)
|
|
1887
|
-
)
|
|
1888
|
-
).then((selectionRanges) => {
|
|
1889
|
-
if (!selectionRanges) {
|
|
1890
|
-
return;
|
|
1891
|
-
}
|
|
1892
|
-
return selectionRanges.map((selectionRange) => {
|
|
1893
|
-
const result = [];
|
|
1894
|
-
while (selectionRange) {
|
|
1895
|
-
result.push({ range: toRange(selectionRange.range) });
|
|
1896
|
-
selectionRange = selectionRange.parent;
|
|
1897
|
-
}
|
|
1898
|
-
return result;
|
|
1899
|
-
});
|
|
1900
|
-
});
|
|
1901
|
-
}
|
|
1902
|
-
};
|
|
1903
|
-
function createScanner(text, ignoreTrivia = false) {
|
|
1904
|
-
const len = text.length;
|
|
1905
|
-
let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
|
|
1906
|
-
function scanHexDigits(count, exact) {
|
|
1907
|
-
let digits = 0;
|
|
1908
|
-
let value2 = 0;
|
|
1909
|
-
while (digits < count || false) {
|
|
1910
|
-
let ch = text.charCodeAt(pos);
|
|
1911
|
-
if (ch >= 48 && ch <= 57) {
|
|
1912
|
-
value2 = value2 * 16 + ch - 48;
|
|
1913
|
-
} else if (ch >= 65 && ch <= 70) {
|
|
1914
|
-
value2 = value2 * 16 + ch - 65 + 10;
|
|
1915
|
-
} else if (ch >= 97 && ch <= 102) {
|
|
1916
|
-
value2 = value2 * 16 + ch - 97 + 10;
|
|
1917
|
-
} else {
|
|
1918
|
-
break;
|
|
1919
|
-
}
|
|
1920
|
-
pos++;
|
|
1921
|
-
digits++;
|
|
1922
|
-
}
|
|
1923
|
-
if (digits < count) {
|
|
1924
|
-
value2 = -1;
|
|
1925
|
-
}
|
|
1926
|
-
return value2;
|
|
1927
|
-
}
|
|
1928
|
-
function setPosition(newPosition) {
|
|
1929
|
-
pos = newPosition;
|
|
1930
|
-
value = "";
|
|
1931
|
-
tokenOffset = 0;
|
|
1932
|
-
token = 16;
|
|
1933
|
-
scanError = 0;
|
|
1934
|
-
}
|
|
1935
|
-
function scanNumber() {
|
|
1936
|
-
let start = pos;
|
|
1937
|
-
if (text.charCodeAt(pos) === 48) {
|
|
1938
|
-
pos++;
|
|
1939
|
-
} else {
|
|
1940
|
-
pos++;
|
|
1941
|
-
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
1942
|
-
pos++;
|
|
1943
|
-
}
|
|
1944
|
-
}
|
|
1945
|
-
if (pos < text.length && text.charCodeAt(pos) === 46) {
|
|
1946
|
-
pos++;
|
|
1947
|
-
if (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
1948
|
-
pos++;
|
|
1949
|
-
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
1950
|
-
pos++;
|
|
1951
|
-
}
|
|
1952
|
-
} else {
|
|
1953
|
-
scanError = 3;
|
|
1954
|
-
return text.substring(start, pos);
|
|
1955
|
-
}
|
|
1956
|
-
}
|
|
1957
|
-
let end = pos;
|
|
1958
|
-
if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) {
|
|
1959
|
-
pos++;
|
|
1960
|
-
if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {
|
|
1961
|
-
pos++;
|
|
1962
|
-
}
|
|
1963
|
-
if (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
1964
|
-
pos++;
|
|
1965
|
-
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
1966
|
-
pos++;
|
|
1967
|
-
}
|
|
1968
|
-
end = pos;
|
|
1969
|
-
} else {
|
|
1970
|
-
scanError = 3;
|
|
1971
|
-
}
|
|
1972
|
-
}
|
|
1973
|
-
return text.substring(start, end);
|
|
1974
|
-
}
|
|
1975
|
-
function scanString() {
|
|
1976
|
-
let result = "", start = pos;
|
|
1977
|
-
while (true) {
|
|
1978
|
-
if (pos >= len) {
|
|
1979
|
-
result += text.substring(start, pos);
|
|
1980
|
-
scanError = 2;
|
|
1981
|
-
break;
|
|
1982
|
-
}
|
|
1983
|
-
const ch = text.charCodeAt(pos);
|
|
1984
|
-
if (ch === 34) {
|
|
1985
|
-
result += text.substring(start, pos);
|
|
1986
|
-
pos++;
|
|
1987
|
-
break;
|
|
1988
|
-
}
|
|
1989
|
-
if (ch === 92) {
|
|
1990
|
-
result += text.substring(start, pos);
|
|
1991
|
-
pos++;
|
|
1992
|
-
if (pos >= len) {
|
|
1993
|
-
scanError = 2;
|
|
1994
|
-
break;
|
|
1995
|
-
}
|
|
1996
|
-
const ch2 = text.charCodeAt(pos++);
|
|
1997
|
-
switch (ch2) {
|
|
1998
|
-
case 34:
|
|
1999
|
-
result += '"';
|
|
2000
|
-
break;
|
|
2001
|
-
case 92:
|
|
2002
|
-
result += "\\";
|
|
2003
|
-
break;
|
|
2004
|
-
case 47:
|
|
2005
|
-
result += "/";
|
|
2006
|
-
break;
|
|
2007
|
-
case 98:
|
|
2008
|
-
result += "\b";
|
|
2009
|
-
break;
|
|
2010
|
-
case 102:
|
|
2011
|
-
result += "\f";
|
|
2012
|
-
break;
|
|
2013
|
-
case 110:
|
|
2014
|
-
result += "\n";
|
|
2015
|
-
break;
|
|
2016
|
-
case 114:
|
|
2017
|
-
result += "\r";
|
|
2018
|
-
break;
|
|
2019
|
-
case 116:
|
|
2020
|
-
result += " ";
|
|
2021
|
-
break;
|
|
2022
|
-
case 117:
|
|
2023
|
-
const ch3 = scanHexDigits(4);
|
|
2024
|
-
if (ch3 >= 0) {
|
|
2025
|
-
result += String.fromCharCode(ch3);
|
|
2026
|
-
} else {
|
|
2027
|
-
scanError = 4;
|
|
2028
|
-
}
|
|
2029
|
-
break;
|
|
2030
|
-
default:
|
|
2031
|
-
scanError = 5;
|
|
2032
|
-
}
|
|
2033
|
-
start = pos;
|
|
2034
|
-
continue;
|
|
2035
|
-
}
|
|
2036
|
-
if (ch >= 0 && ch <= 31) {
|
|
2037
|
-
if (isLineBreak(ch)) {
|
|
2038
|
-
result += text.substring(start, pos);
|
|
2039
|
-
scanError = 2;
|
|
2040
|
-
break;
|
|
2041
|
-
} else {
|
|
2042
|
-
scanError = 6;
|
|
2043
|
-
}
|
|
2044
|
-
}
|
|
2045
|
-
pos++;
|
|
2046
|
-
}
|
|
2047
|
-
return result;
|
|
2048
|
-
}
|
|
2049
|
-
function scanNext() {
|
|
2050
|
-
value = "";
|
|
2051
|
-
scanError = 0;
|
|
2052
|
-
tokenOffset = pos;
|
|
2053
|
-
lineStartOffset = lineNumber;
|
|
2054
|
-
prevTokenLineStartOffset = tokenLineStartOffset;
|
|
2055
|
-
if (pos >= len) {
|
|
2056
|
-
tokenOffset = len;
|
|
2057
|
-
return token = 17;
|
|
2058
|
-
}
|
|
2059
|
-
let code = text.charCodeAt(pos);
|
|
2060
|
-
if (isWhiteSpace(code)) {
|
|
2061
|
-
do {
|
|
2062
|
-
pos++;
|
|
2063
|
-
value += String.fromCharCode(code);
|
|
2064
|
-
code = text.charCodeAt(pos);
|
|
2065
|
-
} while (isWhiteSpace(code));
|
|
2066
|
-
return token = 15;
|
|
2067
|
-
}
|
|
2068
|
-
if (isLineBreak(code)) {
|
|
2069
|
-
pos++;
|
|
2070
|
-
value += String.fromCharCode(code);
|
|
2071
|
-
if (code === 13 && text.charCodeAt(pos) === 10) {
|
|
2072
|
-
pos++;
|
|
2073
|
-
value += "\n";
|
|
2074
|
-
}
|
|
2075
|
-
lineNumber++;
|
|
2076
|
-
tokenLineStartOffset = pos;
|
|
2077
|
-
return token = 14;
|
|
2078
|
-
}
|
|
2079
|
-
switch (code) {
|
|
2080
|
-
case 123:
|
|
2081
|
-
pos++;
|
|
2082
|
-
return token = 1;
|
|
2083
|
-
case 125:
|
|
2084
|
-
pos++;
|
|
2085
|
-
return token = 2;
|
|
2086
|
-
case 91:
|
|
2087
|
-
pos++;
|
|
2088
|
-
return token = 3;
|
|
2089
|
-
case 93:
|
|
2090
|
-
pos++;
|
|
2091
|
-
return token = 4;
|
|
2092
|
-
case 58:
|
|
2093
|
-
pos++;
|
|
2094
|
-
return token = 6;
|
|
2095
|
-
case 44:
|
|
2096
|
-
pos++;
|
|
2097
|
-
return token = 5;
|
|
2098
|
-
case 34:
|
|
2099
|
-
pos++;
|
|
2100
|
-
value = scanString();
|
|
2101
|
-
return token = 10;
|
|
2102
|
-
case 47:
|
|
2103
|
-
const start = pos - 1;
|
|
2104
|
-
if (text.charCodeAt(pos + 1) === 47) {
|
|
2105
|
-
pos += 2;
|
|
2106
|
-
while (pos < len) {
|
|
2107
|
-
if (isLineBreak(text.charCodeAt(pos))) {
|
|
2108
|
-
break;
|
|
2109
|
-
}
|
|
2110
|
-
pos++;
|
|
2111
|
-
}
|
|
2112
|
-
value = text.substring(start, pos);
|
|
2113
|
-
return token = 12;
|
|
2114
|
-
}
|
|
2115
|
-
if (text.charCodeAt(pos + 1) === 42) {
|
|
2116
|
-
pos += 2;
|
|
2117
|
-
const safeLength = len - 1;
|
|
2118
|
-
let commentClosed = false;
|
|
2119
|
-
while (pos < safeLength) {
|
|
2120
|
-
const ch = text.charCodeAt(pos);
|
|
2121
|
-
if (ch === 42 && text.charCodeAt(pos + 1) === 47) {
|
|
2122
|
-
pos += 2;
|
|
2123
|
-
commentClosed = true;
|
|
2124
|
-
break;
|
|
2125
|
-
}
|
|
2126
|
-
pos++;
|
|
2127
|
-
if (isLineBreak(ch)) {
|
|
2128
|
-
if (ch === 13 && text.charCodeAt(pos) === 10) {
|
|
2129
|
-
pos++;
|
|
2130
|
-
}
|
|
2131
|
-
lineNumber++;
|
|
2132
|
-
tokenLineStartOffset = pos;
|
|
2133
|
-
}
|
|
2134
|
-
}
|
|
2135
|
-
if (!commentClosed) {
|
|
2136
|
-
pos++;
|
|
2137
|
-
scanError = 1;
|
|
2138
|
-
}
|
|
2139
|
-
value = text.substring(start, pos);
|
|
2140
|
-
return token = 13;
|
|
2141
|
-
}
|
|
2142
|
-
value += String.fromCharCode(code);
|
|
2143
|
-
pos++;
|
|
2144
|
-
return token = 16;
|
|
2145
|
-
case 45:
|
|
2146
|
-
value += String.fromCharCode(code);
|
|
2147
|
-
pos++;
|
|
2148
|
-
if (pos === len || !isDigit(text.charCodeAt(pos))) {
|
|
2149
|
-
return token = 16;
|
|
2150
|
-
}
|
|
2151
|
-
case 48:
|
|
2152
|
-
case 49:
|
|
2153
|
-
case 50:
|
|
2154
|
-
case 51:
|
|
2155
|
-
case 52:
|
|
2156
|
-
case 53:
|
|
2157
|
-
case 54:
|
|
2158
|
-
case 55:
|
|
2159
|
-
case 56:
|
|
2160
|
-
case 57:
|
|
2161
|
-
value += scanNumber();
|
|
2162
|
-
return token = 11;
|
|
2163
|
-
default:
|
|
2164
|
-
while (pos < len && isUnknownContentCharacter(code)) {
|
|
2165
|
-
pos++;
|
|
2166
|
-
code = text.charCodeAt(pos);
|
|
2167
|
-
}
|
|
2168
|
-
if (tokenOffset !== pos) {
|
|
2169
|
-
value = text.substring(tokenOffset, pos);
|
|
2170
|
-
switch (value) {
|
|
2171
|
-
case "true":
|
|
2172
|
-
return token = 8;
|
|
2173
|
-
case "false":
|
|
2174
|
-
return token = 9;
|
|
2175
|
-
case "null":
|
|
2176
|
-
return token = 7;
|
|
2177
|
-
}
|
|
2178
|
-
return token = 16;
|
|
2179
|
-
}
|
|
2180
|
-
value += String.fromCharCode(code);
|
|
2181
|
-
pos++;
|
|
2182
|
-
return token = 16;
|
|
2183
|
-
}
|
|
2184
|
-
}
|
|
2185
|
-
function isUnknownContentCharacter(code) {
|
|
2186
|
-
if (isWhiteSpace(code) || isLineBreak(code)) {
|
|
2187
|
-
return false;
|
|
2188
|
-
}
|
|
2189
|
-
switch (code) {
|
|
2190
|
-
case 125:
|
|
2191
|
-
case 93:
|
|
2192
|
-
case 123:
|
|
2193
|
-
case 91:
|
|
2194
|
-
case 34:
|
|
2195
|
-
case 58:
|
|
2196
|
-
case 44:
|
|
2197
|
-
case 47:
|
|
2198
|
-
return false;
|
|
2199
|
-
}
|
|
2200
|
-
return true;
|
|
2201
|
-
}
|
|
2202
|
-
function scanNextNonTrivia() {
|
|
2203
|
-
let result;
|
|
2204
|
-
do {
|
|
2205
|
-
result = scanNext();
|
|
2206
|
-
} while (result >= 12 && result <= 15);
|
|
2207
|
-
return result;
|
|
2208
|
-
}
|
|
2209
|
-
return {
|
|
2210
|
-
setPosition,
|
|
2211
|
-
getPosition: () => pos,
|
|
2212
|
-
scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
|
|
2213
|
-
getToken: () => token,
|
|
2214
|
-
getTokenValue: () => value,
|
|
2215
|
-
getTokenOffset: () => tokenOffset,
|
|
2216
|
-
getTokenLength: () => pos - tokenOffset,
|
|
2217
|
-
getTokenStartLine: () => lineStartOffset,
|
|
2218
|
-
getTokenStartCharacter: () => tokenOffset - prevTokenLineStartOffset,
|
|
2219
|
-
getTokenError: () => scanError
|
|
2220
|
-
};
|
|
2221
|
-
}
|
|
2222
|
-
function isWhiteSpace(ch) {
|
|
2223
|
-
return ch === 32 || ch === 9;
|
|
2224
|
-
}
|
|
2225
|
-
function isLineBreak(ch) {
|
|
2226
|
-
return ch === 10 || ch === 13;
|
|
2227
|
-
}
|
|
2228
|
-
function isDigit(ch) {
|
|
2229
|
-
return ch >= 48 && ch <= 57;
|
|
2230
|
-
}
|
|
2231
|
-
var CharacterCodes;
|
|
2232
|
-
(function(CharacterCodes2) {
|
|
2233
|
-
CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed";
|
|
2234
|
-
CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn";
|
|
2235
|
-
CharacterCodes2[CharacterCodes2["space"] = 32] = "space";
|
|
2236
|
-
CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0";
|
|
2237
|
-
CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1";
|
|
2238
|
-
CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2";
|
|
2239
|
-
CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3";
|
|
2240
|
-
CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4";
|
|
2241
|
-
CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5";
|
|
2242
|
-
CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6";
|
|
2243
|
-
CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7";
|
|
2244
|
-
CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8";
|
|
2245
|
-
CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9";
|
|
2246
|
-
CharacterCodes2[CharacterCodes2["a"] = 97] = "a";
|
|
2247
|
-
CharacterCodes2[CharacterCodes2["b"] = 98] = "b";
|
|
2248
|
-
CharacterCodes2[CharacterCodes2["c"] = 99] = "c";
|
|
2249
|
-
CharacterCodes2[CharacterCodes2["d"] = 100] = "d";
|
|
2250
|
-
CharacterCodes2[CharacterCodes2["e"] = 101] = "e";
|
|
2251
|
-
CharacterCodes2[CharacterCodes2["f"] = 102] = "f";
|
|
2252
|
-
CharacterCodes2[CharacterCodes2["g"] = 103] = "g";
|
|
2253
|
-
CharacterCodes2[CharacterCodes2["h"] = 104] = "h";
|
|
2254
|
-
CharacterCodes2[CharacterCodes2["i"] = 105] = "i";
|
|
2255
|
-
CharacterCodes2[CharacterCodes2["j"] = 106] = "j";
|
|
2256
|
-
CharacterCodes2[CharacterCodes2["k"] = 107] = "k";
|
|
2257
|
-
CharacterCodes2[CharacterCodes2["l"] = 108] = "l";
|
|
2258
|
-
CharacterCodes2[CharacterCodes2["m"] = 109] = "m";
|
|
2259
|
-
CharacterCodes2[CharacterCodes2["n"] = 110] = "n";
|
|
2260
|
-
CharacterCodes2[CharacterCodes2["o"] = 111] = "o";
|
|
2261
|
-
CharacterCodes2[CharacterCodes2["p"] = 112] = "p";
|
|
2262
|
-
CharacterCodes2[CharacterCodes2["q"] = 113] = "q";
|
|
2263
|
-
CharacterCodes2[CharacterCodes2["r"] = 114] = "r";
|
|
2264
|
-
CharacterCodes2[CharacterCodes2["s"] = 115] = "s";
|
|
2265
|
-
CharacterCodes2[CharacterCodes2["t"] = 116] = "t";
|
|
2266
|
-
CharacterCodes2[CharacterCodes2["u"] = 117] = "u";
|
|
2267
|
-
CharacterCodes2[CharacterCodes2["v"] = 118] = "v";
|
|
2268
|
-
CharacterCodes2[CharacterCodes2["w"] = 119] = "w";
|
|
2269
|
-
CharacterCodes2[CharacterCodes2["x"] = 120] = "x";
|
|
2270
|
-
CharacterCodes2[CharacterCodes2["y"] = 121] = "y";
|
|
2271
|
-
CharacterCodes2[CharacterCodes2["z"] = 122] = "z";
|
|
2272
|
-
CharacterCodes2[CharacterCodes2["A"] = 65] = "A";
|
|
2273
|
-
CharacterCodes2[CharacterCodes2["B"] = 66] = "B";
|
|
2274
|
-
CharacterCodes2[CharacterCodes2["C"] = 67] = "C";
|
|
2275
|
-
CharacterCodes2[CharacterCodes2["D"] = 68] = "D";
|
|
2276
|
-
CharacterCodes2[CharacterCodes2["E"] = 69] = "E";
|
|
2277
|
-
CharacterCodes2[CharacterCodes2["F"] = 70] = "F";
|
|
2278
|
-
CharacterCodes2[CharacterCodes2["G"] = 71] = "G";
|
|
2279
|
-
CharacterCodes2[CharacterCodes2["H"] = 72] = "H";
|
|
2280
|
-
CharacterCodes2[CharacterCodes2["I"] = 73] = "I";
|
|
2281
|
-
CharacterCodes2[CharacterCodes2["J"] = 74] = "J";
|
|
2282
|
-
CharacterCodes2[CharacterCodes2["K"] = 75] = "K";
|
|
2283
|
-
CharacterCodes2[CharacterCodes2["L"] = 76] = "L";
|
|
2284
|
-
CharacterCodes2[CharacterCodes2["M"] = 77] = "M";
|
|
2285
|
-
CharacterCodes2[CharacterCodes2["N"] = 78] = "N";
|
|
2286
|
-
CharacterCodes2[CharacterCodes2["O"] = 79] = "O";
|
|
2287
|
-
CharacterCodes2[CharacterCodes2["P"] = 80] = "P";
|
|
2288
|
-
CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q";
|
|
2289
|
-
CharacterCodes2[CharacterCodes2["R"] = 82] = "R";
|
|
2290
|
-
CharacterCodes2[CharacterCodes2["S"] = 83] = "S";
|
|
2291
|
-
CharacterCodes2[CharacterCodes2["T"] = 84] = "T";
|
|
2292
|
-
CharacterCodes2[CharacterCodes2["U"] = 85] = "U";
|
|
2293
|
-
CharacterCodes2[CharacterCodes2["V"] = 86] = "V";
|
|
2294
|
-
CharacterCodes2[CharacterCodes2["W"] = 87] = "W";
|
|
2295
|
-
CharacterCodes2[CharacterCodes2["X"] = 88] = "X";
|
|
2296
|
-
CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y";
|
|
2297
|
-
CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z";
|
|
2298
|
-
CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk";
|
|
2299
|
-
CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash";
|
|
2300
|
-
CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace";
|
|
2301
|
-
CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket";
|
|
2302
|
-
CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon";
|
|
2303
|
-
CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma";
|
|
2304
|
-
CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot";
|
|
2305
|
-
CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote";
|
|
2306
|
-
CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus";
|
|
2307
|
-
CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace";
|
|
2308
|
-
CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket";
|
|
2309
|
-
CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus";
|
|
2310
|
-
CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash";
|
|
2311
|
-
CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed";
|
|
2312
|
-
CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab";
|
|
2313
|
-
})(CharacterCodes || (CharacterCodes = {}));
|
|
2314
|
-
new Array(20).fill(0).map((_, index) => {
|
|
2315
|
-
return " ".repeat(index);
|
|
2316
|
-
});
|
|
2317
|
-
var maxCachedValues = 200;
|
|
2318
|
-
({
|
|
2319
|
-
" ": {
|
|
2320
|
-
"\n": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
2321
|
-
return "\n" + " ".repeat(index);
|
|
2322
|
-
}),
|
|
2323
|
-
"\r": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
2324
|
-
return "\r" + " ".repeat(index);
|
|
2325
|
-
}),
|
|
2326
|
-
"\r\n": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
2327
|
-
return "\r\n" + " ".repeat(index);
|
|
2328
|
-
})
|
|
2329
|
-
},
|
|
2330
|
-
" ": {
|
|
2331
|
-
"\n": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
2332
|
-
return "\n" + " ".repeat(index);
|
|
2333
|
-
}),
|
|
2334
|
-
"\r": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
2335
|
-
return "\r" + " ".repeat(index);
|
|
2336
|
-
}),
|
|
2337
|
-
"\r\n": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
2338
|
-
return "\r\n" + " ".repeat(index);
|
|
2339
|
-
})
|
|
2340
|
-
}
|
|
2341
|
-
});
|
|
2342
|
-
var ParseOptions;
|
|
2343
|
-
(function(ParseOptions2) {
|
|
2344
|
-
ParseOptions2.DEFAULT = {
|
|
2345
|
-
allowTrailingComma: false
|
|
2346
|
-
};
|
|
2347
|
-
})(ParseOptions || (ParseOptions = {}));
|
|
2348
|
-
var createScanner2 = createScanner;
|
|
2349
|
-
var ScanError;
|
|
2350
|
-
(function(ScanError2) {
|
|
2351
|
-
ScanError2[ScanError2["None"] = 0] = "None";
|
|
2352
|
-
ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
|
|
2353
|
-
ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
|
|
2354
|
-
ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
|
|
2355
|
-
ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode";
|
|
2356
|
-
ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
|
|
2357
|
-
ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter";
|
|
2358
|
-
})(ScanError || (ScanError = {}));
|
|
2359
|
-
var SyntaxKind;
|
|
2360
|
-
(function(SyntaxKind2) {
|
|
2361
|
-
SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken";
|
|
2362
|
-
SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken";
|
|
2363
|
-
SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken";
|
|
2364
|
-
SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken";
|
|
2365
|
-
SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken";
|
|
2366
|
-
SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken";
|
|
2367
|
-
SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword";
|
|
2368
|
-
SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword";
|
|
2369
|
-
SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword";
|
|
2370
|
-
SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral";
|
|
2371
|
-
SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral";
|
|
2372
|
-
SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia";
|
|
2373
|
-
SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
|
|
2374
|
-
SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia";
|
|
2375
|
-
SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia";
|
|
2376
|
-
SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
|
|
2377
|
-
SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
|
|
2378
|
-
})(SyntaxKind || (SyntaxKind = {}));
|
|
2379
|
-
var ParseErrorCode;
|
|
2380
|
-
(function(ParseErrorCode2) {
|
|
2381
|
-
ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
|
|
2382
|
-
ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
|
|
2383
|
-
ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected";
|
|
2384
|
-
ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected";
|
|
2385
|
-
ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected";
|
|
2386
|
-
ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected";
|
|
2387
|
-
ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected";
|
|
2388
|
-
ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected";
|
|
2389
|
-
ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected";
|
|
2390
|
-
ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken";
|
|
2391
|
-
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
|
|
2392
|
-
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
|
|
2393
|
-
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
|
|
2394
|
-
ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode";
|
|
2395
|
-
ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
|
|
2396
|
-
ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
|
|
2397
|
-
})(ParseErrorCode || (ParseErrorCode = {}));
|
|
2398
|
-
function createTokenizationSupport(supportComments) {
|
|
2399
|
-
return {
|
|
2400
|
-
getInitialState: () => new JSONState(null, null, false, null),
|
|
2401
|
-
tokenize: (line, state) => tokenize(supportComments, line, state)
|
|
2402
|
-
};
|
|
2403
|
-
}
|
|
2404
|
-
var TOKEN_DELIM_OBJECT = "delimiter.bracket.json";
|
|
2405
|
-
var TOKEN_DELIM_ARRAY = "delimiter.array.json";
|
|
2406
|
-
var TOKEN_DELIM_COLON = "delimiter.colon.json";
|
|
2407
|
-
var TOKEN_DELIM_COMMA = "delimiter.comma.json";
|
|
2408
|
-
var TOKEN_VALUE_BOOLEAN = "keyword.json";
|
|
2409
|
-
var TOKEN_VALUE_NULL = "keyword.json";
|
|
2410
|
-
var TOKEN_VALUE_STRING = "string.value.json";
|
|
2411
|
-
var TOKEN_VALUE_NUMBER = "number.json";
|
|
2412
|
-
var TOKEN_PROPERTY_NAME = "string.key.json";
|
|
2413
|
-
var TOKEN_COMMENT_BLOCK = "comment.block.json";
|
|
2414
|
-
var TOKEN_COMMENT_LINE = "comment.line.json";
|
|
2415
|
-
var ParentsStack = class _ParentsStack {
|
|
2416
|
-
constructor(parent, type) {
|
|
2417
|
-
this.parent = parent;
|
|
2418
|
-
this.type = type;
|
|
2419
|
-
}
|
|
2420
|
-
static pop(parents) {
|
|
2421
|
-
if (parents) {
|
|
2422
|
-
return parents.parent;
|
|
2423
|
-
}
|
|
2424
|
-
return null;
|
|
2425
|
-
}
|
|
2426
|
-
static push(parents, type) {
|
|
2427
|
-
return new _ParentsStack(parents, type);
|
|
2428
|
-
}
|
|
2429
|
-
static equals(a, b) {
|
|
2430
|
-
if (!a && !b) {
|
|
2431
|
-
return true;
|
|
2432
|
-
}
|
|
2433
|
-
if (!a || !b) {
|
|
2434
|
-
return false;
|
|
2435
|
-
}
|
|
2436
|
-
while (a && b) {
|
|
2437
|
-
if (a === b) {
|
|
2438
|
-
return true;
|
|
2439
|
-
}
|
|
2440
|
-
if (a.type !== b.type) {
|
|
2441
|
-
return false;
|
|
2442
|
-
}
|
|
2443
|
-
a = a.parent;
|
|
2444
|
-
b = b.parent;
|
|
2445
|
-
}
|
|
2446
|
-
return true;
|
|
2447
|
-
}
|
|
2448
|
-
};
|
|
2449
|
-
var JSONState = class _JSONState {
|
|
2450
|
-
constructor(state, scanError, lastWasColon, parents) {
|
|
2451
|
-
this._state = state;
|
|
2452
|
-
this.scanError = scanError;
|
|
2453
|
-
this.lastWasColon = lastWasColon;
|
|
2454
|
-
this.parents = parents;
|
|
2455
|
-
}
|
|
2456
|
-
clone() {
|
|
2457
|
-
return new _JSONState(this._state, this.scanError, this.lastWasColon, this.parents);
|
|
2458
|
-
}
|
|
2459
|
-
equals(other) {
|
|
2460
|
-
if (other === this) {
|
|
2461
|
-
return true;
|
|
2462
|
-
}
|
|
2463
|
-
if (!other || !(other instanceof _JSONState)) {
|
|
2464
|
-
return false;
|
|
2465
|
-
}
|
|
2466
|
-
return this.scanError === other.scanError && this.lastWasColon === other.lastWasColon && ParentsStack.equals(this.parents, other.parents);
|
|
2467
|
-
}
|
|
2468
|
-
getStateData() {
|
|
2469
|
-
return this._state;
|
|
2470
|
-
}
|
|
2471
|
-
setStateData(state) {
|
|
2472
|
-
this._state = state;
|
|
2473
|
-
}
|
|
2474
|
-
};
|
|
2475
|
-
function tokenize(comments, line, state, offsetDelta = 0) {
|
|
2476
|
-
let numberOfInsertedCharacters = 0;
|
|
2477
|
-
let adjustOffset = false;
|
|
2478
|
-
switch (state.scanError) {
|
|
2479
|
-
case 2:
|
|
2480
|
-
line = '"' + line;
|
|
2481
|
-
numberOfInsertedCharacters = 1;
|
|
2482
|
-
break;
|
|
2483
|
-
case 1:
|
|
2484
|
-
line = "/*" + line;
|
|
2485
|
-
numberOfInsertedCharacters = 2;
|
|
2486
|
-
break;
|
|
2487
|
-
}
|
|
2488
|
-
const scanner = createScanner2(line);
|
|
2489
|
-
let lastWasColon = state.lastWasColon;
|
|
2490
|
-
let parents = state.parents;
|
|
2491
|
-
const ret = {
|
|
2492
|
-
tokens: [],
|
|
2493
|
-
endState: state.clone()
|
|
2494
|
-
};
|
|
2495
|
-
while (true) {
|
|
2496
|
-
let offset = offsetDelta + scanner.getPosition();
|
|
2497
|
-
let type = "";
|
|
2498
|
-
const kind = scanner.scan();
|
|
2499
|
-
if (kind === 17) {
|
|
2500
|
-
break;
|
|
2501
|
-
}
|
|
2502
|
-
if (offset === offsetDelta + scanner.getPosition()) {
|
|
2503
|
-
throw new Error(
|
|
2504
|
-
"Scanner did not advance, next 3 characters are: " + line.substr(scanner.getPosition(), 3)
|
|
2505
|
-
);
|
|
2506
|
-
}
|
|
2507
|
-
if (adjustOffset) {
|
|
2508
|
-
offset -= numberOfInsertedCharacters;
|
|
2509
|
-
}
|
|
2510
|
-
adjustOffset = numberOfInsertedCharacters > 0;
|
|
2511
|
-
switch (kind) {
|
|
2512
|
-
case 1:
|
|
2513
|
-
parents = ParentsStack.push(
|
|
2514
|
-
parents,
|
|
2515
|
-
0
|
|
2516
|
-
/* Object */
|
|
2517
|
-
);
|
|
2518
|
-
type = TOKEN_DELIM_OBJECT;
|
|
2519
|
-
lastWasColon = false;
|
|
2520
|
-
break;
|
|
2521
|
-
case 2:
|
|
2522
|
-
parents = ParentsStack.pop(parents);
|
|
2523
|
-
type = TOKEN_DELIM_OBJECT;
|
|
2524
|
-
lastWasColon = false;
|
|
2525
|
-
break;
|
|
2526
|
-
case 3:
|
|
2527
|
-
parents = ParentsStack.push(
|
|
2528
|
-
parents,
|
|
2529
|
-
1
|
|
2530
|
-
/* Array */
|
|
2531
|
-
);
|
|
2532
|
-
type = TOKEN_DELIM_ARRAY;
|
|
2533
|
-
lastWasColon = false;
|
|
2534
|
-
break;
|
|
2535
|
-
case 4:
|
|
2536
|
-
parents = ParentsStack.pop(parents);
|
|
2537
|
-
type = TOKEN_DELIM_ARRAY;
|
|
2538
|
-
lastWasColon = false;
|
|
2539
|
-
break;
|
|
2540
|
-
case 6:
|
|
2541
|
-
type = TOKEN_DELIM_COLON;
|
|
2542
|
-
lastWasColon = true;
|
|
2543
|
-
break;
|
|
2544
|
-
case 5:
|
|
2545
|
-
type = TOKEN_DELIM_COMMA;
|
|
2546
|
-
lastWasColon = false;
|
|
2547
|
-
break;
|
|
2548
|
-
case 8:
|
|
2549
|
-
case 9:
|
|
2550
|
-
type = TOKEN_VALUE_BOOLEAN;
|
|
2551
|
-
lastWasColon = false;
|
|
2552
|
-
break;
|
|
2553
|
-
case 7:
|
|
2554
|
-
type = TOKEN_VALUE_NULL;
|
|
2555
|
-
lastWasColon = false;
|
|
2556
|
-
break;
|
|
2557
|
-
case 10:
|
|
2558
|
-
const currentParent = parents ? parents.type : 0;
|
|
2559
|
-
const inArray = currentParent === 1;
|
|
2560
|
-
type = lastWasColon || inArray ? TOKEN_VALUE_STRING : TOKEN_PROPERTY_NAME;
|
|
2561
|
-
lastWasColon = false;
|
|
2562
|
-
break;
|
|
2563
|
-
case 11:
|
|
2564
|
-
type = TOKEN_VALUE_NUMBER;
|
|
2565
|
-
lastWasColon = false;
|
|
2566
|
-
break;
|
|
2567
|
-
}
|
|
2568
|
-
{
|
|
2569
|
-
switch (kind) {
|
|
2570
|
-
case 12:
|
|
2571
|
-
type = TOKEN_COMMENT_LINE;
|
|
2572
|
-
break;
|
|
2573
|
-
case 13:
|
|
2574
|
-
type = TOKEN_COMMENT_BLOCK;
|
|
2575
|
-
break;
|
|
2576
|
-
}
|
|
2577
|
-
}
|
|
2578
|
-
ret.endState = new JSONState(
|
|
2579
|
-
state.getStateData(),
|
|
2580
|
-
scanner.getTokenError(),
|
|
2581
|
-
lastWasColon,
|
|
2582
|
-
parents
|
|
2583
|
-
);
|
|
2584
|
-
ret.tokens.push({
|
|
2585
|
-
startIndex: offset,
|
|
2586
|
-
scopes: type
|
|
2587
|
-
});
|
|
2588
|
-
}
|
|
2589
|
-
return ret;
|
|
2590
|
-
}
|
|
2591
|
-
var worker;
|
|
2592
|
-
function getWorker() {
|
|
2593
|
-
return new Promise((resolve, reject) => {
|
|
2594
|
-
if (!worker) {
|
|
2595
|
-
return reject("JSON not registered!");
|
|
2596
|
-
}
|
|
2597
|
-
resolve(worker);
|
|
2598
|
-
});
|
|
2599
|
-
}
|
|
2600
|
-
var JSONDiagnosticsAdapter = class extends DiagnosticsAdapter {
|
|
2601
|
-
constructor(languageId, worker2, defaults) {
|
|
2602
|
-
super(languageId, worker2, defaults.onDidChange);
|
|
2603
|
-
this._disposables.push(
|
|
2604
|
-
monaco_editor_core_exports.editor.onWillDisposeModel((model) => {
|
|
2605
|
-
this._resetSchema(model.uri);
|
|
2606
|
-
})
|
|
2607
|
-
);
|
|
2608
|
-
this._disposables.push(
|
|
2609
|
-
monaco_editor_core_exports.editor.onDidChangeModelLanguage((event) => {
|
|
2610
|
-
this._resetSchema(event.model.uri);
|
|
2611
|
-
})
|
|
2612
|
-
);
|
|
2613
|
-
}
|
|
2614
|
-
_resetSchema(resource) {
|
|
2615
|
-
this._worker().then((worker2) => {
|
|
2616
|
-
worker2.resetSchema(resource.toString());
|
|
2617
|
-
});
|
|
2618
|
-
}
|
|
2619
|
-
};
|
|
2620
|
-
function setupMode(defaults) {
|
|
2621
|
-
const disposables = [];
|
|
2622
|
-
const providers = [];
|
|
2623
|
-
const client = new WorkerManager(defaults);
|
|
2624
|
-
disposables.push(client);
|
|
2625
|
-
worker = (...uris) => {
|
|
2626
|
-
return client.getLanguageServiceWorker(...uris);
|
|
2627
|
-
};
|
|
2628
|
-
function registerProviders() {
|
|
2629
|
-
const { languageId, modeConfiguration: modeConfiguration2 } = defaults;
|
|
2630
|
-
disposeAll(providers);
|
|
2631
|
-
if (modeConfiguration2.documentFormattingEdits) {
|
|
2632
|
-
providers.push(
|
|
2633
|
-
monaco_editor_core_exports.languages.registerDocumentFormattingEditProvider(
|
|
2634
|
-
languageId,
|
|
2635
|
-
new DocumentFormattingEditProvider(worker)
|
|
2636
|
-
)
|
|
2637
|
-
);
|
|
2638
|
-
}
|
|
2639
|
-
if (modeConfiguration2.documentRangeFormattingEdits) {
|
|
2640
|
-
providers.push(
|
|
2641
|
-
monaco_editor_core_exports.languages.registerDocumentRangeFormattingEditProvider(
|
|
2642
|
-
languageId,
|
|
2643
|
-
new DocumentRangeFormattingEditProvider(worker)
|
|
2644
|
-
)
|
|
2645
|
-
);
|
|
2646
|
-
}
|
|
2647
|
-
if (modeConfiguration2.completionItems) {
|
|
2648
|
-
providers.push(
|
|
2649
|
-
monaco_editor_core_exports.languages.registerCompletionItemProvider(
|
|
2650
|
-
languageId,
|
|
2651
|
-
new CompletionAdapter(worker, [" ", ":", '"'])
|
|
2652
|
-
)
|
|
2653
|
-
);
|
|
2654
|
-
}
|
|
2655
|
-
if (modeConfiguration2.hovers) {
|
|
2656
|
-
providers.push(
|
|
2657
|
-
monaco_editor_core_exports.languages.registerHoverProvider(languageId, new HoverAdapter(worker))
|
|
2658
|
-
);
|
|
2659
|
-
}
|
|
2660
|
-
if (modeConfiguration2.documentSymbols) {
|
|
2661
|
-
providers.push(
|
|
2662
|
-
monaco_editor_core_exports.languages.registerDocumentSymbolProvider(
|
|
2663
|
-
languageId,
|
|
2664
|
-
new DocumentSymbolAdapter(worker)
|
|
2665
|
-
)
|
|
2666
|
-
);
|
|
2667
|
-
}
|
|
2668
|
-
if (modeConfiguration2.tokens) {
|
|
2669
|
-
providers.push(monaco_editor_core_exports.languages.setTokensProvider(languageId, createTokenizationSupport(true)));
|
|
2670
|
-
}
|
|
2671
|
-
if (modeConfiguration2.colors) {
|
|
2672
|
-
providers.push(
|
|
2673
|
-
monaco_editor_core_exports.languages.registerColorProvider(
|
|
2674
|
-
languageId,
|
|
2675
|
-
new DocumentColorAdapter(worker)
|
|
2676
|
-
)
|
|
2677
|
-
);
|
|
2678
|
-
}
|
|
2679
|
-
if (modeConfiguration2.foldingRanges) {
|
|
2680
|
-
providers.push(
|
|
2681
|
-
monaco_editor_core_exports.languages.registerFoldingRangeProvider(
|
|
2682
|
-
languageId,
|
|
2683
|
-
new FoldingRangeAdapter(worker)
|
|
2684
|
-
)
|
|
2685
|
-
);
|
|
2686
|
-
}
|
|
2687
|
-
if (modeConfiguration2.diagnostics) {
|
|
2688
|
-
providers.push(new JSONDiagnosticsAdapter(languageId, worker, defaults));
|
|
2689
|
-
}
|
|
2690
|
-
if (modeConfiguration2.selectionRanges) {
|
|
2691
|
-
providers.push(
|
|
2692
|
-
monaco_editor_core_exports.languages.registerSelectionRangeProvider(
|
|
2693
|
-
languageId,
|
|
2694
|
-
new SelectionRangeAdapter(worker)
|
|
2695
|
-
)
|
|
2696
|
-
);
|
|
2697
|
-
}
|
|
2698
|
-
}
|
|
2699
|
-
registerProviders();
|
|
2700
|
-
disposables.push(monaco_editor_core_exports.languages.setLanguageConfiguration(defaults.languageId, richEditConfiguration));
|
|
2701
|
-
let modeConfiguration = defaults.modeConfiguration;
|
|
2702
|
-
defaults.onDidChange((newDefaults) => {
|
|
2703
|
-
if (newDefaults.modeConfiguration !== modeConfiguration) {
|
|
2704
|
-
modeConfiguration = newDefaults.modeConfiguration;
|
|
2705
|
-
registerProviders();
|
|
2706
|
-
}
|
|
2707
|
-
});
|
|
2708
|
-
disposables.push(asDisposable(providers));
|
|
2709
|
-
return asDisposable(disposables);
|
|
2710
|
-
}
|
|
2711
|
-
function asDisposable(disposables) {
|
|
2712
|
-
return { dispose: () => disposeAll(disposables) };
|
|
2713
|
-
}
|
|
2714
|
-
function disposeAll(disposables) {
|
|
2715
|
-
while (disposables.length) {
|
|
2716
|
-
disposables.pop().dispose();
|
|
2717
|
-
}
|
|
2718
|
-
}
|
|
2719
|
-
var richEditConfiguration = {
|
|
2720
|
-
wordPattern: /(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,
|
|
2721
|
-
comments: {
|
|
2722
|
-
lineComment: "//",
|
|
2723
|
-
blockComment: ["/*", "*/"]
|
|
2724
|
-
},
|
|
2725
|
-
brackets: [
|
|
2726
|
-
["{", "}"],
|
|
2727
|
-
["[", "]"]
|
|
2728
|
-
],
|
|
2729
|
-
autoClosingPairs: [
|
|
2730
|
-
{ open: "{", close: "}", notIn: ["string"] },
|
|
2731
|
-
{ open: "[", close: "]", notIn: ["string"] },
|
|
2732
|
-
{ open: '"', close: '"', notIn: ["string"] }
|
|
2733
|
-
]
|
|
2734
|
-
};
|
|
2735
|
-
export {
|
|
2736
|
-
CompletionAdapter,
|
|
2737
|
-
DefinitionAdapter,
|
|
2738
|
-
DiagnosticsAdapter,
|
|
2739
|
-
DocumentColorAdapter,
|
|
2740
|
-
DocumentFormattingEditProvider,
|
|
2741
|
-
DocumentHighlightAdapter,
|
|
2742
|
-
DocumentLinkAdapter,
|
|
2743
|
-
DocumentRangeFormattingEditProvider,
|
|
2744
|
-
DocumentSymbolAdapter,
|
|
2745
|
-
FoldingRangeAdapter,
|
|
2746
|
-
HoverAdapter,
|
|
2747
|
-
ReferenceAdapter,
|
|
2748
|
-
RenameAdapter,
|
|
2749
|
-
SelectionRangeAdapter,
|
|
2750
|
-
WorkerManager,
|
|
2751
|
-
fromPosition,
|
|
2752
|
-
fromRange,
|
|
2753
|
-
getWorker,
|
|
2754
|
-
setupMode,
|
|
2755
|
-
toRange,
|
|
2756
|
-
toTextEdit
|
|
2757
|
-
};
|
|
2758
|
-
//# sourceMappingURL=jsonMode.es.js.map
|