@codingame/monaco-vscode-json-language-features-default-extension 1.83.15 → 1.85.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/jsonClientMain.js +364 -371
- package/jsonClientMain.js.map +1 -1
- package/jsonServerMain.js +631 -2823
- package/jsonServerMain.js.map +1 -1
- package/package.json +2 -2
- package/package.nls.json +1 -1
package/jsonClientMain.js
CHANGED
|
@@ -2239,46 +2239,51 @@ class ReadableStreamMessageReader extends AbstractMessageReader {
|
|
|
2239
2239
|
return result;
|
|
2240
2240
|
}
|
|
2241
2241
|
onData(data) {
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2242
|
+
try {
|
|
2243
|
+
this.buffer.append(data);
|
|
2244
|
+
while (true) {
|
|
2245
|
+
if (this.nextMessageLength === -1) {
|
|
2246
|
+
const headers = this.buffer.tryReadHeaders(true);
|
|
2247
|
+
if (!headers) {
|
|
2248
|
+
return;
|
|
2249
|
+
}
|
|
2250
|
+
const contentLength = headers.get('content-length');
|
|
2251
|
+
if (!contentLength) {
|
|
2252
|
+
this.fireError(new Error(`Header must provide a Content-Length property.\n${JSON.stringify(Object.fromEntries(headers))}`));
|
|
2253
|
+
return;
|
|
2254
|
+
}
|
|
2255
|
+
const length = parseInt(contentLength);
|
|
2256
|
+
if (isNaN(length)) {
|
|
2257
|
+
this.fireError(new Error(`Content-Length value must be a number. Got ${contentLength}`));
|
|
2258
|
+
return;
|
|
2259
|
+
}
|
|
2260
|
+
this.nextMessageLength = length;
|
|
2253
2261
|
}
|
|
2254
|
-
const
|
|
2255
|
-
if (
|
|
2256
|
-
|
|
2262
|
+
const body = this.buffer.tryReadBody(this.nextMessageLength);
|
|
2263
|
+
if (body === undefined) {
|
|
2264
|
+
/** We haven't received the full message yet. */
|
|
2265
|
+
this.setPartialMessageTimer();
|
|
2257
2266
|
return;
|
|
2258
2267
|
}
|
|
2259
|
-
this.
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2268
|
+
this.clearPartialMessageTimer();
|
|
2269
|
+
this.nextMessageLength = -1;
|
|
2270
|
+
// Make sure that we convert one received message after the
|
|
2271
|
+
// other. Otherwise it could happen that a decoding of a second
|
|
2272
|
+
// smaller message finished before the decoding of a first larger
|
|
2273
|
+
// message and then we would deliver the second message first.
|
|
2274
|
+
this.readSemaphore.lock(async () => {
|
|
2275
|
+
const bytes = this.options.contentDecoder !== undefined
|
|
2276
|
+
? await this.options.contentDecoder.decode(body)
|
|
2277
|
+
: body;
|
|
2278
|
+
const message = await this.options.contentTypeDecoder.decode(bytes, this.options);
|
|
2279
|
+
this.callback(message);
|
|
2280
|
+
}).catch((error) => {
|
|
2281
|
+
this.fireError(error);
|
|
2282
|
+
});
|
|
2266
2283
|
}
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
// other. Otherwise it could happen that a decoding of a second
|
|
2271
|
-
// smaller message finished before the decoding of a first larger
|
|
2272
|
-
// message and then we would deliver the second message first.
|
|
2273
|
-
this.readSemaphore.lock(async () => {
|
|
2274
|
-
const bytes = this.options.contentDecoder !== undefined
|
|
2275
|
-
? await this.options.contentDecoder.decode(body)
|
|
2276
|
-
: body;
|
|
2277
|
-
const message = await this.options.contentTypeDecoder.decode(bytes, this.options);
|
|
2278
|
-
this.callback(message);
|
|
2279
|
-
}).catch((error) => {
|
|
2280
|
-
this.fireError(error);
|
|
2281
|
-
});
|
|
2284
|
+
}
|
|
2285
|
+
catch (error) {
|
|
2286
|
+
this.fireError(error);
|
|
2282
2287
|
}
|
|
2283
2288
|
}
|
|
2284
2289
|
clearPartialMessageTimer() {
|
|
@@ -2592,7 +2597,7 @@ class AbstractMessageBuffer {
|
|
|
2592
2597
|
const header = headers[i];
|
|
2593
2598
|
const index = header.indexOf(':');
|
|
2594
2599
|
if (index === -1) {
|
|
2595
|
-
throw new Error(
|
|
2600
|
+
throw new Error(`Message header must separate key and value using ':'\n${header}`);
|
|
2596
2601
|
}
|
|
2597
2602
|
const key = header.substr(0, index);
|
|
2598
2603
|
const value = header.substr(index + 1).trim();
|
|
@@ -3965,7 +3970,7 @@ var LSPErrorCodes;
|
|
|
3965
3970
|
|
|
3966
3971
|
/***/ }),
|
|
3967
3972
|
/* 24 */
|
|
3968
|
-
/***/ ((
|
|
3973
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
3969
3974
|
|
|
3970
3975
|
"use strict";
|
|
3971
3976
|
__webpack_require__.r(__webpack_exports__);
|
|
@@ -4107,14 +4112,14 @@ var Position;
|
|
|
4107
4112
|
if (character === Number.MAX_VALUE) {
|
|
4108
4113
|
character = uinteger.MAX_VALUE;
|
|
4109
4114
|
}
|
|
4110
|
-
return { line
|
|
4115
|
+
return { line, character };
|
|
4111
4116
|
}
|
|
4112
4117
|
Position.create = create;
|
|
4113
4118
|
/**
|
|
4114
4119
|
* Checks whether the given literal conforms to the {@link Position} interface.
|
|
4115
4120
|
*/
|
|
4116
4121
|
function is(value) {
|
|
4117
|
-
|
|
4122
|
+
let candidate = value;
|
|
4118
4123
|
return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);
|
|
4119
4124
|
}
|
|
4120
4125
|
Position.is = is;
|
|
@@ -4133,7 +4138,7 @@ var Range;
|
|
|
4133
4138
|
return { start: one, end: two };
|
|
4134
4139
|
}
|
|
4135
4140
|
else {
|
|
4136
|
-
throw new Error(
|
|
4141
|
+
throw new Error(`Range#create called with invalid arguments[${one}, ${two}, ${three}, ${four}]`);
|
|
4137
4142
|
}
|
|
4138
4143
|
}
|
|
4139
4144
|
Range.create = create;
|
|
@@ -4141,7 +4146,7 @@ var Range;
|
|
|
4141
4146
|
* Checks whether the given literal conforms to the {@link Range} interface.
|
|
4142
4147
|
*/
|
|
4143
4148
|
function is(value) {
|
|
4144
|
-
|
|
4149
|
+
let candidate = value;
|
|
4145
4150
|
return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
|
|
4146
4151
|
}
|
|
4147
4152
|
Range.is = is;
|
|
@@ -4158,14 +4163,14 @@ var Location;
|
|
|
4158
4163
|
* @param range The location's range.
|
|
4159
4164
|
*/
|
|
4160
4165
|
function create(uri, range) {
|
|
4161
|
-
return { uri
|
|
4166
|
+
return { uri, range };
|
|
4162
4167
|
}
|
|
4163
4168
|
Location.create = create;
|
|
4164
4169
|
/**
|
|
4165
4170
|
* Checks whether the given literal conforms to the {@link Location} interface.
|
|
4166
4171
|
*/
|
|
4167
4172
|
function is(value) {
|
|
4168
|
-
|
|
4173
|
+
let candidate = value;
|
|
4169
4174
|
return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
|
|
4170
4175
|
}
|
|
4171
4176
|
Location.is = is;
|
|
@@ -4184,14 +4189,14 @@ var LocationLink;
|
|
|
4184
4189
|
* @param originSelectionRange The span of the symbol being defined in the originating source file.
|
|
4185
4190
|
*/
|
|
4186
4191
|
function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {
|
|
4187
|
-
return { targetUri
|
|
4192
|
+
return { targetUri, targetRange, targetSelectionRange, originSelectionRange };
|
|
4188
4193
|
}
|
|
4189
4194
|
LocationLink.create = create;
|
|
4190
4195
|
/**
|
|
4191
4196
|
* Checks whether the given literal conforms to the {@link LocationLink} interface.
|
|
4192
4197
|
*/
|
|
4193
4198
|
function is(value) {
|
|
4194
|
-
|
|
4199
|
+
let candidate = value;
|
|
4195
4200
|
return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)
|
|
4196
4201
|
&& Range.is(candidate.targetSelectionRange)
|
|
4197
4202
|
&& (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
|
|
@@ -4209,10 +4214,10 @@ var Color;
|
|
|
4209
4214
|
*/
|
|
4210
4215
|
function create(red, green, blue, alpha) {
|
|
4211
4216
|
return {
|
|
4212
|
-
red
|
|
4213
|
-
green
|
|
4214
|
-
blue
|
|
4215
|
-
alpha
|
|
4217
|
+
red,
|
|
4218
|
+
green,
|
|
4219
|
+
blue,
|
|
4220
|
+
alpha,
|
|
4216
4221
|
};
|
|
4217
4222
|
}
|
|
4218
4223
|
Color.create = create;
|
|
@@ -4220,7 +4225,7 @@ var Color;
|
|
|
4220
4225
|
* Checks whether the given literal conforms to the {@link Color} interface.
|
|
4221
4226
|
*/
|
|
4222
4227
|
function is(value) {
|
|
4223
|
-
|
|
4228
|
+
const candidate = value;
|
|
4224
4229
|
return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1)
|
|
4225
4230
|
&& Is.numberRange(candidate.green, 0, 1)
|
|
4226
4231
|
&& Is.numberRange(candidate.blue, 0, 1)
|
|
@@ -4239,8 +4244,8 @@ var ColorInformation;
|
|
|
4239
4244
|
*/
|
|
4240
4245
|
function create(range, color) {
|
|
4241
4246
|
return {
|
|
4242
|
-
range
|
|
4243
|
-
color
|
|
4247
|
+
range,
|
|
4248
|
+
color,
|
|
4244
4249
|
};
|
|
4245
4250
|
}
|
|
4246
4251
|
ColorInformation.create = create;
|
|
@@ -4248,7 +4253,7 @@ var ColorInformation;
|
|
|
4248
4253
|
* Checks whether the given literal conforms to the {@link ColorInformation} interface.
|
|
4249
4254
|
*/
|
|
4250
4255
|
function is(value) {
|
|
4251
|
-
|
|
4256
|
+
const candidate = value;
|
|
4252
4257
|
return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);
|
|
4253
4258
|
}
|
|
4254
4259
|
ColorInformation.is = is;
|
|
@@ -4264,9 +4269,9 @@ var ColorPresentation;
|
|
|
4264
4269
|
*/
|
|
4265
4270
|
function create(label, textEdit, additionalTextEdits) {
|
|
4266
4271
|
return {
|
|
4267
|
-
label
|
|
4268
|
-
textEdit
|
|
4269
|
-
additionalTextEdits
|
|
4272
|
+
label,
|
|
4273
|
+
textEdit,
|
|
4274
|
+
additionalTextEdits,
|
|
4270
4275
|
};
|
|
4271
4276
|
}
|
|
4272
4277
|
ColorPresentation.create = create;
|
|
@@ -4274,7 +4279,7 @@ var ColorPresentation;
|
|
|
4274
4279
|
* Checks whether the given literal conforms to the {@link ColorInformation} interface.
|
|
4275
4280
|
*/
|
|
4276
4281
|
function is(value) {
|
|
4277
|
-
|
|
4282
|
+
const candidate = value;
|
|
4278
4283
|
return Is.objectLiteral(candidate) && Is.string(candidate.label)
|
|
4279
4284
|
&& (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))
|
|
4280
4285
|
&& (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));
|
|
@@ -4309,9 +4314,9 @@ var FoldingRange;
|
|
|
4309
4314
|
* Creates a new FoldingRange literal.
|
|
4310
4315
|
*/
|
|
4311
4316
|
function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {
|
|
4312
|
-
|
|
4313
|
-
startLine
|
|
4314
|
-
endLine
|
|
4317
|
+
const result = {
|
|
4318
|
+
startLine,
|
|
4319
|
+
endLine
|
|
4315
4320
|
};
|
|
4316
4321
|
if (Is.defined(startCharacter)) {
|
|
4317
4322
|
result.startCharacter = startCharacter;
|
|
@@ -4332,7 +4337,7 @@ var FoldingRange;
|
|
|
4332
4337
|
* Checks whether the given literal conforms to the {@link FoldingRange} interface.
|
|
4333
4338
|
*/
|
|
4334
4339
|
function is(value) {
|
|
4335
|
-
|
|
4340
|
+
const candidate = value;
|
|
4336
4341
|
return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine)
|
|
4337
4342
|
&& (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))
|
|
4338
4343
|
&& (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))
|
|
@@ -4351,8 +4356,8 @@ var DiagnosticRelatedInformation;
|
|
|
4351
4356
|
*/
|
|
4352
4357
|
function create(location, message) {
|
|
4353
4358
|
return {
|
|
4354
|
-
location
|
|
4355
|
-
message
|
|
4359
|
+
location,
|
|
4360
|
+
message
|
|
4356
4361
|
};
|
|
4357
4362
|
}
|
|
4358
4363
|
DiagnosticRelatedInformation.create = create;
|
|
@@ -4360,7 +4365,7 @@ var DiagnosticRelatedInformation;
|
|
|
4360
4365
|
* Checks whether the given literal conforms to the {@link DiagnosticRelatedInformation} interface.
|
|
4361
4366
|
*/
|
|
4362
4367
|
function is(value) {
|
|
4363
|
-
|
|
4368
|
+
let candidate = value;
|
|
4364
4369
|
return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);
|
|
4365
4370
|
}
|
|
4366
4371
|
DiagnosticRelatedInformation.is = is;
|
|
@@ -4416,7 +4421,7 @@ var DiagnosticTag;
|
|
|
4416
4421
|
var CodeDescription;
|
|
4417
4422
|
(function (CodeDescription) {
|
|
4418
4423
|
function is(value) {
|
|
4419
|
-
|
|
4424
|
+
const candidate = value;
|
|
4420
4425
|
return Is.objectLiteral(candidate) && Is.string(candidate.href);
|
|
4421
4426
|
}
|
|
4422
4427
|
CodeDescription.is = is;
|
|
@@ -4431,7 +4436,7 @@ var Diagnostic;
|
|
|
4431
4436
|
* Creates a new Diagnostic literal.
|
|
4432
4437
|
*/
|
|
4433
4438
|
function create(range, message, severity, code, source, relatedInformation) {
|
|
4434
|
-
|
|
4439
|
+
let result = { range, message };
|
|
4435
4440
|
if (Is.defined(severity)) {
|
|
4436
4441
|
result.severity = severity;
|
|
4437
4442
|
}
|
|
@@ -4452,7 +4457,7 @@ var Diagnostic;
|
|
|
4452
4457
|
*/
|
|
4453
4458
|
function is(value) {
|
|
4454
4459
|
var _a;
|
|
4455
|
-
|
|
4460
|
+
let candidate = value;
|
|
4456
4461
|
return Is.defined(candidate)
|
|
4457
4462
|
&& Range.is(candidate.range)
|
|
4458
4463
|
&& Is.string(candidate.message)
|
|
@@ -4473,12 +4478,8 @@ var Command;
|
|
|
4473
4478
|
/**
|
|
4474
4479
|
* Creates a new Command literal.
|
|
4475
4480
|
*/
|
|
4476
|
-
function create(title, command) {
|
|
4477
|
-
|
|
4478
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
4479
|
-
args[_i - 2] = arguments[_i];
|
|
4480
|
-
}
|
|
4481
|
-
var result = { title: title, command: command };
|
|
4481
|
+
function create(title, command, ...args) {
|
|
4482
|
+
let result = { title, command };
|
|
4482
4483
|
if (Is.defined(args) && args.length > 0) {
|
|
4483
4484
|
result.arguments = args;
|
|
4484
4485
|
}
|
|
@@ -4489,7 +4490,7 @@ var Command;
|
|
|
4489
4490
|
* Checks whether the given literal conforms to the {@link Command} interface.
|
|
4490
4491
|
*/
|
|
4491
4492
|
function is(value) {
|
|
4492
|
-
|
|
4493
|
+
let candidate = value;
|
|
4493
4494
|
return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);
|
|
4494
4495
|
}
|
|
4495
4496
|
Command.is = is;
|
|
@@ -4506,7 +4507,7 @@ var TextEdit;
|
|
|
4506
4507
|
* @param newText The new text.
|
|
4507
4508
|
*/
|
|
4508
4509
|
function replace(range, newText) {
|
|
4509
|
-
return { range
|
|
4510
|
+
return { range, newText };
|
|
4510
4511
|
}
|
|
4511
4512
|
TextEdit.replace = replace;
|
|
4512
4513
|
/**
|
|
@@ -4515,7 +4516,7 @@ var TextEdit;
|
|
|
4515
4516
|
* @param newText The text to be inserted.
|
|
4516
4517
|
*/
|
|
4517
4518
|
function insert(position, newText) {
|
|
4518
|
-
return { range: { start: position, end: position }, newText
|
|
4519
|
+
return { range: { start: position, end: position }, newText };
|
|
4519
4520
|
}
|
|
4520
4521
|
TextEdit.insert = insert;
|
|
4521
4522
|
/**
|
|
@@ -4523,11 +4524,11 @@ var TextEdit;
|
|
|
4523
4524
|
* @param range The range of text to be deleted.
|
|
4524
4525
|
*/
|
|
4525
4526
|
function del(range) {
|
|
4526
|
-
return { range
|
|
4527
|
+
return { range, newText: '' };
|
|
4527
4528
|
}
|
|
4528
4529
|
TextEdit.del = del;
|
|
4529
4530
|
function is(value) {
|
|
4530
|
-
|
|
4531
|
+
const candidate = value;
|
|
4531
4532
|
return Is.objectLiteral(candidate)
|
|
4532
4533
|
&& Is.string(candidate.newText)
|
|
4533
4534
|
&& Range.is(candidate.range);
|
|
@@ -4537,7 +4538,7 @@ var TextEdit;
|
|
|
4537
4538
|
var ChangeAnnotation;
|
|
4538
4539
|
(function (ChangeAnnotation) {
|
|
4539
4540
|
function create(label, needsConfirmation, description) {
|
|
4540
|
-
|
|
4541
|
+
const result = { label };
|
|
4541
4542
|
if (needsConfirmation !== undefined) {
|
|
4542
4543
|
result.needsConfirmation = needsConfirmation;
|
|
4543
4544
|
}
|
|
@@ -4548,7 +4549,7 @@ var ChangeAnnotation;
|
|
|
4548
4549
|
}
|
|
4549
4550
|
ChangeAnnotation.create = create;
|
|
4550
4551
|
function is(value) {
|
|
4551
|
-
|
|
4552
|
+
const candidate = value;
|
|
4552
4553
|
return Is.objectLiteral(candidate) && Is.string(candidate.label) &&
|
|
4553
4554
|
(Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) &&
|
|
4554
4555
|
(Is.string(candidate.description) || candidate.description === undefined);
|
|
@@ -4558,7 +4559,7 @@ var ChangeAnnotation;
|
|
|
4558
4559
|
var ChangeAnnotationIdentifier;
|
|
4559
4560
|
(function (ChangeAnnotationIdentifier) {
|
|
4560
4561
|
function is(value) {
|
|
4561
|
-
|
|
4562
|
+
const candidate = value;
|
|
4562
4563
|
return Is.string(candidate);
|
|
4563
4564
|
}
|
|
4564
4565
|
ChangeAnnotationIdentifier.is = is;
|
|
@@ -4573,7 +4574,7 @@ var AnnotatedTextEdit;
|
|
|
4573
4574
|
* @param annotation The annotation.
|
|
4574
4575
|
*/
|
|
4575
4576
|
function replace(range, newText, annotation) {
|
|
4576
|
-
return { range
|
|
4577
|
+
return { range, newText, annotationId: annotation };
|
|
4577
4578
|
}
|
|
4578
4579
|
AnnotatedTextEdit.replace = replace;
|
|
4579
4580
|
/**
|
|
@@ -4584,7 +4585,7 @@ var AnnotatedTextEdit;
|
|
|
4584
4585
|
* @param annotation The annotation.
|
|
4585
4586
|
*/
|
|
4586
4587
|
function insert(position, newText, annotation) {
|
|
4587
|
-
return { range: { start: position, end: position }, newText
|
|
4588
|
+
return { range: { start: position, end: position }, newText, annotationId: annotation };
|
|
4588
4589
|
}
|
|
4589
4590
|
AnnotatedTextEdit.insert = insert;
|
|
4590
4591
|
/**
|
|
@@ -4594,11 +4595,11 @@ var AnnotatedTextEdit;
|
|
|
4594
4595
|
* @param annotation The annotation.
|
|
4595
4596
|
*/
|
|
4596
4597
|
function del(range, annotation) {
|
|
4597
|
-
return { range
|
|
4598
|
+
return { range, newText: '', annotationId: annotation };
|
|
4598
4599
|
}
|
|
4599
4600
|
AnnotatedTextEdit.del = del;
|
|
4600
4601
|
function is(value) {
|
|
4601
|
-
|
|
4602
|
+
const candidate = value;
|
|
4602
4603
|
return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
4603
4604
|
}
|
|
4604
4605
|
AnnotatedTextEdit.is = is;
|
|
@@ -4613,11 +4614,11 @@ var TextDocumentEdit;
|
|
|
4613
4614
|
* Creates a new `TextDocumentEdit`
|
|
4614
4615
|
*/
|
|
4615
4616
|
function create(textDocument, edits) {
|
|
4616
|
-
return { textDocument
|
|
4617
|
+
return { textDocument, edits };
|
|
4617
4618
|
}
|
|
4618
4619
|
TextDocumentEdit.create = create;
|
|
4619
4620
|
function is(value) {
|
|
4620
|
-
|
|
4621
|
+
let candidate = value;
|
|
4621
4622
|
return Is.defined(candidate)
|
|
4622
4623
|
&& OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument)
|
|
4623
4624
|
&& Array.isArray(candidate.edits);
|
|
@@ -4627,9 +4628,9 @@ var TextDocumentEdit;
|
|
|
4627
4628
|
var CreateFile;
|
|
4628
4629
|
(function (CreateFile) {
|
|
4629
4630
|
function create(uri, options, annotation) {
|
|
4630
|
-
|
|
4631
|
+
let result = {
|
|
4631
4632
|
kind: 'create',
|
|
4632
|
-
uri
|
|
4633
|
+
uri
|
|
4633
4634
|
};
|
|
4634
4635
|
if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
|
|
4635
4636
|
result.options = options;
|
|
@@ -4641,7 +4642,7 @@ var CreateFile;
|
|
|
4641
4642
|
}
|
|
4642
4643
|
CreateFile.create = create;
|
|
4643
4644
|
function is(value) {
|
|
4644
|
-
|
|
4645
|
+
let candidate = value;
|
|
4645
4646
|
return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined ||
|
|
4646
4647
|
((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
4647
4648
|
}
|
|
@@ -4650,10 +4651,10 @@ var CreateFile;
|
|
|
4650
4651
|
var RenameFile;
|
|
4651
4652
|
(function (RenameFile) {
|
|
4652
4653
|
function create(oldUri, newUri, options, annotation) {
|
|
4653
|
-
|
|
4654
|
+
let result = {
|
|
4654
4655
|
kind: 'rename',
|
|
4655
|
-
oldUri
|
|
4656
|
-
newUri
|
|
4656
|
+
oldUri,
|
|
4657
|
+
newUri
|
|
4657
4658
|
};
|
|
4658
4659
|
if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {
|
|
4659
4660
|
result.options = options;
|
|
@@ -4665,7 +4666,7 @@ var RenameFile;
|
|
|
4665
4666
|
}
|
|
4666
4667
|
RenameFile.create = create;
|
|
4667
4668
|
function is(value) {
|
|
4668
|
-
|
|
4669
|
+
let candidate = value;
|
|
4669
4670
|
return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined ||
|
|
4670
4671
|
((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
4671
4672
|
}
|
|
@@ -4674,9 +4675,9 @@ var RenameFile;
|
|
|
4674
4675
|
var DeleteFile;
|
|
4675
4676
|
(function (DeleteFile) {
|
|
4676
4677
|
function create(uri, options, annotation) {
|
|
4677
|
-
|
|
4678
|
+
let result = {
|
|
4678
4679
|
kind: 'delete',
|
|
4679
|
-
uri
|
|
4680
|
+
uri
|
|
4680
4681
|
};
|
|
4681
4682
|
if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) {
|
|
4682
4683
|
result.options = options;
|
|
@@ -4688,7 +4689,7 @@ var DeleteFile;
|
|
|
4688
4689
|
}
|
|
4689
4690
|
DeleteFile.create = create;
|
|
4690
4691
|
function is(value) {
|
|
4691
|
-
|
|
4692
|
+
let candidate = value;
|
|
4692
4693
|
return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined ||
|
|
4693
4694
|
((candidate.options.recursive === undefined || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === undefined || Is.boolean(candidate.options.ignoreIfNotExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));
|
|
4694
4695
|
}
|
|
@@ -4697,10 +4698,10 @@ var DeleteFile;
|
|
|
4697
4698
|
var WorkspaceEdit;
|
|
4698
4699
|
(function (WorkspaceEdit) {
|
|
4699
4700
|
function is(value) {
|
|
4700
|
-
|
|
4701
|
+
let candidate = value;
|
|
4701
4702
|
return candidate &&
|
|
4702
4703
|
(candidate.changes !== undefined || candidate.documentChanges !== undefined) &&
|
|
4703
|
-
(candidate.documentChanges === undefined || candidate.documentChanges.every(
|
|
4704
|
+
(candidate.documentChanges === undefined || candidate.documentChanges.every((change) => {
|
|
4704
4705
|
if (Is.string(change.kind)) {
|
|
4705
4706
|
return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);
|
|
4706
4707
|
}
|
|
@@ -4711,14 +4712,14 @@ var WorkspaceEdit;
|
|
|
4711
4712
|
}
|
|
4712
4713
|
WorkspaceEdit.is = is;
|
|
4713
4714
|
})(WorkspaceEdit || (WorkspaceEdit = {}));
|
|
4714
|
-
|
|
4715
|
-
|
|
4715
|
+
class TextEditChangeImpl {
|
|
4716
|
+
constructor(edits, changeAnnotations) {
|
|
4716
4717
|
this.edits = edits;
|
|
4717
4718
|
this.changeAnnotations = changeAnnotations;
|
|
4718
4719
|
}
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4720
|
+
insert(position, newText, annotation) {
|
|
4721
|
+
let edit;
|
|
4722
|
+
let id;
|
|
4722
4723
|
if (annotation === undefined) {
|
|
4723
4724
|
edit = TextEdit.insert(position, newText);
|
|
4724
4725
|
}
|
|
@@ -4735,10 +4736,10 @@ var TextEditChangeImpl = /** @class */ (function () {
|
|
|
4735
4736
|
if (id !== undefined) {
|
|
4736
4737
|
return id;
|
|
4737
4738
|
}
|
|
4738
|
-
}
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4739
|
+
}
|
|
4740
|
+
replace(range, newText, annotation) {
|
|
4741
|
+
let edit;
|
|
4742
|
+
let id;
|
|
4742
4743
|
if (annotation === undefined) {
|
|
4743
4744
|
edit = TextEdit.replace(range, newText);
|
|
4744
4745
|
}
|
|
@@ -4755,10 +4756,10 @@ var TextEditChangeImpl = /** @class */ (function () {
|
|
|
4755
4756
|
if (id !== undefined) {
|
|
4756
4757
|
return id;
|
|
4757
4758
|
}
|
|
4758
|
-
}
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4759
|
+
}
|
|
4760
|
+
delete(range, annotation) {
|
|
4761
|
+
let edit;
|
|
4762
|
+
let id;
|
|
4762
4763
|
if (annotation === undefined) {
|
|
4763
4764
|
edit = TextEdit.del(range);
|
|
4764
4765
|
}
|
|
@@ -4775,44 +4776,39 @@ var TextEditChangeImpl = /** @class */ (function () {
|
|
|
4775
4776
|
if (id !== undefined) {
|
|
4776
4777
|
return id;
|
|
4777
4778
|
}
|
|
4778
|
-
}
|
|
4779
|
-
|
|
4779
|
+
}
|
|
4780
|
+
add(edit) {
|
|
4780
4781
|
this.edits.push(edit);
|
|
4781
|
-
}
|
|
4782
|
-
|
|
4782
|
+
}
|
|
4783
|
+
all() {
|
|
4783
4784
|
return this.edits;
|
|
4784
|
-
}
|
|
4785
|
-
|
|
4785
|
+
}
|
|
4786
|
+
clear() {
|
|
4786
4787
|
this.edits.splice(0, this.edits.length);
|
|
4787
|
-
}
|
|
4788
|
-
|
|
4788
|
+
}
|
|
4789
|
+
assertChangeAnnotations(value) {
|
|
4789
4790
|
if (value === undefined) {
|
|
4790
|
-
throw new Error(
|
|
4791
|
+
throw new Error(`Text edit change is not configured to manage change annotations.`);
|
|
4791
4792
|
}
|
|
4792
|
-
}
|
|
4793
|
-
|
|
4794
|
-
}());
|
|
4793
|
+
}
|
|
4794
|
+
}
|
|
4795
4795
|
/**
|
|
4796
4796
|
* A helper class
|
|
4797
4797
|
*/
|
|
4798
|
-
|
|
4799
|
-
|
|
4798
|
+
class ChangeAnnotations {
|
|
4799
|
+
constructor(annotations) {
|
|
4800
4800
|
this._annotations = annotations === undefined ? Object.create(null) : annotations;
|
|
4801
4801
|
this._counter = 0;
|
|
4802
4802
|
this._size = 0;
|
|
4803
4803
|
}
|
|
4804
|
-
|
|
4804
|
+
all() {
|
|
4805
4805
|
return this._annotations;
|
|
4806
|
-
}
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
configurable: true
|
|
4813
|
-
});
|
|
4814
|
-
ChangeAnnotations.prototype.manage = function (idOrAnnotation, annotation) {
|
|
4815
|
-
var id;
|
|
4806
|
+
}
|
|
4807
|
+
get size() {
|
|
4808
|
+
return this._size;
|
|
4809
|
+
}
|
|
4810
|
+
manage(idOrAnnotation, annotation) {
|
|
4811
|
+
let id;
|
|
4816
4812
|
if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {
|
|
4817
4813
|
id = idOrAnnotation;
|
|
4818
4814
|
}
|
|
@@ -4821,44 +4817,42 @@ var ChangeAnnotations = /** @class */ (function () {
|
|
|
4821
4817
|
annotation = idOrAnnotation;
|
|
4822
4818
|
}
|
|
4823
4819
|
if (this._annotations[id] !== undefined) {
|
|
4824
|
-
throw new Error(
|
|
4820
|
+
throw new Error(`Id ${id} is already in use.`);
|
|
4825
4821
|
}
|
|
4826
4822
|
if (annotation === undefined) {
|
|
4827
|
-
throw new Error(
|
|
4823
|
+
throw new Error(`No annotation provided for id ${id}`);
|
|
4828
4824
|
}
|
|
4829
4825
|
this._annotations[id] = annotation;
|
|
4830
4826
|
this._size++;
|
|
4831
4827
|
return id;
|
|
4832
|
-
}
|
|
4833
|
-
|
|
4828
|
+
}
|
|
4829
|
+
nextId() {
|
|
4834
4830
|
this._counter++;
|
|
4835
4831
|
return this._counter.toString();
|
|
4836
|
-
}
|
|
4837
|
-
|
|
4838
|
-
}());
|
|
4832
|
+
}
|
|
4833
|
+
}
|
|
4839
4834
|
/**
|
|
4840
4835
|
* A workspace change helps constructing changes to a workspace.
|
|
4841
4836
|
*/
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
var _this = this;
|
|
4837
|
+
class WorkspaceChange {
|
|
4838
|
+
constructor(workspaceEdit) {
|
|
4845
4839
|
this._textEditChanges = Object.create(null);
|
|
4846
4840
|
if (workspaceEdit !== undefined) {
|
|
4847
4841
|
this._workspaceEdit = workspaceEdit;
|
|
4848
4842
|
if (workspaceEdit.documentChanges) {
|
|
4849
4843
|
this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);
|
|
4850
4844
|
workspaceEdit.changeAnnotations = this._changeAnnotations.all();
|
|
4851
|
-
workspaceEdit.documentChanges.forEach(
|
|
4845
|
+
workspaceEdit.documentChanges.forEach((change) => {
|
|
4852
4846
|
if (TextDocumentEdit.is(change)) {
|
|
4853
|
-
|
|
4854
|
-
|
|
4847
|
+
const textEditChange = new TextEditChangeImpl(change.edits, this._changeAnnotations);
|
|
4848
|
+
this._textEditChanges[change.textDocument.uri] = textEditChange;
|
|
4855
4849
|
}
|
|
4856
4850
|
});
|
|
4857
4851
|
}
|
|
4858
4852
|
else if (workspaceEdit.changes) {
|
|
4859
|
-
Object.keys(workspaceEdit.changes).forEach(
|
|
4860
|
-
|
|
4861
|
-
|
|
4853
|
+
Object.keys(workspaceEdit.changes).forEach((key) => {
|
|
4854
|
+
const textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);
|
|
4855
|
+
this._textEditChanges[key] = textEditChange;
|
|
4862
4856
|
});
|
|
4863
4857
|
}
|
|
4864
4858
|
}
|
|
@@ -4866,39 +4860,35 @@ var WorkspaceChange = /** @class */ (function () {
|
|
|
4866
4860
|
this._workspaceEdit = {};
|
|
4867
4861
|
}
|
|
4868
4862
|
}
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
if (this._changeAnnotations
|
|
4877
|
-
|
|
4878
|
-
this._workspaceEdit.changeAnnotations = undefined;
|
|
4879
|
-
}
|
|
4880
|
-
else {
|
|
4881
|
-
this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
|
|
4882
|
-
}
|
|
4863
|
+
/**
|
|
4864
|
+
* Returns the underlying {@link WorkspaceEdit} literal
|
|
4865
|
+
* use to be returned from a workspace edit operation like rename.
|
|
4866
|
+
*/
|
|
4867
|
+
get edit() {
|
|
4868
|
+
this.initDocumentChanges();
|
|
4869
|
+
if (this._changeAnnotations !== undefined) {
|
|
4870
|
+
if (this._changeAnnotations.size === 0) {
|
|
4871
|
+
this._workspaceEdit.changeAnnotations = undefined;
|
|
4883
4872
|
}
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4873
|
+
else {
|
|
4874
|
+
this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
|
|
4875
|
+
}
|
|
4876
|
+
}
|
|
4877
|
+
return this._workspaceEdit;
|
|
4878
|
+
}
|
|
4879
|
+
getTextEditChange(key) {
|
|
4890
4880
|
if (OptionalVersionedTextDocumentIdentifier.is(key)) {
|
|
4891
4881
|
this.initDocumentChanges();
|
|
4892
4882
|
if (this._workspaceEdit.documentChanges === undefined) {
|
|
4893
4883
|
throw new Error('Workspace edit is not configured for document changes.');
|
|
4894
4884
|
}
|
|
4895
|
-
|
|
4896
|
-
|
|
4885
|
+
const textDocument = { uri: key.uri, version: key.version };
|
|
4886
|
+
let result = this._textEditChanges[textDocument.uri];
|
|
4897
4887
|
if (!result) {
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
textDocument
|
|
4901
|
-
edits
|
|
4888
|
+
const edits = [];
|
|
4889
|
+
const textDocumentEdit = {
|
|
4890
|
+
textDocument,
|
|
4891
|
+
edits
|
|
4902
4892
|
};
|
|
4903
4893
|
this._workspaceEdit.documentChanges.push(textDocumentEdit);
|
|
4904
4894
|
result = new TextEditChangeImpl(edits, this._changeAnnotations);
|
|
@@ -4911,42 +4901,42 @@ var WorkspaceChange = /** @class */ (function () {
|
|
|
4911
4901
|
if (this._workspaceEdit.changes === undefined) {
|
|
4912
4902
|
throw new Error('Workspace edit is not configured for normal text edit changes.');
|
|
4913
4903
|
}
|
|
4914
|
-
|
|
4904
|
+
let result = this._textEditChanges[key];
|
|
4915
4905
|
if (!result) {
|
|
4916
|
-
|
|
4906
|
+
let edits = [];
|
|
4917
4907
|
this._workspaceEdit.changes[key] = edits;
|
|
4918
4908
|
result = new TextEditChangeImpl(edits);
|
|
4919
4909
|
this._textEditChanges[key] = result;
|
|
4920
4910
|
}
|
|
4921
4911
|
return result;
|
|
4922
4912
|
}
|
|
4923
|
-
}
|
|
4924
|
-
|
|
4913
|
+
}
|
|
4914
|
+
initDocumentChanges() {
|
|
4925
4915
|
if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
|
|
4926
4916
|
this._changeAnnotations = new ChangeAnnotations();
|
|
4927
4917
|
this._workspaceEdit.documentChanges = [];
|
|
4928
4918
|
this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();
|
|
4929
4919
|
}
|
|
4930
|
-
}
|
|
4931
|
-
|
|
4920
|
+
}
|
|
4921
|
+
initChanges() {
|
|
4932
4922
|
if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {
|
|
4933
4923
|
this._workspaceEdit.changes = Object.create(null);
|
|
4934
4924
|
}
|
|
4935
|
-
}
|
|
4936
|
-
|
|
4925
|
+
}
|
|
4926
|
+
createFile(uri, optionsOrAnnotation, options) {
|
|
4937
4927
|
this.initDocumentChanges();
|
|
4938
4928
|
if (this._workspaceEdit.documentChanges === undefined) {
|
|
4939
4929
|
throw new Error('Workspace edit is not configured for document changes.');
|
|
4940
4930
|
}
|
|
4941
|
-
|
|
4931
|
+
let annotation;
|
|
4942
4932
|
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
|
|
4943
4933
|
annotation = optionsOrAnnotation;
|
|
4944
4934
|
}
|
|
4945
4935
|
else {
|
|
4946
4936
|
options = optionsOrAnnotation;
|
|
4947
4937
|
}
|
|
4948
|
-
|
|
4949
|
-
|
|
4938
|
+
let operation;
|
|
4939
|
+
let id;
|
|
4950
4940
|
if (annotation === undefined) {
|
|
4951
4941
|
operation = CreateFile.create(uri, options);
|
|
4952
4942
|
}
|
|
@@ -4958,21 +4948,21 @@ var WorkspaceChange = /** @class */ (function () {
|
|
|
4958
4948
|
if (id !== undefined) {
|
|
4959
4949
|
return id;
|
|
4960
4950
|
}
|
|
4961
|
-
}
|
|
4962
|
-
|
|
4951
|
+
}
|
|
4952
|
+
renameFile(oldUri, newUri, optionsOrAnnotation, options) {
|
|
4963
4953
|
this.initDocumentChanges();
|
|
4964
4954
|
if (this._workspaceEdit.documentChanges === undefined) {
|
|
4965
4955
|
throw new Error('Workspace edit is not configured for document changes.');
|
|
4966
4956
|
}
|
|
4967
|
-
|
|
4957
|
+
let annotation;
|
|
4968
4958
|
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
|
|
4969
4959
|
annotation = optionsOrAnnotation;
|
|
4970
4960
|
}
|
|
4971
4961
|
else {
|
|
4972
4962
|
options = optionsOrAnnotation;
|
|
4973
4963
|
}
|
|
4974
|
-
|
|
4975
|
-
|
|
4964
|
+
let operation;
|
|
4965
|
+
let id;
|
|
4976
4966
|
if (annotation === undefined) {
|
|
4977
4967
|
operation = RenameFile.create(oldUri, newUri, options);
|
|
4978
4968
|
}
|
|
@@ -4984,21 +4974,21 @@ var WorkspaceChange = /** @class */ (function () {
|
|
|
4984
4974
|
if (id !== undefined) {
|
|
4985
4975
|
return id;
|
|
4986
4976
|
}
|
|
4987
|
-
}
|
|
4988
|
-
|
|
4977
|
+
}
|
|
4978
|
+
deleteFile(uri, optionsOrAnnotation, options) {
|
|
4989
4979
|
this.initDocumentChanges();
|
|
4990
4980
|
if (this._workspaceEdit.documentChanges === undefined) {
|
|
4991
4981
|
throw new Error('Workspace edit is not configured for document changes.');
|
|
4992
4982
|
}
|
|
4993
|
-
|
|
4983
|
+
let annotation;
|
|
4994
4984
|
if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {
|
|
4995
4985
|
annotation = optionsOrAnnotation;
|
|
4996
4986
|
}
|
|
4997
4987
|
else {
|
|
4998
4988
|
options = optionsOrAnnotation;
|
|
4999
4989
|
}
|
|
5000
|
-
|
|
5001
|
-
|
|
4990
|
+
let operation;
|
|
4991
|
+
let id;
|
|
5002
4992
|
if (annotation === undefined) {
|
|
5003
4993
|
operation = DeleteFile.create(uri, options);
|
|
5004
4994
|
}
|
|
@@ -5010,10 +5000,8 @@ var WorkspaceChange = /** @class */ (function () {
|
|
|
5010
5000
|
if (id !== undefined) {
|
|
5011
5001
|
return id;
|
|
5012
5002
|
}
|
|
5013
|
-
}
|
|
5014
|
-
|
|
5015
|
-
}());
|
|
5016
|
-
|
|
5003
|
+
}
|
|
5004
|
+
}
|
|
5017
5005
|
/**
|
|
5018
5006
|
* The TextDocumentIdentifier namespace provides helper functions to work with
|
|
5019
5007
|
* {@link TextDocumentIdentifier} literals.
|
|
@@ -5025,14 +5013,14 @@ var TextDocumentIdentifier;
|
|
|
5025
5013
|
* @param uri The document's uri.
|
|
5026
5014
|
*/
|
|
5027
5015
|
function create(uri) {
|
|
5028
|
-
return { uri
|
|
5016
|
+
return { uri };
|
|
5029
5017
|
}
|
|
5030
5018
|
TextDocumentIdentifier.create = create;
|
|
5031
5019
|
/**
|
|
5032
5020
|
* Checks whether the given literal conforms to the {@link TextDocumentIdentifier} interface.
|
|
5033
5021
|
*/
|
|
5034
5022
|
function is(value) {
|
|
5035
|
-
|
|
5023
|
+
let candidate = value;
|
|
5036
5024
|
return Is.defined(candidate) && Is.string(candidate.uri);
|
|
5037
5025
|
}
|
|
5038
5026
|
TextDocumentIdentifier.is = is;
|
|
@@ -5049,14 +5037,14 @@ var VersionedTextDocumentIdentifier;
|
|
|
5049
5037
|
* @param version The document's version.
|
|
5050
5038
|
*/
|
|
5051
5039
|
function create(uri, version) {
|
|
5052
|
-
return { uri
|
|
5040
|
+
return { uri, version };
|
|
5053
5041
|
}
|
|
5054
5042
|
VersionedTextDocumentIdentifier.create = create;
|
|
5055
5043
|
/**
|
|
5056
5044
|
* Checks whether the given literal conforms to the {@link VersionedTextDocumentIdentifier} interface.
|
|
5057
5045
|
*/
|
|
5058
5046
|
function is(value) {
|
|
5059
|
-
|
|
5047
|
+
let candidate = value;
|
|
5060
5048
|
return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);
|
|
5061
5049
|
}
|
|
5062
5050
|
VersionedTextDocumentIdentifier.is = is;
|
|
@@ -5073,14 +5061,14 @@ var OptionalVersionedTextDocumentIdentifier;
|
|
|
5073
5061
|
* @param version The document's version.
|
|
5074
5062
|
*/
|
|
5075
5063
|
function create(uri, version) {
|
|
5076
|
-
return { uri
|
|
5064
|
+
return { uri, version };
|
|
5077
5065
|
}
|
|
5078
5066
|
OptionalVersionedTextDocumentIdentifier.create = create;
|
|
5079
5067
|
/**
|
|
5080
5068
|
* Checks whether the given literal conforms to the {@link OptionalVersionedTextDocumentIdentifier} interface.
|
|
5081
5069
|
*/
|
|
5082
5070
|
function is(value) {
|
|
5083
|
-
|
|
5071
|
+
let candidate = value;
|
|
5084
5072
|
return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));
|
|
5085
5073
|
}
|
|
5086
5074
|
OptionalVersionedTextDocumentIdentifier.is = is;
|
|
@@ -5099,14 +5087,14 @@ var TextDocumentItem;
|
|
|
5099
5087
|
* @param text The document's text.
|
|
5100
5088
|
*/
|
|
5101
5089
|
function create(uri, languageId, version, text) {
|
|
5102
|
-
return { uri
|
|
5090
|
+
return { uri, languageId, version, text };
|
|
5103
5091
|
}
|
|
5104
5092
|
TextDocumentItem.create = create;
|
|
5105
5093
|
/**
|
|
5106
5094
|
* Checks whether the given literal conforms to the {@link TextDocumentItem} interface.
|
|
5107
5095
|
*/
|
|
5108
5096
|
function is(value) {
|
|
5109
|
-
|
|
5097
|
+
let candidate = value;
|
|
5110
5098
|
return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);
|
|
5111
5099
|
}
|
|
5112
5100
|
TextDocumentItem.is = is;
|
|
@@ -5132,7 +5120,7 @@ var MarkupKind;
|
|
|
5132
5120
|
* Checks whether the given value is a value of the {@link MarkupKind} type.
|
|
5133
5121
|
*/
|
|
5134
5122
|
function is(value) {
|
|
5135
|
-
|
|
5123
|
+
const candidate = value;
|
|
5136
5124
|
return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;
|
|
5137
5125
|
}
|
|
5138
5126
|
MarkupKind.is = is;
|
|
@@ -5143,7 +5131,7 @@ var MarkupContent;
|
|
|
5143
5131
|
* Checks whether the given value conforms to the {@link MarkupContent} interface.
|
|
5144
5132
|
*/
|
|
5145
5133
|
function is(value) {
|
|
5146
|
-
|
|
5134
|
+
const candidate = value;
|
|
5147
5135
|
return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);
|
|
5148
5136
|
}
|
|
5149
5137
|
MarkupContent.is = is;
|
|
@@ -5225,14 +5213,14 @@ var InsertReplaceEdit;
|
|
|
5225
5213
|
* Creates a new insert / replace edit
|
|
5226
5214
|
*/
|
|
5227
5215
|
function create(newText, insert, replace) {
|
|
5228
|
-
return { newText
|
|
5216
|
+
return { newText, insert, replace };
|
|
5229
5217
|
}
|
|
5230
5218
|
InsertReplaceEdit.create = create;
|
|
5231
5219
|
/**
|
|
5232
5220
|
* Checks whether the given literal conforms to the {@link InsertReplaceEdit} interface.
|
|
5233
5221
|
*/
|
|
5234
5222
|
function is(value) {
|
|
5235
|
-
|
|
5223
|
+
const candidate = value;
|
|
5236
5224
|
return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
|
|
5237
5225
|
}
|
|
5238
5226
|
InsertReplaceEdit.is = is;
|
|
@@ -5267,7 +5255,7 @@ var InsertTextMode;
|
|
|
5267
5255
|
var CompletionItemLabelDetails;
|
|
5268
5256
|
(function (CompletionItemLabelDetails) {
|
|
5269
5257
|
function is(value) {
|
|
5270
|
-
|
|
5258
|
+
const candidate = value;
|
|
5271
5259
|
return candidate && (Is.string(candidate.detail) || candidate.detail === undefined) &&
|
|
5272
5260
|
(Is.string(candidate.description) || candidate.description === undefined);
|
|
5273
5261
|
}
|
|
@@ -5284,7 +5272,7 @@ var CompletionItem;
|
|
|
5284
5272
|
* @param label The completion item's label
|
|
5285
5273
|
*/
|
|
5286
5274
|
function create(label) {
|
|
5287
|
-
return { label
|
|
5275
|
+
return { label };
|
|
5288
5276
|
}
|
|
5289
5277
|
CompletionItem.create = create;
|
|
5290
5278
|
})(CompletionItem || (CompletionItem = {}));
|
|
@@ -5320,7 +5308,7 @@ var MarkedString;
|
|
|
5320
5308
|
* Checks whether the given value conforms to the {@link MarkedString} type.
|
|
5321
5309
|
*/
|
|
5322
5310
|
function is(value) {
|
|
5323
|
-
|
|
5311
|
+
const candidate = value;
|
|
5324
5312
|
return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));
|
|
5325
5313
|
}
|
|
5326
5314
|
MarkedString.is = is;
|
|
@@ -5331,7 +5319,7 @@ var Hover;
|
|
|
5331
5319
|
* Checks whether the given value conforms to the {@link Hover} interface.
|
|
5332
5320
|
*/
|
|
5333
5321
|
function is(value) {
|
|
5334
|
-
|
|
5322
|
+
let candidate = value;
|
|
5335
5323
|
return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||
|
|
5336
5324
|
MarkedString.is(candidate.contents) ||
|
|
5337
5325
|
Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range));
|
|
@@ -5351,7 +5339,7 @@ var ParameterInformation;
|
|
|
5351
5339
|
* @param documentation A doc string.
|
|
5352
5340
|
*/
|
|
5353
5341
|
function create(label, documentation) {
|
|
5354
|
-
return documentation ? { label
|
|
5342
|
+
return documentation ? { label, documentation } : { label };
|
|
5355
5343
|
}
|
|
5356
5344
|
ParameterInformation.create = create;
|
|
5357
5345
|
})(ParameterInformation || (ParameterInformation = {}));
|
|
@@ -5361,12 +5349,8 @@ var ParameterInformation;
|
|
|
5361
5349
|
*/
|
|
5362
5350
|
var SignatureInformation;
|
|
5363
5351
|
(function (SignatureInformation) {
|
|
5364
|
-
function create(label, documentation) {
|
|
5365
|
-
|
|
5366
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
|
5367
|
-
parameters[_i - 2] = arguments[_i];
|
|
5368
|
-
}
|
|
5369
|
-
var result = { label: label };
|
|
5352
|
+
function create(label, documentation, ...parameters) {
|
|
5353
|
+
let result = { label };
|
|
5370
5354
|
if (Is.defined(documentation)) {
|
|
5371
5355
|
result.documentation = documentation;
|
|
5372
5356
|
}
|
|
@@ -5410,7 +5394,7 @@ var DocumentHighlight;
|
|
|
5410
5394
|
* @param kind The highlight kind
|
|
5411
5395
|
*/
|
|
5412
5396
|
function create(range, kind) {
|
|
5413
|
-
|
|
5397
|
+
let result = { range };
|
|
5414
5398
|
if (Is.number(kind)) {
|
|
5415
5399
|
result.kind = kind;
|
|
5416
5400
|
}
|
|
@@ -5474,10 +5458,10 @@ var SymbolInformation;
|
|
|
5474
5458
|
* @param containerName The name of the symbol containing the symbol.
|
|
5475
5459
|
*/
|
|
5476
5460
|
function create(name, kind, range, uri, containerName) {
|
|
5477
|
-
|
|
5478
|
-
name
|
|
5479
|
-
kind
|
|
5480
|
-
location: { uri
|
|
5461
|
+
let result = {
|
|
5462
|
+
name,
|
|
5463
|
+
kind,
|
|
5464
|
+
location: { uri, range }
|
|
5481
5465
|
};
|
|
5482
5466
|
if (containerName) {
|
|
5483
5467
|
result.containerName = containerName;
|
|
@@ -5499,8 +5483,8 @@ var WorkspaceSymbol;
|
|
|
5499
5483
|
*/
|
|
5500
5484
|
function create(name, kind, uri, range) {
|
|
5501
5485
|
return range !== undefined
|
|
5502
|
-
? { name
|
|
5503
|
-
: { name
|
|
5486
|
+
? { name, kind, location: { uri, range } }
|
|
5487
|
+
: { name, kind, location: { uri } };
|
|
5504
5488
|
}
|
|
5505
5489
|
WorkspaceSymbol.create = create;
|
|
5506
5490
|
})(WorkspaceSymbol || (WorkspaceSymbol = {}));
|
|
@@ -5517,12 +5501,12 @@ var DocumentSymbol;
|
|
|
5517
5501
|
* @param children Children of the symbol.
|
|
5518
5502
|
*/
|
|
5519
5503
|
function create(name, detail, kind, range, selectionRange, children) {
|
|
5520
|
-
|
|
5521
|
-
name
|
|
5522
|
-
detail
|
|
5523
|
-
kind
|
|
5524
|
-
range
|
|
5525
|
-
selectionRange
|
|
5504
|
+
let result = {
|
|
5505
|
+
name,
|
|
5506
|
+
detail,
|
|
5507
|
+
kind,
|
|
5508
|
+
range,
|
|
5509
|
+
selectionRange
|
|
5526
5510
|
};
|
|
5527
5511
|
if (children !== undefined) {
|
|
5528
5512
|
result.children = children;
|
|
@@ -5534,7 +5518,7 @@ var DocumentSymbol;
|
|
|
5534
5518
|
* Checks whether the given literal conforms to the {@link DocumentSymbol} interface.
|
|
5535
5519
|
*/
|
|
5536
5520
|
function is(value) {
|
|
5537
|
-
|
|
5521
|
+
let candidate = value;
|
|
5538
5522
|
return candidate &&
|
|
5539
5523
|
Is.string(candidate.name) && Is.number(candidate.kind) &&
|
|
5540
5524
|
Range.is(candidate.range) && Range.is(candidate.selectionRange) &&
|
|
@@ -5647,7 +5631,7 @@ var CodeActionContext;
|
|
|
5647
5631
|
* Creates a new CodeActionContext literal.
|
|
5648
5632
|
*/
|
|
5649
5633
|
function create(diagnostics, only, triggerKind) {
|
|
5650
|
-
|
|
5634
|
+
let result = { diagnostics };
|
|
5651
5635
|
if (only !== undefined && only !== null) {
|
|
5652
5636
|
result.only = only;
|
|
5653
5637
|
}
|
|
@@ -5661,7 +5645,7 @@ var CodeActionContext;
|
|
|
5661
5645
|
* Checks whether the given literal conforms to the {@link CodeActionContext} interface.
|
|
5662
5646
|
*/
|
|
5663
5647
|
function is(value) {
|
|
5664
|
-
|
|
5648
|
+
let candidate = value;
|
|
5665
5649
|
return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is)
|
|
5666
5650
|
&& (candidate.only === undefined || Is.typedArray(candidate.only, Is.string))
|
|
5667
5651
|
&& (candidate.triggerKind === undefined || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);
|
|
@@ -5671,8 +5655,8 @@ var CodeActionContext;
|
|
|
5671
5655
|
var CodeAction;
|
|
5672
5656
|
(function (CodeAction) {
|
|
5673
5657
|
function create(title, kindOrCommandOrEdit, kind) {
|
|
5674
|
-
|
|
5675
|
-
|
|
5658
|
+
let result = { title };
|
|
5659
|
+
let checkKind = true;
|
|
5676
5660
|
if (typeof kindOrCommandOrEdit === 'string') {
|
|
5677
5661
|
checkKind = false;
|
|
5678
5662
|
result.kind = kindOrCommandOrEdit;
|
|
@@ -5690,7 +5674,7 @@ var CodeAction;
|
|
|
5690
5674
|
}
|
|
5691
5675
|
CodeAction.create = create;
|
|
5692
5676
|
function is(value) {
|
|
5693
|
-
|
|
5677
|
+
let candidate = value;
|
|
5694
5678
|
return candidate && Is.string(candidate.title) &&
|
|
5695
5679
|
(candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&
|
|
5696
5680
|
(candidate.kind === undefined || Is.string(candidate.kind)) &&
|
|
@@ -5711,7 +5695,7 @@ var CodeLens;
|
|
|
5711
5695
|
* Creates a new CodeLens literal.
|
|
5712
5696
|
*/
|
|
5713
5697
|
function create(range, data) {
|
|
5714
|
-
|
|
5698
|
+
let result = { range };
|
|
5715
5699
|
if (Is.defined(data)) {
|
|
5716
5700
|
result.data = data;
|
|
5717
5701
|
}
|
|
@@ -5722,7 +5706,7 @@ var CodeLens;
|
|
|
5722
5706
|
* Checks whether the given literal conforms to the {@link CodeLens} interface.
|
|
5723
5707
|
*/
|
|
5724
5708
|
function is(value) {
|
|
5725
|
-
|
|
5709
|
+
let candidate = value;
|
|
5726
5710
|
return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
|
|
5727
5711
|
}
|
|
5728
5712
|
CodeLens.is = is;
|
|
@@ -5737,14 +5721,14 @@ var FormattingOptions;
|
|
|
5737
5721
|
* Creates a new FormattingOptions literal.
|
|
5738
5722
|
*/
|
|
5739
5723
|
function create(tabSize, insertSpaces) {
|
|
5740
|
-
return { tabSize
|
|
5724
|
+
return { tabSize, insertSpaces };
|
|
5741
5725
|
}
|
|
5742
5726
|
FormattingOptions.create = create;
|
|
5743
5727
|
/**
|
|
5744
5728
|
* Checks whether the given literal conforms to the {@link FormattingOptions} interface.
|
|
5745
5729
|
*/
|
|
5746
5730
|
function is(value) {
|
|
5747
|
-
|
|
5731
|
+
let candidate = value;
|
|
5748
5732
|
return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);
|
|
5749
5733
|
}
|
|
5750
5734
|
FormattingOptions.is = is;
|
|
@@ -5759,14 +5743,14 @@ var DocumentLink;
|
|
|
5759
5743
|
* Creates a new DocumentLink literal.
|
|
5760
5744
|
*/
|
|
5761
5745
|
function create(range, target, data) {
|
|
5762
|
-
return { range
|
|
5746
|
+
return { range, target, data };
|
|
5763
5747
|
}
|
|
5764
5748
|
DocumentLink.create = create;
|
|
5765
5749
|
/**
|
|
5766
5750
|
* Checks whether the given literal conforms to the {@link DocumentLink} interface.
|
|
5767
5751
|
*/
|
|
5768
5752
|
function is(value) {
|
|
5769
|
-
|
|
5753
|
+
let candidate = value;
|
|
5770
5754
|
return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
|
|
5771
5755
|
}
|
|
5772
5756
|
DocumentLink.is = is;
|
|
@@ -5783,11 +5767,11 @@ var SelectionRange;
|
|
|
5783
5767
|
* @param parent an optional parent.
|
|
5784
5768
|
*/
|
|
5785
5769
|
function create(range, parent) {
|
|
5786
|
-
return { range
|
|
5770
|
+
return { range, parent };
|
|
5787
5771
|
}
|
|
5788
5772
|
SelectionRange.create = create;
|
|
5789
5773
|
function is(value) {
|
|
5790
|
-
|
|
5774
|
+
let candidate = value;
|
|
5791
5775
|
return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));
|
|
5792
5776
|
}
|
|
5793
5777
|
SelectionRange.is = is;
|
|
@@ -5858,7 +5842,7 @@ var SemanticTokenModifiers;
|
|
|
5858
5842
|
var SemanticTokens;
|
|
5859
5843
|
(function (SemanticTokens) {
|
|
5860
5844
|
function is(value) {
|
|
5861
|
-
|
|
5845
|
+
const candidate = value;
|
|
5862
5846
|
return Is.objectLiteral(candidate) && (candidate.resultId === undefined || typeof candidate.resultId === 'string') &&
|
|
5863
5847
|
Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number');
|
|
5864
5848
|
}
|
|
@@ -5875,11 +5859,11 @@ var InlineValueText;
|
|
|
5875
5859
|
* Creates a new InlineValueText literal.
|
|
5876
5860
|
*/
|
|
5877
5861
|
function create(range, text) {
|
|
5878
|
-
return { range
|
|
5862
|
+
return { range, text };
|
|
5879
5863
|
}
|
|
5880
5864
|
InlineValueText.create = create;
|
|
5881
5865
|
function is(value) {
|
|
5882
|
-
|
|
5866
|
+
const candidate = value;
|
|
5883
5867
|
return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text);
|
|
5884
5868
|
}
|
|
5885
5869
|
InlineValueText.is = is;
|
|
@@ -5895,11 +5879,11 @@ var InlineValueVariableLookup;
|
|
|
5895
5879
|
* Creates a new InlineValueText literal.
|
|
5896
5880
|
*/
|
|
5897
5881
|
function create(range, variableName, caseSensitiveLookup) {
|
|
5898
|
-
return { range
|
|
5882
|
+
return { range, variableName, caseSensitiveLookup };
|
|
5899
5883
|
}
|
|
5900
5884
|
InlineValueVariableLookup.create = create;
|
|
5901
5885
|
function is(value) {
|
|
5902
|
-
|
|
5886
|
+
const candidate = value;
|
|
5903
5887
|
return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup)
|
|
5904
5888
|
&& (Is.string(candidate.variableName) || candidate.variableName === undefined);
|
|
5905
5889
|
}
|
|
@@ -5916,11 +5900,11 @@ var InlineValueEvaluatableExpression;
|
|
|
5916
5900
|
* Creates a new InlineValueEvaluatableExpression literal.
|
|
5917
5901
|
*/
|
|
5918
5902
|
function create(range, expression) {
|
|
5919
|
-
return { range
|
|
5903
|
+
return { range, expression };
|
|
5920
5904
|
}
|
|
5921
5905
|
InlineValueEvaluatableExpression.create = create;
|
|
5922
5906
|
function is(value) {
|
|
5923
|
-
|
|
5907
|
+
const candidate = value;
|
|
5924
5908
|
return candidate !== undefined && candidate !== null && Range.is(candidate.range)
|
|
5925
5909
|
&& (Is.string(candidate.expression) || candidate.expression === undefined);
|
|
5926
5910
|
}
|
|
@@ -5938,14 +5922,14 @@ var InlineValueContext;
|
|
|
5938
5922
|
* Creates a new InlineValueContext literal.
|
|
5939
5923
|
*/
|
|
5940
5924
|
function create(frameId, stoppedLocation) {
|
|
5941
|
-
return { frameId
|
|
5925
|
+
return { frameId, stoppedLocation };
|
|
5942
5926
|
}
|
|
5943
5927
|
InlineValueContext.create = create;
|
|
5944
5928
|
/**
|
|
5945
5929
|
* Checks whether the given literal conforms to the {@link InlineValueContext} interface.
|
|
5946
5930
|
*/
|
|
5947
5931
|
function is(value) {
|
|
5948
|
-
|
|
5932
|
+
const candidate = value;
|
|
5949
5933
|
return Is.defined(candidate) && Range.is(value.stoppedLocation);
|
|
5950
5934
|
}
|
|
5951
5935
|
InlineValueContext.is = is;
|
|
@@ -5973,11 +5957,11 @@ var InlayHintKind;
|
|
|
5973
5957
|
var InlayHintLabelPart;
|
|
5974
5958
|
(function (InlayHintLabelPart) {
|
|
5975
5959
|
function create(value) {
|
|
5976
|
-
return { value
|
|
5960
|
+
return { value };
|
|
5977
5961
|
}
|
|
5978
5962
|
InlayHintLabelPart.create = create;
|
|
5979
5963
|
function is(value) {
|
|
5980
|
-
|
|
5964
|
+
const candidate = value;
|
|
5981
5965
|
return Is.objectLiteral(candidate)
|
|
5982
5966
|
&& (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))
|
|
5983
5967
|
&& (candidate.location === undefined || Location.is(candidate.location))
|
|
@@ -5988,7 +5972,7 @@ var InlayHintLabelPart;
|
|
|
5988
5972
|
var InlayHint;
|
|
5989
5973
|
(function (InlayHint) {
|
|
5990
5974
|
function create(position, label, kind) {
|
|
5991
|
-
|
|
5975
|
+
const result = { position, label };
|
|
5992
5976
|
if (kind !== undefined) {
|
|
5993
5977
|
result.kind = kind;
|
|
5994
5978
|
}
|
|
@@ -5996,7 +5980,7 @@ var InlayHint;
|
|
|
5996
5980
|
}
|
|
5997
5981
|
InlayHint.create = create;
|
|
5998
5982
|
function is(value) {
|
|
5999
|
-
|
|
5983
|
+
const candidate = value;
|
|
6000
5984
|
return Is.objectLiteral(candidate) && Position.is(candidate.position)
|
|
6001
5985
|
&& (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is))
|
|
6002
5986
|
&& (candidate.kind === undefined || InlayHintKind.is(candidate.kind))
|
|
@@ -6010,21 +5994,21 @@ var InlayHint;
|
|
|
6010
5994
|
var StringValue;
|
|
6011
5995
|
(function (StringValue) {
|
|
6012
5996
|
function createSnippet(value) {
|
|
6013
|
-
return { kind: 'snippet', value
|
|
5997
|
+
return { kind: 'snippet', value };
|
|
6014
5998
|
}
|
|
6015
5999
|
StringValue.createSnippet = createSnippet;
|
|
6016
6000
|
})(StringValue || (StringValue = {}));
|
|
6017
6001
|
var InlineCompletionItem;
|
|
6018
6002
|
(function (InlineCompletionItem) {
|
|
6019
6003
|
function create(insertText, filterText, range, command) {
|
|
6020
|
-
return { insertText
|
|
6004
|
+
return { insertText, filterText, range, command };
|
|
6021
6005
|
}
|
|
6022
6006
|
InlineCompletionItem.create = create;
|
|
6023
6007
|
})(InlineCompletionItem || (InlineCompletionItem = {}));
|
|
6024
6008
|
var InlineCompletionList;
|
|
6025
6009
|
(function (InlineCompletionList) {
|
|
6026
6010
|
function create(items) {
|
|
6027
|
-
return { items
|
|
6011
|
+
return { items };
|
|
6028
6012
|
}
|
|
6029
6013
|
InlineCompletionList.create = create;
|
|
6030
6014
|
})(InlineCompletionList || (InlineCompletionList = {}));
|
|
@@ -6048,26 +6032,26 @@ var InlineCompletionTriggerKind;
|
|
|
6048
6032
|
var SelectedCompletionInfo;
|
|
6049
6033
|
(function (SelectedCompletionInfo) {
|
|
6050
6034
|
function create(range, text) {
|
|
6051
|
-
return { range
|
|
6035
|
+
return { range, text };
|
|
6052
6036
|
}
|
|
6053
6037
|
SelectedCompletionInfo.create = create;
|
|
6054
6038
|
})(SelectedCompletionInfo || (SelectedCompletionInfo = {}));
|
|
6055
6039
|
var InlineCompletionContext;
|
|
6056
6040
|
(function (InlineCompletionContext) {
|
|
6057
6041
|
function create(triggerKind, selectedCompletionInfo) {
|
|
6058
|
-
return { triggerKind
|
|
6042
|
+
return { triggerKind, selectedCompletionInfo };
|
|
6059
6043
|
}
|
|
6060
6044
|
InlineCompletionContext.create = create;
|
|
6061
6045
|
})(InlineCompletionContext || (InlineCompletionContext = {}));
|
|
6062
6046
|
var WorkspaceFolder;
|
|
6063
6047
|
(function (WorkspaceFolder) {
|
|
6064
6048
|
function is(value) {
|
|
6065
|
-
|
|
6049
|
+
const candidate = value;
|
|
6066
6050
|
return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name);
|
|
6067
6051
|
}
|
|
6068
6052
|
WorkspaceFolder.is = is;
|
|
6069
6053
|
})(WorkspaceFolder || (WorkspaceFolder = {}));
|
|
6070
|
-
|
|
6054
|
+
const EOL = ['\n', '\r\n', '\r'];
|
|
6071
6055
|
/**
|
|
6072
6056
|
* @deprecated Use the text document from the new vscode-languageserver-textdocument package.
|
|
6073
6057
|
*/
|
|
@@ -6088,25 +6072,25 @@ var TextDocument;
|
|
|
6088
6072
|
* Checks whether the given literal conforms to the {@link ITextDocument} interface.
|
|
6089
6073
|
*/
|
|
6090
6074
|
function is(value) {
|
|
6091
|
-
|
|
6075
|
+
let candidate = value;
|
|
6092
6076
|
return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount)
|
|
6093
6077
|
&& Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;
|
|
6094
6078
|
}
|
|
6095
6079
|
TextDocument.is = is;
|
|
6096
6080
|
function applyEdits(document, edits) {
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6081
|
+
let text = document.getText();
|
|
6082
|
+
let sortedEdits = mergeSort(edits, (a, b) => {
|
|
6083
|
+
let diff = a.range.start.line - b.range.start.line;
|
|
6100
6084
|
if (diff === 0) {
|
|
6101
6085
|
return a.range.start.character - b.range.start.character;
|
|
6102
6086
|
}
|
|
6103
6087
|
return diff;
|
|
6104
6088
|
});
|
|
6105
|
-
|
|
6106
|
-
for (
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6089
|
+
let lastModifiedOffset = text.length;
|
|
6090
|
+
for (let i = sortedEdits.length - 1; i >= 0; i--) {
|
|
6091
|
+
let e = sortedEdits[i];
|
|
6092
|
+
let startOffset = document.offsetAt(e.range.start);
|
|
6093
|
+
let endOffset = document.offsetAt(e.range.end);
|
|
6110
6094
|
if (endOffset <= lastModifiedOffset) {
|
|
6111
6095
|
text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);
|
|
6112
6096
|
}
|
|
@@ -6123,16 +6107,16 @@ var TextDocument;
|
|
|
6123
6107
|
// sorted
|
|
6124
6108
|
return data;
|
|
6125
6109
|
}
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6110
|
+
const p = (data.length / 2) | 0;
|
|
6111
|
+
const left = data.slice(0, p);
|
|
6112
|
+
const right = data.slice(p);
|
|
6129
6113
|
mergeSort(left, compare);
|
|
6130
6114
|
mergeSort(right, compare);
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6115
|
+
let leftIdx = 0;
|
|
6116
|
+
let rightIdx = 0;
|
|
6117
|
+
let i = 0;
|
|
6134
6118
|
while (leftIdx < left.length && rightIdx < right.length) {
|
|
6135
|
-
|
|
6119
|
+
let ret = compare(left[leftIdx], right[rightIdx]);
|
|
6136
6120
|
if (ret <= 0) {
|
|
6137
6121
|
// smaller_equal -> take left to preserve order
|
|
6138
6122
|
data[i++] = left[leftIdx++];
|
|
@@ -6154,59 +6138,47 @@ var TextDocument;
|
|
|
6154
6138
|
/**
|
|
6155
6139
|
* @deprecated Use the text document from the new vscode-languageserver-textdocument package.
|
|
6156
6140
|
*/
|
|
6157
|
-
|
|
6158
|
-
|
|
6141
|
+
class FullTextDocument {
|
|
6142
|
+
constructor(uri, languageId, version, content) {
|
|
6159
6143
|
this._uri = uri;
|
|
6160
6144
|
this._languageId = languageId;
|
|
6161
6145
|
this._version = version;
|
|
6162
6146
|
this._content = content;
|
|
6163
6147
|
this._lineOffsets = undefined;
|
|
6164
6148
|
}
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
},
|
|
6176
|
-
enumerable: false,
|
|
6177
|
-
configurable: true
|
|
6178
|
-
});
|
|
6179
|
-
Object.defineProperty(FullTextDocument.prototype, "version", {
|
|
6180
|
-
get: function () {
|
|
6181
|
-
return this._version;
|
|
6182
|
-
},
|
|
6183
|
-
enumerable: false,
|
|
6184
|
-
configurable: true
|
|
6185
|
-
});
|
|
6186
|
-
FullTextDocument.prototype.getText = function (range) {
|
|
6149
|
+
get uri() {
|
|
6150
|
+
return this._uri;
|
|
6151
|
+
}
|
|
6152
|
+
get languageId() {
|
|
6153
|
+
return this._languageId;
|
|
6154
|
+
}
|
|
6155
|
+
get version() {
|
|
6156
|
+
return this._version;
|
|
6157
|
+
}
|
|
6158
|
+
getText(range) {
|
|
6187
6159
|
if (range) {
|
|
6188
|
-
|
|
6189
|
-
|
|
6160
|
+
let start = this.offsetAt(range.start);
|
|
6161
|
+
let end = this.offsetAt(range.end);
|
|
6190
6162
|
return this._content.substring(start, end);
|
|
6191
6163
|
}
|
|
6192
6164
|
return this._content;
|
|
6193
|
-
}
|
|
6194
|
-
|
|
6165
|
+
}
|
|
6166
|
+
update(event, version) {
|
|
6195
6167
|
this._content = event.text;
|
|
6196
6168
|
this._version = version;
|
|
6197
6169
|
this._lineOffsets = undefined;
|
|
6198
|
-
}
|
|
6199
|
-
|
|
6170
|
+
}
|
|
6171
|
+
getLineOffsets() {
|
|
6200
6172
|
if (this._lineOffsets === undefined) {
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
for (
|
|
6173
|
+
let lineOffsets = [];
|
|
6174
|
+
let text = this._content;
|
|
6175
|
+
let isLineStart = true;
|
|
6176
|
+
for (let i = 0; i < text.length; i++) {
|
|
6205
6177
|
if (isLineStart) {
|
|
6206
6178
|
lineOffsets.push(i);
|
|
6207
6179
|
isLineStart = false;
|
|
6208
6180
|
}
|
|
6209
|
-
|
|
6181
|
+
let ch = text.charAt(i);
|
|
6210
6182
|
isLineStart = (ch === '\r' || ch === '\n');
|
|
6211
6183
|
if (ch === '\r' && i + 1 < text.length && text.charAt(i + 1) === '\n') {
|
|
6212
6184
|
i++;
|
|
@@ -6218,16 +6190,16 @@ var FullTextDocument = /** @class */ (function () {
|
|
|
6218
6190
|
this._lineOffsets = lineOffsets;
|
|
6219
6191
|
}
|
|
6220
6192
|
return this._lineOffsets;
|
|
6221
|
-
}
|
|
6222
|
-
|
|
6193
|
+
}
|
|
6194
|
+
positionAt(offset) {
|
|
6223
6195
|
offset = Math.max(Math.min(offset, this._content.length), 0);
|
|
6224
|
-
|
|
6225
|
-
|
|
6196
|
+
let lineOffsets = this.getLineOffsets();
|
|
6197
|
+
let low = 0, high = lineOffsets.length;
|
|
6226
6198
|
if (high === 0) {
|
|
6227
6199
|
return Position.create(0, offset);
|
|
6228
6200
|
}
|
|
6229
6201
|
while (low < high) {
|
|
6230
|
-
|
|
6202
|
+
let mid = Math.floor((low + high) / 2);
|
|
6231
6203
|
if (lineOffsets[mid] > offset) {
|
|
6232
6204
|
high = mid;
|
|
6233
6205
|
}
|
|
@@ -6237,33 +6209,28 @@ var FullTextDocument = /** @class */ (function () {
|
|
|
6237
6209
|
}
|
|
6238
6210
|
// low is the least x for which the line offset is larger than the current offset
|
|
6239
6211
|
// or array.length if no line offset is larger than the current offset
|
|
6240
|
-
|
|
6212
|
+
let line = low - 1;
|
|
6241
6213
|
return Position.create(line, offset - lineOffsets[line]);
|
|
6242
|
-
}
|
|
6243
|
-
|
|
6244
|
-
|
|
6214
|
+
}
|
|
6215
|
+
offsetAt(position) {
|
|
6216
|
+
let lineOffsets = this.getLineOffsets();
|
|
6245
6217
|
if (position.line >= lineOffsets.length) {
|
|
6246
6218
|
return this._content.length;
|
|
6247
6219
|
}
|
|
6248
6220
|
else if (position.line < 0) {
|
|
6249
6221
|
return 0;
|
|
6250
6222
|
}
|
|
6251
|
-
|
|
6252
|
-
|
|
6223
|
+
let lineOffset = lineOffsets[position.line];
|
|
6224
|
+
let nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;
|
|
6253
6225
|
return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);
|
|
6254
|
-
}
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
enumerable: false,
|
|
6260
|
-
configurable: true
|
|
6261
|
-
});
|
|
6262
|
-
return FullTextDocument;
|
|
6263
|
-
}());
|
|
6226
|
+
}
|
|
6227
|
+
get lineCount() {
|
|
6228
|
+
return this.getLineOffsets().length;
|
|
6229
|
+
}
|
|
6230
|
+
}
|
|
6264
6231
|
var Is;
|
|
6265
6232
|
(function (Is) {
|
|
6266
|
-
|
|
6233
|
+
const toString = Object.prototype.toString;
|
|
6267
6234
|
function defined(value) {
|
|
6268
6235
|
return typeof value !== 'undefined';
|
|
6269
6236
|
}
|
|
@@ -6377,8 +6344,8 @@ exports.ProtocolNotificationType = ProtocolNotificationType;
|
|
|
6377
6344
|
* ------------------------------------------------------------------------------------------ */
|
|
6378
6345
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6379
6346
|
exports.WorkspaceSymbolRequest = exports.CodeActionResolveRequest = exports.CodeActionRequest = exports.DocumentSymbolRequest = exports.DocumentHighlightRequest = exports.ReferencesRequest = exports.DefinitionRequest = exports.SignatureHelpRequest = exports.SignatureHelpTriggerKind = exports.HoverRequest = exports.CompletionResolveRequest = exports.CompletionRequest = exports.CompletionTriggerKind = exports.PublishDiagnosticsNotification = exports.WatchKind = exports.RelativePattern = exports.FileChangeType = exports.DidChangeWatchedFilesNotification = exports.WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentNotification = exports.TextDocumentSaveReason = exports.DidSaveTextDocumentNotification = exports.DidCloseTextDocumentNotification = exports.DidChangeTextDocumentNotification = exports.TextDocumentContentChangeEvent = exports.DidOpenTextDocumentNotification = exports.TextDocumentSyncKind = exports.TelemetryEventNotification = exports.LogMessageNotification = exports.ShowMessageRequest = exports.ShowMessageNotification = exports.MessageType = exports.DidChangeConfigurationNotification = exports.ExitNotification = exports.ShutdownRequest = exports.InitializedNotification = exports.InitializeErrorCodes = exports.InitializeRequest = exports.WorkDoneProgressOptions = exports.TextDocumentRegistrationOptions = exports.StaticRegistrationOptions = exports.PositionEncodingKind = exports.FailureHandlingKind = exports.ResourceOperationKind = exports.UnregistrationRequest = exports.RegistrationRequest = exports.DocumentSelector = exports.NotebookCellTextDocumentFilter = exports.NotebookDocumentFilter = exports.TextDocumentFilter = void 0;
|
|
6380
|
-
exports.
|
|
6381
|
-
exports.InlineCompletionRequest = exports.DidCloseNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.NotebookCellArrayChange = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCell = exports.ExecutionSummary = exports.NotebookCellKind = exports.DiagnosticRefreshRequest = exports.WorkspaceDiagnosticRequest = exports.DocumentDiagnosticRequest = exports.DocumentDiagnosticReportKind = exports.DiagnosticServerCancellationData = exports.InlayHintRefreshRequest = exports.InlayHintResolveRequest = exports.InlayHintRequest = exports.InlineValueRefreshRequest = exports.InlineValueRequest = exports.TypeHierarchySupertypesRequest = exports.TypeHierarchySubtypesRequest = void 0;
|
|
6347
|
+
exports.MonikerRequest = exports.MonikerKind = exports.UniquenessLevel = exports.WillDeleteFilesRequest = exports.DidDeleteFilesNotification = exports.WillRenameFilesRequest = exports.DidRenameFilesNotification = exports.WillCreateFilesRequest = exports.DidCreateFilesNotification = exports.FileOperationPatternKind = exports.LinkedEditingRangeRequest = exports.ShowDocumentRequest = exports.SemanticTokensRegistrationType = exports.SemanticTokensRefreshRequest = exports.SemanticTokensRangeRequest = exports.SemanticTokensDeltaRequest = exports.SemanticTokensRequest = exports.TokenFormat = exports.CallHierarchyPrepareRequest = exports.CallHierarchyOutgoingCallsRequest = exports.CallHierarchyIncomingCallsRequest = exports.WorkDoneProgressCancelNotification = exports.WorkDoneProgressCreateRequest = exports.WorkDoneProgress = exports.SelectionRangeRequest = exports.DeclarationRequest = exports.FoldingRangeRefreshRequest = exports.FoldingRangeRequest = exports.ColorPresentationRequest = exports.DocumentColorRequest = exports.ConfigurationRequest = exports.DidChangeWorkspaceFoldersNotification = exports.WorkspaceFoldersRequest = exports.TypeDefinitionRequest = exports.ImplementationRequest = exports.ApplyWorkspaceEditRequest = exports.ExecuteCommandRequest = exports.PrepareRenameRequest = exports.RenameRequest = exports.PrepareSupportDefaultBehavior = exports.DocumentOnTypeFormattingRequest = exports.DocumentRangesFormattingRequest = exports.DocumentRangeFormattingRequest = exports.DocumentFormattingRequest = exports.DocumentLinkResolveRequest = exports.DocumentLinkRequest = exports.CodeLensRefreshRequest = exports.CodeLensResolveRequest = exports.CodeLensRequest = exports.WorkspaceSymbolResolveRequest = void 0;
|
|
6348
|
+
exports.InlineCompletionRequest = exports.DidCloseNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.NotebookCellArrayChange = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCell = exports.ExecutionSummary = exports.NotebookCellKind = exports.DiagnosticRefreshRequest = exports.WorkspaceDiagnosticRequest = exports.DocumentDiagnosticRequest = exports.DocumentDiagnosticReportKind = exports.DiagnosticServerCancellationData = exports.InlayHintRefreshRequest = exports.InlayHintResolveRequest = exports.InlayHintRequest = exports.InlineValueRefreshRequest = exports.InlineValueRequest = exports.TypeHierarchySupertypesRequest = exports.TypeHierarchySubtypesRequest = exports.TypeHierarchyPrepareRequest = void 0;
|
|
6382
6349
|
const messages_1 = __webpack_require__(25);
|
|
6383
6350
|
const vscode_languageserver_types_1 = __webpack_require__(24);
|
|
6384
6351
|
const Is = __webpack_require__(27);
|
|
@@ -6396,6 +6363,7 @@ Object.defineProperty(exports, "DocumentColorRequest", ({ enumerable: true, get:
|
|
|
6396
6363
|
Object.defineProperty(exports, "ColorPresentationRequest", ({ enumerable: true, get: function () { return protocol_colorProvider_1.ColorPresentationRequest; } }));
|
|
6397
6364
|
const protocol_foldingRange_1 = __webpack_require__(33);
|
|
6398
6365
|
Object.defineProperty(exports, "FoldingRangeRequest", ({ enumerable: true, get: function () { return protocol_foldingRange_1.FoldingRangeRequest; } }));
|
|
6366
|
+
Object.defineProperty(exports, "FoldingRangeRefreshRequest", ({ enumerable: true, get: function () { return protocol_foldingRange_1.FoldingRangeRefreshRequest; } }));
|
|
6399
6367
|
const protocol_declaration_1 = __webpack_require__(34);
|
|
6400
6368
|
Object.defineProperty(exports, "DeclarationRequest", ({ enumerable: true, get: function () { return protocol_declaration_1.DeclarationRequest; } }));
|
|
6401
6369
|
const protocol_selectionRange_1 = __webpack_require__(35);
|
|
@@ -6747,6 +6715,12 @@ var MessageType;
|
|
|
6747
6715
|
* A log message.
|
|
6748
6716
|
*/
|
|
6749
6717
|
MessageType.Log = 4;
|
|
6718
|
+
/**
|
|
6719
|
+
* A debug message.
|
|
6720
|
+
*
|
|
6721
|
+
* @since 3.18.0
|
|
6722
|
+
*/
|
|
6723
|
+
MessageType.Debug = 5;
|
|
6750
6724
|
})(MessageType || (exports.MessageType = MessageType = {}));
|
|
6751
6725
|
/**
|
|
6752
6726
|
* The show message notification is sent from a server to a client to ask
|
|
@@ -7532,7 +7506,7 @@ var ColorPresentationRequest;
|
|
|
7532
7506
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
7533
7507
|
*--------------------------------------------------------------------------------------------*/
|
|
7534
7508
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7535
|
-
exports.FoldingRangeRequest = void 0;
|
|
7509
|
+
exports.FoldingRangeRefreshRequest = exports.FoldingRangeRequest = void 0;
|
|
7536
7510
|
const messages_1 = __webpack_require__(25);
|
|
7537
7511
|
/**
|
|
7538
7512
|
* A request to provide folding ranges in a document. The request's
|
|
@@ -7546,6 +7520,16 @@ var FoldingRangeRequest;
|
|
|
7546
7520
|
FoldingRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;
|
|
7547
7521
|
FoldingRangeRequest.type = new messages_1.ProtocolRequestType(FoldingRangeRequest.method);
|
|
7548
7522
|
})(FoldingRangeRequest || (exports.FoldingRangeRequest = FoldingRangeRequest = {}));
|
|
7523
|
+
/**
|
|
7524
|
+
* @since 3.18.0
|
|
7525
|
+
* @proposed
|
|
7526
|
+
*/
|
|
7527
|
+
var FoldingRangeRefreshRequest;
|
|
7528
|
+
(function (FoldingRangeRefreshRequest) {
|
|
7529
|
+
FoldingRangeRefreshRequest.method = `workspace/foldingRange/refresh`;
|
|
7530
|
+
FoldingRangeRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;
|
|
7531
|
+
FoldingRangeRefreshRequest.type = new messages_1.ProtocolRequestType0(FoldingRangeRefreshRequest.method);
|
|
7532
|
+
})(FoldingRangeRefreshRequest || (exports.FoldingRangeRefreshRequest = FoldingRangeRefreshRequest = {}));
|
|
7549
7533
|
|
|
7550
7534
|
|
|
7551
7535
|
/***/ }),
|
|
@@ -11033,6 +11017,7 @@ const inlineCompletion_1 = __webpack_require__(105);
|
|
|
11033
11017
|
*/
|
|
11034
11018
|
var RevealOutputChannelOn;
|
|
11035
11019
|
(function (RevealOutputChannelOn) {
|
|
11020
|
+
RevealOutputChannelOn[RevealOutputChannelOn["Debug"] = 0] = "Debug";
|
|
11036
11021
|
RevealOutputChannelOn[RevealOutputChannelOn["Info"] = 1] = "Info";
|
|
11037
11022
|
RevealOutputChannelOn[RevealOutputChannelOn["Warn"] = 2] = "Warn";
|
|
11038
11023
|
RevealOutputChannelOn[RevealOutputChannelOn["Error"] = 3] = "Error";
|
|
@@ -11554,31 +11539,25 @@ class BaseLanguageClient {
|
|
|
11554
11539
|
}
|
|
11555
11540
|
return data.toString();
|
|
11556
11541
|
}
|
|
11542
|
+
debug(message, data, showNotification = true) {
|
|
11543
|
+
this.logOutputMessage(vscode_languageserver_protocol_1.MessageType.Debug, RevealOutputChannelOn.Debug, 'Debug', message, data, showNotification);
|
|
11544
|
+
}
|
|
11557
11545
|
info(message, data, showNotification = true) {
|
|
11558
|
-
this.
|
|
11559
|
-
if (data !== null && data !== undefined) {
|
|
11560
|
-
this.outputChannel.appendLine(this.data2String(data));
|
|
11561
|
-
}
|
|
11562
|
-
if (showNotification && this._clientOptions.revealOutputChannelOn <= RevealOutputChannelOn.Info) {
|
|
11563
|
-
this.showNotificationMessage(vscode_languageserver_protocol_1.MessageType.Info, message);
|
|
11564
|
-
}
|
|
11546
|
+
this.logOutputMessage(vscode_languageserver_protocol_1.MessageType.Info, RevealOutputChannelOn.Info, 'Info', message, data, showNotification);
|
|
11565
11547
|
}
|
|
11566
11548
|
warn(message, data, showNotification = true) {
|
|
11567
|
-
this.
|
|
11568
|
-
if (data !== null && data !== undefined) {
|
|
11569
|
-
this.outputChannel.appendLine(this.data2String(data));
|
|
11570
|
-
}
|
|
11571
|
-
if (showNotification && this._clientOptions.revealOutputChannelOn <= RevealOutputChannelOn.Warn) {
|
|
11572
|
-
this.showNotificationMessage(vscode_languageserver_protocol_1.MessageType.Warning, message);
|
|
11573
|
-
}
|
|
11549
|
+
this.logOutputMessage(vscode_languageserver_protocol_1.MessageType.Warning, RevealOutputChannelOn.Warn, 'Warn', message, data, showNotification);
|
|
11574
11550
|
}
|
|
11575
11551
|
error(message, data, showNotification = true) {
|
|
11576
|
-
this.
|
|
11552
|
+
this.logOutputMessage(vscode_languageserver_protocol_1.MessageType.Error, RevealOutputChannelOn.Error, 'Error', message, data, showNotification);
|
|
11553
|
+
}
|
|
11554
|
+
logOutputMessage(type, reveal, name, message, data, showNotification) {
|
|
11555
|
+
this.outputChannel.appendLine(`[${name.padEnd(5)} - ${(new Date().toLocaleTimeString())}] ${message}`);
|
|
11577
11556
|
if (data !== null && data !== undefined) {
|
|
11578
11557
|
this.outputChannel.appendLine(this.data2String(data));
|
|
11579
11558
|
}
|
|
11580
|
-
if (showNotification === 'force' || (showNotification && this._clientOptions.revealOutputChannelOn <=
|
|
11581
|
-
this.showNotificationMessage(
|
|
11559
|
+
if (showNotification === 'force' || (showNotification && this._clientOptions.revealOutputChannelOn <= reveal)) {
|
|
11560
|
+
this.showNotificationMessage(type, message);
|
|
11582
11561
|
}
|
|
11583
11562
|
}
|
|
11584
11563
|
showNotificationMessage(type, message) {
|
|
@@ -11674,6 +11653,9 @@ class BaseLanguageClient {
|
|
|
11674
11653
|
case vscode_languageserver_protocol_1.MessageType.Info:
|
|
11675
11654
|
this.info(message.message, undefined, false);
|
|
11676
11655
|
break;
|
|
11656
|
+
case vscode_languageserver_protocol_1.MessageType.Debug:
|
|
11657
|
+
this.debug(message.message, undefined, false);
|
|
11658
|
+
break;
|
|
11677
11659
|
default:
|
|
11678
11660
|
this.outputChannel.appendLine(message.message);
|
|
11679
11661
|
}
|
|
@@ -12173,11 +12155,15 @@ class BaseLanguageClient {
|
|
|
12173
12155
|
async handleConnectionError(error, message, count) {
|
|
12174
12156
|
const handlerResult = await this._clientOptions.errorHandler.error(error, message, count);
|
|
12175
12157
|
if (handlerResult.action === ErrorAction.Shutdown) {
|
|
12176
|
-
this.error(handlerResult.message ?? `Client ${this._name}: connection to server is erroring.
|
|
12158
|
+
this.error(handlerResult.message ?? `Client ${this._name}: connection to server is erroring.\n${error.message}\nShutting down server.`, undefined, handlerResult.handled === true ? false : 'force');
|
|
12177
12159
|
this.stop().catch((error) => {
|
|
12178
12160
|
this.error(`Stopping server failed`, error, false);
|
|
12179
12161
|
});
|
|
12180
12162
|
}
|
|
12163
|
+
else {
|
|
12164
|
+
this.error(handlerResult.message ??
|
|
12165
|
+
`Client ${this._name}: connection to server is erroring.\n${error.message}`, undefined, handlerResult.handled === true ? false : 'force');
|
|
12166
|
+
}
|
|
12181
12167
|
}
|
|
12182
12168
|
hookConfigurationChanged(connection) {
|
|
12183
12169
|
this._listeners.push(vscode_1.workspace.onDidChangeConfiguration(() => {
|
|
@@ -17527,7 +17513,6 @@ exports.CodeLensFeature = CodeLensFeature;
|
|
|
17527
17513
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
17528
17514
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
17529
17515
|
* ------------------------------------------------------------------------------------------ */
|
|
17530
|
-
/// <reference path="../../typings/vscode.proposed.formatMultipleRanges.d.ts" />
|
|
17531
17516
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
17532
17517
|
exports.DocumentOnTypeFormattingFeature = exports.DocumentRangeFormattingFeature = exports.DocumentFormattingFeature = void 0;
|
|
17533
17518
|
const vscode_1 = __webpack_require__(1);
|
|
@@ -18471,8 +18456,14 @@ class FoldingRangeFeature extends features_1.TextDocumentLanguageFeature {
|
|
|
18471
18456
|
capability.lineFoldingOnly = true;
|
|
18472
18457
|
capability.foldingRangeKind = { valueSet: [vscode_languageserver_protocol_1.FoldingRangeKind.Comment, vscode_languageserver_protocol_1.FoldingRangeKind.Imports, vscode_languageserver_protocol_1.FoldingRangeKind.Region] };
|
|
18473
18458
|
capability.foldingRange = { collapsedText: false };
|
|
18459
|
+
(0, features_1.ensure)((0, features_1.ensure)(capabilities, 'workspace'), 'foldingRange').refreshSupport = true;
|
|
18474
18460
|
}
|
|
18475
18461
|
initialize(capabilities, documentSelector) {
|
|
18462
|
+
this._client.onRequest(vscode_languageserver_protocol_1.FoldingRangeRefreshRequest.type, async () => {
|
|
18463
|
+
for (const provider of this.getAllProviders()) {
|
|
18464
|
+
provider.onDidChangeFoldingRange.fire();
|
|
18465
|
+
}
|
|
18466
|
+
});
|
|
18476
18467
|
let [id, options] = this.getRegistration(documentSelector, capabilities.foldingRangeProvider);
|
|
18477
18468
|
if (!id || !options) {
|
|
18478
18469
|
return;
|
|
@@ -18481,7 +18472,9 @@ class FoldingRangeFeature extends features_1.TextDocumentLanguageFeature {
|
|
|
18481
18472
|
}
|
|
18482
18473
|
registerLanguageProvider(options) {
|
|
18483
18474
|
const selector = options.documentSelector;
|
|
18475
|
+
const eventEmitter = new vscode_1.EventEmitter();
|
|
18484
18476
|
const provider = {
|
|
18477
|
+
onDidChangeFoldingRanges: eventEmitter.event,
|
|
18485
18478
|
provideFoldingRanges: (document, context, token) => {
|
|
18486
18479
|
const client = this._client;
|
|
18487
18480
|
const provideFoldingRanges = (document, _, token) => {
|
|
@@ -18503,7 +18496,7 @@ class FoldingRangeFeature extends features_1.TextDocumentLanguageFeature {
|
|
|
18503
18496
|
: provideFoldingRanges(document, context, token);
|
|
18504
18497
|
}
|
|
18505
18498
|
};
|
|
18506
|
-
return [vscode_1.languages.registerFoldingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), provider];
|
|
18499
|
+
return [vscode_1.languages.registerFoldingRangeProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider), { provider: provider, onDidChangeFoldingRange: eventEmitter }];
|
|
18507
18500
|
}
|
|
18508
18501
|
}
|
|
18509
18502
|
exports.FoldingRangeFeature = FoldingRangeFeature;
|