@ttsc/vscode 0.13.1 → 0.14.0-dev.20260528.1

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/lib/extension.js CHANGED
@@ -76,8 +76,8 @@ var require_is = __commonJS({
76
76
  if (value instanceof Promise) {
77
77
  return value;
78
78
  } else if (thenable(value)) {
79
- return new Promise((resolve, reject) => {
80
- value.then((resolved) => resolve(resolved), (error2) => reject(error2));
79
+ return new Promise((resolve2, reject) => {
80
+ value.then((resolved) => resolve2(resolved), (error2) => reject(error2));
81
81
  });
82
82
  } else {
83
83
  return Promise.resolve(value);
@@ -1088,8 +1088,8 @@ var require_semaphore = __commonJS({
1088
1088
  this._waiting = [];
1089
1089
  }
1090
1090
  lock(thunk) {
1091
- return new Promise((resolve, reject) => {
1092
- this._waiting.push({ thunk, resolve, reject });
1091
+ return new Promise((resolve2, reject) => {
1092
+ this._waiting.push({ thunk, resolve: resolve2, reject });
1093
1093
  this.runNext();
1094
1094
  });
1095
1095
  }
@@ -2579,9 +2579,9 @@ ${JSON.stringify(message, null, 4)}`);
2579
2579
  if (typeof cancellationStrategy.sender.enableCancellation === "function") {
2580
2580
  cancellationStrategy.sender.enableCancellation(requestMessage);
2581
2581
  }
2582
- return new Promise(async (resolve, reject) => {
2582
+ return new Promise(async (resolve2, reject) => {
2583
2583
  const resolveWithCleanup = (r) => {
2584
- resolve(r);
2584
+ resolve2(r);
2585
2585
  cancellationStrategy.sender.cleanup(id);
2586
2586
  disposable?.dispose();
2587
2587
  };
@@ -2992,10 +2992,10 @@ var require_ril = __commonJS({
2992
2992
  return api_1.Disposable.create(() => this.stream.off("end", listener));
2993
2993
  }
2994
2994
  write(data, encoding) {
2995
- return new Promise((resolve, reject) => {
2995
+ return new Promise((resolve2, reject) => {
2996
2996
  const callback = (error) => {
2997
2997
  if (error === void 0 || error === null) {
2998
- resolve();
2998
+ resolve2();
2999
2999
  } else {
3000
3000
  reject(error);
3001
3001
  }
@@ -3098,7 +3098,7 @@ var require_main = __commonJS({
3098
3098
  exports2.createMessageConnection = exports2.createServerSocketTransport = exports2.createClientSocketTransport = exports2.createServerPipeTransport = exports2.createClientPipeTransport = exports2.generateRandomPipeName = exports2.StreamMessageWriter = exports2.StreamMessageReader = exports2.SocketMessageWriter = exports2.SocketMessageReader = exports2.PortMessageWriter = exports2.PortMessageReader = exports2.IPCMessageWriter = exports2.IPCMessageReader = void 0;
3099
3099
  var ril_1 = require_ril();
3100
3100
  ril_1.default.install();
3101
- var path2 = require("path");
3101
+ var path3 = require("path");
3102
3102
  var os = require("os");
3103
3103
  var crypto_1 = require("crypto");
3104
3104
  var net_1 = require("net");
@@ -3234,9 +3234,9 @@ var require_main = __commonJS({
3234
3234
  }
3235
3235
  let result;
3236
3236
  if (XDG_RUNTIME_DIR) {
3237
- result = path2.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`);
3237
+ result = path3.join(XDG_RUNTIME_DIR, `vscode-ipc-${randomSuffix}.sock`);
3238
3238
  } else {
3239
- result = path2.join(os.tmpdir(), `vscode-${randomSuffix}.sock`);
3239
+ result = path3.join(os.tmpdir(), `vscode-${randomSuffix}.sock`);
3240
3240
  }
3241
3241
  const limit = safeIpcPathLengths.get(process.platform);
3242
3242
  if (limit !== void 0 && result.length > limit) {
@@ -3247,10 +3247,10 @@ var require_main = __commonJS({
3247
3247
  exports2.generateRandomPipeName = generateRandomPipeName;
3248
3248
  function createClientPipeTransport(pipeName, encoding = "utf-8") {
3249
3249
  let connectResolve;
3250
- const connected = new Promise((resolve, _reject) => {
3251
- connectResolve = resolve;
3250
+ const connected = new Promise((resolve2, _reject) => {
3251
+ connectResolve = resolve2;
3252
3252
  });
3253
- return new Promise((resolve, reject) => {
3253
+ return new Promise((resolve2, reject) => {
3254
3254
  let server = (0, net_1.createServer)((socket) => {
3255
3255
  server.close();
3256
3256
  connectResolve([
@@ -3261,7 +3261,7 @@ var require_main = __commonJS({
3261
3261
  server.on("error", reject);
3262
3262
  server.listen(pipeName, () => {
3263
3263
  server.removeListener("error", reject);
3264
- resolve({
3264
+ resolve2({
3265
3265
  onConnected: () => {
3266
3266
  return connected;
3267
3267
  }
@@ -3280,10 +3280,10 @@ var require_main = __commonJS({
3280
3280
  exports2.createServerPipeTransport = createServerPipeTransport;
3281
3281
  function createClientSocketTransport(port, encoding = "utf-8") {
3282
3282
  let connectResolve;
3283
- const connected = new Promise((resolve, _reject) => {
3284
- connectResolve = resolve;
3283
+ const connected = new Promise((resolve2, _reject) => {
3284
+ connectResolve = resolve2;
3285
3285
  });
3286
- return new Promise((resolve, reject) => {
3286
+ return new Promise((resolve2, reject) => {
3287
3287
  const server = (0, net_1.createServer)((socket) => {
3288
3288
  server.close();
3289
3289
  connectResolve([
@@ -3294,7 +3294,7 @@ var require_main = __commonJS({
3294
3294
  server.on("error", reject);
3295
3295
  server.listen(port, "127.0.0.1", () => {
3296
3296
  server.removeListener("error", reject);
3297
- resolve({
3297
+ resolve2({
3298
3298
  onConnected: () => {
3299
3299
  return connected;
3300
3300
  }
@@ -3406,8 +3406,8 @@ var require_main2 = __commonJS({
3406
3406
  }
3407
3407
  Position2.is = is;
3408
3408
  })(Position || (exports3.Position = Position = {}));
3409
- var Range;
3410
- (function(Range2) {
3409
+ var Range2;
3410
+ (function(Range3) {
3411
3411
  function create(one, two, three, four) {
3412
3412
  if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {
3413
3413
  return { start: Position.create(one, two), end: Position.create(three, four) };
@@ -3417,13 +3417,13 @@ var require_main2 = __commonJS({
3417
3417
  throw new Error("Range#create called with invalid arguments[".concat(one, ", ").concat(two, ", ").concat(three, ", ").concat(four, "]"));
3418
3418
  }
3419
3419
  }
3420
- Range2.create = create;
3420
+ Range3.create = create;
3421
3421
  function is(value) {
3422
3422
  var candidate = value;
3423
3423
  return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);
3424
3424
  }
3425
- Range2.is = is;
3426
- })(Range || (exports3.Range = Range = {}));
3425
+ Range3.is = is;
3426
+ })(Range2 || (exports3.Range = Range2 = {}));
3427
3427
  var Location;
3428
3428
  (function(Location2) {
3429
3429
  function create(uri, range) {
@@ -3432,7 +3432,7 @@ var require_main2 = __commonJS({
3432
3432
  Location2.create = create;
3433
3433
  function is(value) {
3434
3434
  var candidate = value;
3435
- return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
3435
+ return Is.objectLiteral(candidate) && Range2.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));
3436
3436
  }
3437
3437
  Location2.is = is;
3438
3438
  })(Location || (exports3.Location = Location = {}));
@@ -3444,7 +3444,7 @@ var require_main2 = __commonJS({
3444
3444
  LocationLink2.create = create;
3445
3445
  function is(value) {
3446
3446
  var candidate = value;
3447
- return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range.is(candidate.targetSelectionRange) && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
3447
+ return Is.objectLiteral(candidate) && Range2.is(candidate.targetRange) && Is.string(candidate.targetUri) && Range2.is(candidate.targetSelectionRange) && (Range2.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));
3448
3448
  }
3449
3449
  LocationLink2.is = is;
3450
3450
  })(LocationLink || (exports3.LocationLink = LocationLink = {}));
@@ -3476,7 +3476,7 @@ var require_main2 = __commonJS({
3476
3476
  ColorInformation2.create = create;
3477
3477
  function is(value) {
3478
3478
  var candidate = value;
3479
- return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);
3479
+ return Is.objectLiteral(candidate) && Range2.is(candidate.range) && Color.is(candidate.color);
3480
3480
  }
3481
3481
  ColorInformation2.is = is;
3482
3482
  })(ColorInformation || (exports3.ColorInformation = ColorInformation = {}));
@@ -3587,7 +3587,7 @@ var require_main2 = __commonJS({
3587
3587
  function is(value) {
3588
3588
  var _a;
3589
3589
  var candidate = value;
3590
- 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));
3590
+ return Is.defined(candidate) && Range2.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));
3591
3591
  }
3592
3592
  Diagnostic2.is = is;
3593
3593
  })(Diagnostic || (exports3.Diagnostic = Diagnostic = {}));
@@ -3627,7 +3627,7 @@ var require_main2 = __commonJS({
3627
3627
  TextEdit2.del = del;
3628
3628
  function is(value) {
3629
3629
  var candidate = value;
3630
- return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range.is(candidate.range);
3630
+ return Is.objectLiteral(candidate) && Is.string(candidate.newText) && Range2.is(candidate.range);
3631
3631
  }
3632
3632
  TextEdit2.is = is;
3633
3633
  })(TextEdit || (exports3.TextEdit = TextEdit = {}));
@@ -3757,8 +3757,8 @@ var require_main2 = __commonJS({
3757
3757
  }
3758
3758
  DeleteFile2.is = is;
3759
3759
  })(DeleteFile || (exports3.DeleteFile = DeleteFile = {}));
3760
- var WorkspaceEdit;
3761
- (function(WorkspaceEdit2) {
3760
+ var WorkspaceEdit2;
3761
+ (function(WorkspaceEdit3) {
3762
3762
  function is(value) {
3763
3763
  var candidate = value;
3764
3764
  return candidate && (candidate.changes !== void 0 || candidate.documentChanges !== void 0) && (candidate.documentChanges === void 0 || candidate.documentChanges.every(function(change) {
@@ -3769,8 +3769,8 @@ var require_main2 = __commonJS({
3769
3769
  }
3770
3770
  }));
3771
3771
  }
3772
- WorkspaceEdit2.is = is;
3773
- })(WorkspaceEdit || (exports3.WorkspaceEdit = WorkspaceEdit = {}));
3772
+ WorkspaceEdit3.is = is;
3773
+ })(WorkspaceEdit2 || (exports3.WorkspaceEdit = WorkspaceEdit2 = {}));
3774
3774
  var TextEditChangeImpl = (
3775
3775
  /** @class */
3776
3776
  (function() {
@@ -4171,7 +4171,7 @@ var require_main2 = __commonJS({
4171
4171
  InsertReplaceEdit2.create = create;
4172
4172
  function is(value) {
4173
4173
  var candidate = value;
4174
- return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);
4174
+ return candidate && Is.string(candidate.newText) && Range2.is(candidate.insert) && Range2.is(candidate.replace);
4175
4175
  }
4176
4176
  InsertReplaceEdit2.is = is;
4177
4177
  })(InsertReplaceEdit || (exports3.InsertReplaceEdit = InsertReplaceEdit = {}));
@@ -4218,7 +4218,7 @@ var require_main2 = __commonJS({
4218
4218
  (function(Hover2) {
4219
4219
  function is(value) {
4220
4220
  var candidate = value;
4221
- 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));
4221
+ return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) || MarkedString.is(candidate.contents) || Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === void 0 || Range2.is(value.range));
4222
4222
  }
4223
4223
  Hover2.is = is;
4224
4224
  })(Hover || (exports3.Hover = Hover = {}));
@@ -4339,7 +4339,7 @@ var require_main2 = __commonJS({
4339
4339
  DocumentSymbol2.create = create;
4340
4340
  function is(value) {
4341
4341
  var candidate = value;
4342
- 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));
4342
+ return candidate && Is.string(candidate.name) && Is.number(candidate.kind) && Range2.is(candidate.range) && Range2.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));
4343
4343
  }
4344
4344
  DocumentSymbol2.is = is;
4345
4345
  })(DocumentSymbol || (exports3.DocumentSymbol = DocumentSymbol = {}));
@@ -4400,7 +4400,7 @@ var require_main2 = __commonJS({
4400
4400
  CodeAction2.create = create;
4401
4401
  function is(value) {
4402
4402
  var candidate = value;
4403
- 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));
4403
+ 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 || WorkspaceEdit2.is(candidate.edit));
4404
4404
  }
4405
4405
  CodeAction2.is = is;
4406
4406
  })(CodeAction || (exports3.CodeAction = CodeAction = {}));
@@ -4416,7 +4416,7 @@ var require_main2 = __commonJS({
4416
4416
  CodeLens2.create = create;
4417
4417
  function is(value) {
4418
4418
  var candidate = value;
4419
- return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
4419
+ return Is.defined(candidate) && Range2.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));
4420
4420
  }
4421
4421
  CodeLens2.is = is;
4422
4422
  })(CodeLens || (exports3.CodeLens = CodeLens = {}));
@@ -4440,7 +4440,7 @@ var require_main2 = __commonJS({
4440
4440
  DocumentLink2.create = create;
4441
4441
  function is(value) {
4442
4442
  var candidate = value;
4443
- return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
4443
+ return Is.defined(candidate) && Range2.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));
4444
4444
  }
4445
4445
  DocumentLink2.is = is;
4446
4446
  })(DocumentLink || (exports3.DocumentLink = DocumentLink = {}));
@@ -4452,7 +4452,7 @@ var require_main2 = __commonJS({
4452
4452
  SelectionRange2.create = create;
4453
4453
  function is(value) {
4454
4454
  var candidate = value;
4455
- return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent));
4455
+ return Is.objectLiteral(candidate) && Range2.is(candidate.range) && (candidate.parent === void 0 || SelectionRange2.is(candidate.parent));
4456
4456
  }
4457
4457
  SelectionRange2.is = is;
4458
4458
  })(SelectionRange || (exports3.SelectionRange = SelectionRange = {}));
@@ -4511,7 +4511,7 @@ var require_main2 = __commonJS({
4511
4511
  InlineValueText2.create = create;
4512
4512
  function is(value) {
4513
4513
  var candidate = value;
4514
- return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text);
4514
+ return candidate !== void 0 && candidate !== null && Range2.is(candidate.range) && Is.string(candidate.text);
4515
4515
  }
4516
4516
  InlineValueText2.is = is;
4517
4517
  })(InlineValueText || (exports3.InlineValueText = InlineValueText = {}));
@@ -4523,7 +4523,7 @@ var require_main2 = __commonJS({
4523
4523
  InlineValueVariableLookup2.create = create;
4524
4524
  function is(value) {
4525
4525
  var candidate = value;
4526
- return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === void 0);
4526
+ return candidate !== void 0 && candidate !== null && Range2.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup) && (Is.string(candidate.variableName) || candidate.variableName === void 0);
4527
4527
  }
4528
4528
  InlineValueVariableLookup2.is = is;
4529
4529
  })(InlineValueVariableLookup || (exports3.InlineValueVariableLookup = InlineValueVariableLookup = {}));
@@ -4535,7 +4535,7 @@ var require_main2 = __commonJS({
4535
4535
  InlineValueEvaluatableExpression2.create = create;
4536
4536
  function is(value) {
4537
4537
  var candidate = value;
4538
- return candidate !== void 0 && candidate !== null && Range.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === void 0);
4538
+ return candidate !== void 0 && candidate !== null && Range2.is(candidate.range) && (Is.string(candidate.expression) || candidate.expression === void 0);
4539
4539
  }
4540
4540
  InlineValueEvaluatableExpression2.is = is;
4541
4541
  })(InlineValueEvaluatableExpression || (exports3.InlineValueEvaluatableExpression = InlineValueEvaluatableExpression = {}));
@@ -4547,7 +4547,7 @@ var require_main2 = __commonJS({
4547
4547
  InlineValueContext2.create = create;
4548
4548
  function is(value) {
4549
4549
  var candidate = value;
4550
- return Is.defined(candidate) && Range.is(value.stoppedLocation);
4550
+ return Is.defined(candidate) && Range2.is(value.stoppedLocation);
4551
4551
  }
4552
4552
  InlineValueContext2.is = is;
4553
4553
  })(InlineValueContext || (exports3.InlineValueContext = InlineValueContext = {}));
@@ -4628,14 +4628,14 @@ var require_main2 = __commonJS({
4628
4628
  }
4629
4629
  InlineCompletionContext2.create = create;
4630
4630
  })(InlineCompletionContext || (exports3.InlineCompletionContext = InlineCompletionContext = {}));
4631
- var WorkspaceFolder;
4632
- (function(WorkspaceFolder2) {
4631
+ var WorkspaceFolder2;
4632
+ (function(WorkspaceFolder3) {
4633
4633
  function is(value) {
4634
4634
  var candidate = value;
4635
4635
  return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name);
4636
4636
  }
4637
- WorkspaceFolder2.is = is;
4638
- })(WorkspaceFolder || (exports3.WorkspaceFolder = WorkspaceFolder = {}));
4637
+ WorkspaceFolder3.is = is;
4638
+ })(WorkspaceFolder2 || (exports3.WorkspaceFolder = WorkspaceFolder2 = {}));
4639
4639
  exports3.EOL = ["\n", "\r\n", "\r"];
4640
4640
  var TextDocument;
4641
4641
  (function(TextDocument2) {
@@ -6089,14 +6089,14 @@ var require_protocol = __commonJS({
6089
6089
  FileChangeType2.Changed = 2;
6090
6090
  FileChangeType2.Deleted = 3;
6091
6091
  })(FileChangeType || (exports2.FileChangeType = FileChangeType = {}));
6092
- var RelativePattern;
6093
- (function(RelativePattern2) {
6092
+ var RelativePattern2;
6093
+ (function(RelativePattern3) {
6094
6094
  function is(value) {
6095
6095
  const candidate = value;
6096
6096
  return Is.objectLiteral(candidate) && (vscode_languageserver_types_1.URI.is(candidate.baseUri) || vscode_languageserver_types_1.WorkspaceFolder.is(candidate.baseUri)) && Is.string(candidate.pattern);
6097
6097
  }
6098
- RelativePattern2.is = is;
6099
- })(RelativePattern || (exports2.RelativePattern = RelativePattern = {}));
6098
+ RelativePattern3.is = is;
6099
+ })(RelativePattern2 || (exports2.RelativePattern = RelativePattern2 = {}));
6100
6100
  var WatchKind;
6101
6101
  (function(WatchKind2) {
6102
6102
  WatchKind2.Create = 1;
@@ -6390,8 +6390,8 @@ var require_async = __commonJS({
6390
6390
  this.cancelTimeout();
6391
6391
  }
6392
6392
  if (!this.completionPromise) {
6393
- this.completionPromise = new Promise((resolve) => {
6394
- this.onSuccess = resolve;
6393
+ this.completionPromise = new Promise((resolve2) => {
6394
+ this.onSuccess = resolve2;
6395
6395
  }).then(() => {
6396
6396
  this.completionPromise = void 0;
6397
6397
  this.onSuccess = void 0;
@@ -6444,8 +6444,8 @@ var require_async = __commonJS({
6444
6444
  this._waiting = [];
6445
6445
  }
6446
6446
  lock(thunk) {
6447
- return new Promise((resolve, reject) => {
6448
- this._waiting.push({ thunk, resolve, reject });
6447
+ return new Promise((resolve2, reject) => {
6448
+ this._waiting.push({ thunk, resolve: resolve2, reject });
6449
6449
  this.runNext();
6450
6450
  });
6451
6451
  }
@@ -6560,9 +6560,9 @@ var require_async = __commonJS({
6560
6560
  if (token !== void 0 && token.isCancellationRequested) {
6561
6561
  break;
6562
6562
  }
6563
- index = await new Promise((resolve) => {
6563
+ index = await new Promise((resolve2) => {
6564
6564
  (0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => {
6565
- resolve(convertBatch(index));
6565
+ resolve2(convertBatch(index));
6566
6566
  });
6567
6567
  });
6568
6568
  }
@@ -6591,9 +6591,9 @@ var require_async = __commonJS({
6591
6591
  if (token !== void 0 && token.isCancellationRequested) {
6592
6592
  break;
6593
6593
  }
6594
- index = await new Promise((resolve) => {
6594
+ index = await new Promise((resolve2) => {
6595
6595
  (0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => {
6596
- resolve(convertBatch(index));
6596
+ resolve2(convertBatch(index));
6597
6597
  });
6598
6598
  });
6599
6599
  }
@@ -6621,9 +6621,9 @@ var require_async = __commonJS({
6621
6621
  if (token !== void 0 && token.isCancellationRequested) {
6622
6622
  break;
6623
6623
  }
6624
- index = await new Promise((resolve) => {
6624
+ index = await new Promise((resolve2) => {
6625
6625
  (0, vscode_languageserver_protocol_1.RAL)().timer.setImmediate(() => {
6626
- resolve(runBatch(index));
6626
+ resolve2(runBatch(index));
6627
6627
  });
6628
6628
  });
6629
6629
  }
@@ -8867,8 +8867,8 @@ var require_progressPart = __commonJS({
8867
8867
  this._client.sendNotification(vscode_languageserver_protocol_1.WorkDoneProgressCancelNotification.type, { token: this._token });
8868
8868
  });
8869
8869
  this.report(params);
8870
- return new Promise((resolve, reject) => {
8871
- this._resolve = resolve;
8870
+ return new Promise((resolve2, reject) => {
8871
+ this._resolve = resolve2;
8872
8872
  this._reject = reject;
8873
8873
  });
8874
8874
  });
@@ -8957,8 +8957,8 @@ var require_features = __commonJS({
8957
8957
  DynamicFeature2.is = is;
8958
8958
  })(DynamicFeature || (exports2.DynamicFeature = DynamicFeature = {}));
8959
8959
  var DynamicDocumentFeature = class {
8960
- constructor(client2) {
8961
- this._client = client2;
8960
+ constructor(client) {
8961
+ this._client = client;
8962
8962
  }
8963
8963
  /**
8964
8964
  * Returns the state the feature is in.
@@ -8988,8 +8988,8 @@ var require_features = __commonJS({
8988
8988
  }
8989
8989
  return false;
8990
8990
  }
8991
- constructor(client2, event, type, middleware, createParams, textDocument, selectorFilter) {
8992
- super(client2);
8991
+ constructor(client, event, type, middleware, createParams, textDocument, selectorFilter) {
8992
+ super(client);
8993
8993
  this._event = event;
8994
8994
  this._type = type;
8995
8995
  this._middleware = middleware;
@@ -9071,8 +9071,8 @@ var require_features = __commonJS({
9071
9071
  };
9072
9072
  exports2.TextDocumentEventFeature = TextDocumentEventFeature;
9073
9073
  var TextDocumentLanguageFeature = class extends DynamicDocumentFeature {
9074
- constructor(client2, registrationType) {
9075
- super(client2);
9074
+ constructor(client, registrationType) {
9075
+ super(client);
9076
9076
  this._registrationType = registrationType;
9077
9077
  this._registrations = /* @__PURE__ */ new Map();
9078
9078
  }
@@ -9150,8 +9150,8 @@ var require_features = __commonJS({
9150
9150
  };
9151
9151
  exports2.TextDocumentLanguageFeature = TextDocumentLanguageFeature;
9152
9152
  var WorkspaceFeature = class {
9153
- constructor(client2, registrationType) {
9154
- this._client = client2;
9153
+ constructor(client, registrationType) {
9154
+ this._client = client;
9155
9155
  this._registrationType = registrationType;
9156
9156
  this._registrations = /* @__PURE__ */ new Map();
9157
9157
  }
@@ -9419,8 +9419,8 @@ var require_minimatch = __commonJS({
9419
9419
  return new Minimatch(pattern, options).match(p);
9420
9420
  };
9421
9421
  module2.exports = minimatch;
9422
- var path2 = require_path();
9423
- minimatch.sep = path2.sep;
9422
+ var path3 = require_path();
9423
+ minimatch.sep = path3.sep;
9424
9424
  var GLOBSTAR = Symbol("globstar **");
9425
9425
  minimatch.GLOBSTAR = GLOBSTAR;
9426
9426
  var expand = require_brace_expansion();
@@ -10026,8 +10026,8 @@ var require_minimatch = __commonJS({
10026
10026
  if (this.empty) return f === "";
10027
10027
  if (f === "/" && partial) return true;
10028
10028
  const options = this.options;
10029
- if (path2.sep !== "/") {
10030
- f = f.split(path2.sep).join("/");
10029
+ if (path3.sep !== "/") {
10030
+ f = f.split(path3.sep).join("/");
10031
10031
  }
10032
10032
  f = f.split(slashSplit);
10033
10033
  this.debug(this.pattern, "split", f);
@@ -10252,8 +10252,8 @@ var require_diagnostic = __commonJS({
10252
10252
  }
10253
10253
  };
10254
10254
  var DiagnosticRequestor = class {
10255
- constructor(client2, tabs, options) {
10256
- this.client = client2;
10255
+ constructor(client, tabs, options) {
10256
+ this.client = client;
10257
10257
  this.tabs = tabs;
10258
10258
  this.options = options;
10259
10259
  this.isDisposed = false;
@@ -10599,9 +10599,9 @@ var require_diagnostic = __commonJS({
10599
10599
  }
10600
10600
  };
10601
10601
  var DiagnosticFeatureProviderImpl = class {
10602
- constructor(client2, tabs, options) {
10603
- const diagnosticPullOptions = client2.clientOptions.diagnosticPullOptions ?? { onChange: true, onSave: false };
10604
- const documentSelector = client2.protocol2CodeConverter.asDocumentSelector(options.documentSelector);
10602
+ constructor(client, tabs, options) {
10603
+ const diagnosticPullOptions = client.clientOptions.diagnosticPullOptions ?? { onChange: true, onSave: false };
10604
+ const documentSelector = client.protocol2CodeConverter.asDocumentSelector(options.documentSelector);
10605
10605
  const disposables = [];
10606
10606
  const matchResource = (resource) => {
10607
10607
  const selector = options.documentSelector;
@@ -10639,7 +10639,7 @@ var require_diagnostic = __commonJS({
10639
10639
  const isActiveDocument = (document) => {
10640
10640
  return document instanceof vscode_1.Uri ? this.activeTextDocument?.uri.toString() === document.toString() : this.activeTextDocument === document;
10641
10641
  };
10642
- this.diagnosticRequestor = new DiagnosticRequestor(client2, tabs, options);
10642
+ this.diagnosticRequestor = new DiagnosticRequestor(client, tabs, options);
10643
10643
  this.backgroundScheduler = new BackgroundScheduler(this.diagnosticRequestor);
10644
10644
  const addToBackgroundIfNeeded = (document) => {
10645
10645
  if (!matches(document) || !options.interFileDependencies || isActiveDocument(document)) {
@@ -10658,7 +10658,7 @@ var require_diagnostic = __commonJS({
10658
10658
  this.backgroundScheduler.remove(this.activeTextDocument);
10659
10659
  }
10660
10660
  });
10661
- const openFeature = client2.getFeature(vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.method);
10661
+ const openFeature = client.getFeature(vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.method);
10662
10662
  disposables.push(openFeature.onNotificationSent((event) => {
10663
10663
  const textDocument = event.textDocument;
10664
10664
  if (this.diagnosticRequestor.knows(PullState.document, textDocument)) {
@@ -10709,7 +10709,7 @@ var require_diagnostic = __commonJS({
10709
10709
  }
10710
10710
  }
10711
10711
  if (diagnosticPullOptions.onChange === true) {
10712
- const changeFeature = client2.getFeature(vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.method);
10712
+ const changeFeature = client.getFeature(vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.method);
10713
10713
  disposables.push(changeFeature.onNotificationSent(async (event) => {
10714
10714
  const textDocument = event.textDocument;
10715
10715
  if ((diagnosticPullOptions.filter === void 0 || !diagnosticPullOptions.filter(textDocument, DiagnosticPullMode.onType)) && this.diagnosticRequestor.knows(PullState.document, textDocument)) {
@@ -10720,7 +10720,7 @@ var require_diagnostic = __commonJS({
10720
10720
  }));
10721
10721
  }
10722
10722
  if (diagnosticPullOptions.onSave === true) {
10723
- const saveFeature = client2.getFeature(vscode_languageserver_protocol_1.DidSaveTextDocumentNotification.method);
10723
+ const saveFeature = client.getFeature(vscode_languageserver_protocol_1.DidSaveTextDocumentNotification.method);
10724
10724
  disposables.push(saveFeature.onNotificationSent((event) => {
10725
10725
  const textDocument = event.textDocument;
10726
10726
  if ((diagnosticPullOptions.filter === void 0 || !diagnosticPullOptions.filter(textDocument, DiagnosticPullMode.onSave)) && this.diagnosticRequestor.knows(PullState.document, textDocument)) {
@@ -10730,7 +10730,7 @@ var require_diagnostic = __commonJS({
10730
10730
  }
10731
10731
  }));
10732
10732
  }
10733
- const closeFeature = client2.getFeature(vscode_languageserver_protocol_1.DidCloseTextDocumentNotification.method);
10733
+ const closeFeature = client.getFeature(vscode_languageserver_protocol_1.DidCloseTextDocumentNotification.method);
10734
10734
  disposables.push(closeFeature.onNotificationSent((event) => {
10735
10735
  this.cleanUpDocument(event.textDocument);
10736
10736
  }));
@@ -10765,8 +10765,8 @@ var require_diagnostic = __commonJS({
10765
10765
  }
10766
10766
  };
10767
10767
  var DiagnosticFeature = class extends features_1.TextDocumentLanguageFeature {
10768
- constructor(client2) {
10769
- super(client2, vscode_languageserver_protocol_1.DocumentDiagnosticRequest.type);
10768
+ constructor(client) {
10769
+ super(client, vscode_languageserver_protocol_1.DocumentDiagnosticRequest.type);
10770
10770
  }
10771
10771
  fillClientCapabilities(capabilities) {
10772
10772
  let capability = ensure(ensure(capabilities, "textDocument"), "diagnostic");
@@ -10775,8 +10775,8 @@ var require_diagnostic = __commonJS({
10775
10775
  ensure(ensure(capabilities, "workspace"), "diagnostics").refreshSupport = true;
10776
10776
  }
10777
10777
  initialize(capabilities, documentSelector) {
10778
- const client2 = this._client;
10779
- client2.onRequest(vscode_languageserver_protocol_1.DiagnosticRefreshRequest.type, async () => {
10778
+ const client = this._client;
10779
+ client.onRequest(vscode_languageserver_protocol_1.DiagnosticRefreshRequest.type, async () => {
10780
10780
  for (const provider of this.getAllProviders()) {
10781
10781
  provider.onDidChangeDiagnosticsEmitter.fire();
10782
10782
  }
@@ -11113,13 +11113,13 @@ var require_notebook = __commonJS({
11113
11113
  SyncInfo2.create = create;
11114
11114
  })(SyncInfo || (SyncInfo = {}));
11115
11115
  var NotebookDocumentSyncFeatureProvider = class {
11116
- constructor(client2, options) {
11117
- this.client = client2;
11116
+ constructor(client, options) {
11117
+ this.client = client;
11118
11118
  this.options = options;
11119
11119
  this.notebookSyncInfo = /* @__PURE__ */ new Map();
11120
11120
  this.notebookDidOpen = /* @__PURE__ */ new Set();
11121
11121
  this.disposables = [];
11122
- this.selector = client2.protocol2CodeConverter.asDocumentSelector($NotebookDocumentSyncOptions.asDocumentSelector(options));
11122
+ this.selector = client.protocol2CodeConverter.asDocumentSelector($NotebookDocumentSyncOptions.asDocumentSelector(options));
11123
11123
  vscode.workspace.onDidOpenNotebookDocument((notebookDocument) => {
11124
11124
  this.notebookDidOpen.add(notebookDocument.uri.toString());
11125
11125
  this.didOpen(notebookDocument);
@@ -11453,8 +11453,8 @@ var require_notebook = __commonJS({
11453
11453
  }
11454
11454
  };
11455
11455
  var NotebookDocumentSyncFeature = class _NotebookDocumentSyncFeature {
11456
- constructor(client2) {
11457
- this.client = client2;
11456
+ constructor(client) {
11457
+ this.client = client;
11458
11458
  this.registrations = /* @__PURE__ */ new Map();
11459
11459
  this.registrationType = proto.NotebookDocumentSyncRegistrationType.type;
11460
11460
  vscode.workspace.onDidOpenTextDocument((textDocument) => {
@@ -11601,8 +11601,8 @@ var require_configuration = __commonJS({
11601
11601
  var UUID = require_uuid();
11602
11602
  var features_1 = require_features();
11603
11603
  var ConfigurationFeature = class {
11604
- constructor(client2) {
11605
- this._client = client2;
11604
+ constructor(client) {
11605
+ this._client = client;
11606
11606
  }
11607
11607
  getState() {
11608
11608
  return { kind: "static" };
@@ -11612,8 +11612,8 @@ var require_configuration = __commonJS({
11612
11612
  capabilities.workspace.configuration = true;
11613
11613
  }
11614
11614
  initialize() {
11615
- let client2 = this._client;
11616
- client2.onRequest(vscode_languageserver_protocol_1.ConfigurationRequest.type, (params, token) => {
11615
+ let client = this._client;
11616
+ client.onRequest(vscode_languageserver_protocol_1.ConfigurationRequest.type, (params, token) => {
11617
11617
  let configuration = (params2) => {
11618
11618
  let result = [];
11619
11619
  for (let item of params2.items) {
@@ -11622,7 +11622,7 @@ var require_configuration = __commonJS({
11622
11622
  }
11623
11623
  return result;
11624
11624
  };
11625
- let middleware = client2.middleware.workspace;
11625
+ let middleware = client.middleware.workspace;
11626
11626
  return middleware && middleware.configuration ? middleware.configuration(params, token, configuration) : configuration(params, token);
11627
11627
  });
11628
11628
  }
@@ -11752,13 +11752,13 @@ var require_configuration = __commonJS({
11752
11752
  });
11753
11753
  }
11754
11754
  extractSettingsInformation(keys) {
11755
- function ensurePath(config, path2) {
11755
+ function ensurePath(config, path3) {
11756
11756
  let current = config;
11757
- for (let i = 0; i < path2.length - 1; i++) {
11758
- let obj = current[path2[i]];
11757
+ for (let i = 0; i < path3.length - 1; i++) {
11758
+ let obj = current[path3[i]];
11759
11759
  if (!obj) {
11760
11760
  obj = /* @__PURE__ */ Object.create(null);
11761
- current[path2[i]] = obj;
11761
+ current[path3[i]] = obj;
11762
11762
  }
11763
11763
  current = obj;
11764
11764
  }
@@ -11776,8 +11776,8 @@ var require_configuration = __commonJS({
11776
11776
  config = vscode_1.workspace.getConfiguration(void 0, resource).get(key);
11777
11777
  }
11778
11778
  if (config) {
11779
- let path2 = keys[i].split(".");
11780
- ensurePath(result, path2)[path2[path2.length - 1]] = toJSONObject(config);
11779
+ let path3 = keys[i].split(".");
11780
+ ensurePath(result, path3)[path3[path3.length - 1]] = toJSONObject(config);
11781
11781
  }
11782
11782
  }
11783
11783
  return result;
@@ -11798,8 +11798,8 @@ var require_textSynchronization = __commonJS({
11798
11798
  var features_1 = require_features();
11799
11799
  var UUID = require_uuid();
11800
11800
  var DidOpenTextDocumentFeature = class extends features_1.TextDocumentEventFeature {
11801
- constructor(client2, syncedDocuments) {
11802
- super(client2, vscode_1.workspace.onDidOpenTextDocument, vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.type, () => client2.middleware.didOpen, (textDocument) => client2.code2ProtocolConverter.asOpenTextDocumentParams(textDocument), (data) => data, features_1.TextDocumentEventFeature.textDocumentFilter);
11801
+ constructor(client, syncedDocuments) {
11802
+ super(client, vscode_1.workspace.onDidOpenTextDocument, vscode_languageserver_protocol_1.DidOpenTextDocumentNotification.type, () => client.middleware.didOpen, (textDocument) => client.code2ProtocolConverter.asOpenTextDocumentParams(textDocument), (data) => data, features_1.TextDocumentEventFeature.textDocumentFilter);
11803
11803
  this._syncedDocuments = syncedDocuments;
11804
11804
  }
11805
11805
  get openDocuments() {
@@ -11850,8 +11850,8 @@ var require_textSynchronization = __commonJS({
11850
11850
  };
11851
11851
  exports2.DidOpenTextDocumentFeature = DidOpenTextDocumentFeature;
11852
11852
  var DidCloseTextDocumentFeature = class extends features_1.TextDocumentEventFeature {
11853
- constructor(client2, syncedDocuments, pendingTextDocumentChanges) {
11854
- super(client2, vscode_1.workspace.onDidCloseTextDocument, vscode_languageserver_protocol_1.DidCloseTextDocumentNotification.type, () => client2.middleware.didClose, (textDocument) => client2.code2ProtocolConverter.asCloseTextDocumentParams(textDocument), (data) => data, features_1.TextDocumentEventFeature.textDocumentFilter);
11853
+ constructor(client, syncedDocuments, pendingTextDocumentChanges) {
11854
+ super(client, vscode_1.workspace.onDidCloseTextDocument, vscode_languageserver_protocol_1.DidCloseTextDocumentNotification.type, () => client.middleware.didClose, (textDocument) => client.code2ProtocolConverter.asCloseTextDocumentParams(textDocument), (data) => data, features_1.TextDocumentEventFeature.textDocumentFilter);
11855
11855
  this._syncedDocuments = syncedDocuments;
11856
11856
  this._pendingTextDocumentChanges = pendingTextDocumentChanges;
11857
11857
  }
@@ -11898,8 +11898,8 @@ var require_textSynchronization = __commonJS({
11898
11898
  };
11899
11899
  exports2.DidCloseTextDocumentFeature = DidCloseTextDocumentFeature;
11900
11900
  var DidChangeTextDocumentFeature = class extends features_1.DynamicDocumentFeature {
11901
- constructor(client2, pendingTextDocumentChanges) {
11902
- super(client2);
11901
+ constructor(client, pendingTextDocumentChanges) {
11902
+ super(client);
11903
11903
  this._changeData = /* @__PURE__ */ new Map();
11904
11904
  this._onNotificationSent = new vscode_1.EventEmitter();
11905
11905
  this._onPendingChangeAdded = new vscode_1.EventEmitter();
@@ -12059,8 +12059,8 @@ var require_textSynchronization = __commonJS({
12059
12059
  };
12060
12060
  exports2.DidChangeTextDocumentFeature = DidChangeTextDocumentFeature;
12061
12061
  var WillSaveFeature = class extends features_1.TextDocumentEventFeature {
12062
- constructor(client2) {
12063
- super(client2, vscode_1.workspace.onWillSaveTextDocument, vscode_languageserver_protocol_1.WillSaveTextDocumentNotification.type, () => client2.middleware.willSave, (willSaveEvent) => client2.code2ProtocolConverter.asWillSaveTextDocumentParams(willSaveEvent), (event) => event.document, (selectors, willSaveEvent) => features_1.TextDocumentEventFeature.textDocumentFilter(selectors, willSaveEvent.document));
12062
+ constructor(client) {
12063
+ super(client, vscode_1.workspace.onWillSaveTextDocument, vscode_languageserver_protocol_1.WillSaveTextDocumentNotification.type, () => client.middleware.willSave, (willSaveEvent) => client.code2ProtocolConverter.asWillSaveTextDocumentParams(willSaveEvent), (event) => event.document, (selectors, willSaveEvent) => features_1.TextDocumentEventFeature.textDocumentFilter(selectors, willSaveEvent.document));
12064
12064
  }
12065
12065
  get registrationType() {
12066
12066
  return vscode_languageserver_protocol_1.WillSaveTextDocumentNotification.type;
@@ -12084,8 +12084,8 @@ var require_textSynchronization = __commonJS({
12084
12084
  };
12085
12085
  exports2.WillSaveFeature = WillSaveFeature;
12086
12086
  var WillSaveWaitUntilFeature = class extends features_1.DynamicDocumentFeature {
12087
- constructor(client2) {
12088
- super(client2);
12087
+ constructor(client) {
12088
+ super(client);
12089
12089
  this._selectors = /* @__PURE__ */ new Map();
12090
12090
  }
12091
12091
  getDocumentSelectors() {
@@ -12145,8 +12145,8 @@ var require_textSynchronization = __commonJS({
12145
12145
  };
12146
12146
  exports2.WillSaveWaitUntilFeature = WillSaveWaitUntilFeature;
12147
12147
  var DidSaveTextDocumentFeature = class extends features_1.TextDocumentEventFeature {
12148
- constructor(client2) {
12149
- super(client2, vscode_1.workspace.onDidSaveTextDocument, vscode_languageserver_protocol_1.DidSaveTextDocumentNotification.type, () => client2.middleware.didSave, (textDocument) => client2.code2ProtocolConverter.asSaveTextDocumentParams(textDocument, this._includeText), (data) => data, features_1.TextDocumentEventFeature.textDocumentFilter);
12148
+ constructor(client) {
12149
+ super(client, vscode_1.workspace.onDidSaveTextDocument, vscode_languageserver_protocol_1.DidSaveTextDocumentNotification.type, () => client.middleware.didSave, (textDocument) => client.code2ProtocolConverter.asSaveTextDocumentParams(textDocument, this._includeText), (data) => data, features_1.TextDocumentEventFeature.textDocumentFilter);
12150
12150
  this._includeText = false;
12151
12151
  }
12152
12152
  get registrationType() {
@@ -12215,8 +12215,8 @@ var require_completion = __commonJS({
12215
12215
  vscode_languageserver_protocol_1.CompletionItemKind.TypeParameter
12216
12216
  ];
12217
12217
  var CompletionItemFeature = class extends features_1.TextDocumentLanguageFeature {
12218
- constructor(client2) {
12219
- super(client2, vscode_languageserver_protocol_1.CompletionRequest.type);
12218
+ constructor(client) {
12219
+ super(client, vscode_languageserver_protocol_1.CompletionRequest.type);
12220
12220
  this.labelDetailsSupport = /* @__PURE__ */ new Map();
12221
12221
  }
12222
12222
  fillClientCapabilities(capabilities) {
@@ -12266,31 +12266,31 @@ var require_completion = __commonJS({
12266
12266
  const selector = options.documentSelector;
12267
12267
  const provider = {
12268
12268
  provideCompletionItems: (document, position, token, context) => {
12269
- const client2 = this._client;
12269
+ const client = this._client;
12270
12270
  const middleware = this._client.middleware;
12271
12271
  const provideCompletionItems = (document2, position2, context2, token2) => {
12272
- return client2.sendRequest(vscode_languageserver_protocol_1.CompletionRequest.type, client2.code2ProtocolConverter.asCompletionParams(document2, position2, context2), token2).then((result) => {
12272
+ return client.sendRequest(vscode_languageserver_protocol_1.CompletionRequest.type, client.code2ProtocolConverter.asCompletionParams(document2, position2, context2), token2).then((result) => {
12273
12273
  if (token2.isCancellationRequested) {
12274
12274
  return null;
12275
12275
  }
12276
- return client2.protocol2CodeConverter.asCompletionResult(result, defaultCommitCharacters, token2);
12276
+ return client.protocol2CodeConverter.asCompletionResult(result, defaultCommitCharacters, token2);
12277
12277
  }, (error) => {
12278
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.CompletionRequest.type, token2, error, null);
12278
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.CompletionRequest.type, token2, error, null);
12279
12279
  });
12280
12280
  };
12281
12281
  return middleware.provideCompletionItem ? middleware.provideCompletionItem(document, position, context, token, provideCompletionItems) : provideCompletionItems(document, position, context, token);
12282
12282
  },
12283
12283
  resolveCompletionItem: options.resolveProvider ? (item, token) => {
12284
- const client2 = this._client;
12284
+ const client = this._client;
12285
12285
  const middleware = this._client.middleware;
12286
12286
  const resolveCompletionItem = (item2, token2) => {
12287
- return client2.sendRequest(vscode_languageserver_protocol_1.CompletionResolveRequest.type, client2.code2ProtocolConverter.asCompletionItem(item2, !!this.labelDetailsSupport.get(id)), token2).then((result) => {
12287
+ return client.sendRequest(vscode_languageserver_protocol_1.CompletionResolveRequest.type, client.code2ProtocolConverter.asCompletionItem(item2, !!this.labelDetailsSupport.get(id)), token2).then((result) => {
12288
12288
  if (token2.isCancellationRequested) {
12289
12289
  return null;
12290
12290
  }
12291
- return client2.protocol2CodeConverter.asCompletionItem(result);
12291
+ return client.protocol2CodeConverter.asCompletionItem(result);
12292
12292
  }, (error) => {
12293
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.CompletionResolveRequest.type, token2, error, item2);
12293
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.CompletionResolveRequest.type, token2, error, item2);
12294
12294
  });
12295
12295
  };
12296
12296
  return middleware.resolveCompletionItem ? middleware.resolveCompletionItem(item, token, resolveCompletionItem) : resolveCompletionItem(item, token);
@@ -12314,8 +12314,8 @@ var require_hover = __commonJS({
12314
12314
  var features_1 = require_features();
12315
12315
  var UUID = require_uuid();
12316
12316
  var HoverFeature = class extends features_1.TextDocumentLanguageFeature {
12317
- constructor(client2) {
12318
- super(client2, vscode_languageserver_protocol_1.HoverRequest.type);
12317
+ constructor(client) {
12318
+ super(client, vscode_languageserver_protocol_1.HoverRequest.type);
12319
12319
  }
12320
12320
  fillClientCapabilities(capabilities) {
12321
12321
  const hoverCapability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "hover");
@@ -12336,18 +12336,18 @@ var require_hover = __commonJS({
12336
12336
  const selector = options.documentSelector;
12337
12337
  const provider = {
12338
12338
  provideHover: (document, position, token) => {
12339
- const client2 = this._client;
12339
+ const client = this._client;
12340
12340
  const provideHover = (document2, position2, token2) => {
12341
- return client2.sendRequest(vscode_languageserver_protocol_1.HoverRequest.type, client2.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2), token2).then((result) => {
12341
+ return client.sendRequest(vscode_languageserver_protocol_1.HoverRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2), token2).then((result) => {
12342
12342
  if (token2.isCancellationRequested) {
12343
12343
  return null;
12344
12344
  }
12345
- return client2.protocol2CodeConverter.asHover(result);
12345
+ return client.protocol2CodeConverter.asHover(result);
12346
12346
  }, (error) => {
12347
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.HoverRequest.type, token2, error, null);
12347
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.HoverRequest.type, token2, error, null);
12348
12348
  });
12349
12349
  };
12350
- const middleware = client2.middleware;
12350
+ const middleware = client.middleware;
12351
12351
  return middleware.provideHover ? middleware.provideHover(document, position, token, provideHover) : provideHover(document, position, token);
12352
12352
  }
12353
12353
  };
@@ -12372,8 +12372,8 @@ var require_definition = __commonJS({
12372
12372
  var features_1 = require_features();
12373
12373
  var UUID = require_uuid();
12374
12374
  var DefinitionFeature = class extends features_1.TextDocumentLanguageFeature {
12375
- constructor(client2) {
12376
- super(client2, vscode_languageserver_protocol_1.DefinitionRequest.type);
12375
+ constructor(client) {
12376
+ super(client, vscode_languageserver_protocol_1.DefinitionRequest.type);
12377
12377
  }
12378
12378
  fillClientCapabilities(capabilities) {
12379
12379
  let definitionSupport = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "definition");
@@ -12391,18 +12391,18 @@ var require_definition = __commonJS({
12391
12391
  const selector = options.documentSelector;
12392
12392
  const provider = {
12393
12393
  provideDefinition: (document, position, token) => {
12394
- const client2 = this._client;
12394
+ const client = this._client;
12395
12395
  const provideDefinition = (document2, position2, token2) => {
12396
- return client2.sendRequest(vscode_languageserver_protocol_1.DefinitionRequest.type, client2.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2), token2).then((result) => {
12396
+ return client.sendRequest(vscode_languageserver_protocol_1.DefinitionRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2), token2).then((result) => {
12397
12397
  if (token2.isCancellationRequested) {
12398
12398
  return null;
12399
12399
  }
12400
- return client2.protocol2CodeConverter.asDefinitionResult(result, token2);
12400
+ return client.protocol2CodeConverter.asDefinitionResult(result, token2);
12401
12401
  }, (error) => {
12402
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.DefinitionRequest.type, token2, error, null);
12402
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.DefinitionRequest.type, token2, error, null);
12403
12403
  });
12404
12404
  };
12405
- const middleware = client2.middleware;
12405
+ const middleware = client.middleware;
12406
12406
  return middleware.provideDefinition ? middleware.provideDefinition(document, position, token, provideDefinition) : provideDefinition(document, position, token);
12407
12407
  }
12408
12408
  };
@@ -12427,8 +12427,8 @@ var require_signatureHelp = __commonJS({
12427
12427
  var features_1 = require_features();
12428
12428
  var UUID = require_uuid();
12429
12429
  var SignatureHelpFeature = class extends features_1.TextDocumentLanguageFeature {
12430
- constructor(client2) {
12431
- super(client2, vscode_languageserver_protocol_1.SignatureHelpRequest.type);
12430
+ constructor(client) {
12431
+ super(client, vscode_languageserver_protocol_1.SignatureHelpRequest.type);
12432
12432
  }
12433
12433
  fillClientCapabilities(capabilities) {
12434
12434
  let config = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "signatureHelp");
@@ -12451,18 +12451,18 @@ var require_signatureHelp = __commonJS({
12451
12451
  registerLanguageProvider(options) {
12452
12452
  const provider = {
12453
12453
  provideSignatureHelp: (document, position, token, context) => {
12454
- const client2 = this._client;
12454
+ const client = this._client;
12455
12455
  const providerSignatureHelp = (document2, position2, context2, token2) => {
12456
- return client2.sendRequest(vscode_languageserver_protocol_1.SignatureHelpRequest.type, client2.code2ProtocolConverter.asSignatureHelpParams(document2, position2, context2), token2).then((result) => {
12456
+ return client.sendRequest(vscode_languageserver_protocol_1.SignatureHelpRequest.type, client.code2ProtocolConverter.asSignatureHelpParams(document2, position2, context2), token2).then((result) => {
12457
12457
  if (token2.isCancellationRequested) {
12458
12458
  return null;
12459
12459
  }
12460
- return client2.protocol2CodeConverter.asSignatureHelp(result, token2);
12460
+ return client.protocol2CodeConverter.asSignatureHelp(result, token2);
12461
12461
  }, (error) => {
12462
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.SignatureHelpRequest.type, token2, error, null);
12462
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.SignatureHelpRequest.type, token2, error, null);
12463
12463
  });
12464
12464
  };
12465
- const middleware = client2.middleware;
12465
+ const middleware = client.middleware;
12466
12466
  return middleware.provideSignatureHelp ? middleware.provideSignatureHelp(document, position, context, token, providerSignatureHelp) : providerSignatureHelp(document, position, context, token);
12467
12467
  }
12468
12468
  };
@@ -12497,8 +12497,8 @@ var require_documentHighlight = __commonJS({
12497
12497
  var features_1 = require_features();
12498
12498
  var UUID = require_uuid();
12499
12499
  var DocumentHighlightFeature = class extends features_1.TextDocumentLanguageFeature {
12500
- constructor(client2) {
12501
- super(client2, vscode_languageserver_protocol_1.DocumentHighlightRequest.type);
12500
+ constructor(client) {
12501
+ super(client, vscode_languageserver_protocol_1.DocumentHighlightRequest.type);
12502
12502
  }
12503
12503
  fillClientCapabilities(capabilities) {
12504
12504
  (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "documentHighlight").dynamicRegistration = true;
@@ -12514,18 +12514,18 @@ var require_documentHighlight = __commonJS({
12514
12514
  const selector = options.documentSelector;
12515
12515
  const provider = {
12516
12516
  provideDocumentHighlights: (document, position, token) => {
12517
- const client2 = this._client;
12517
+ const client = this._client;
12518
12518
  const _provideDocumentHighlights = (document2, position2, token2) => {
12519
- return client2.sendRequest(vscode_languageserver_protocol_1.DocumentHighlightRequest.type, client2.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2), token2).then((result) => {
12519
+ return client.sendRequest(vscode_languageserver_protocol_1.DocumentHighlightRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2), token2).then((result) => {
12520
12520
  if (token2.isCancellationRequested) {
12521
12521
  return null;
12522
12522
  }
12523
- return client2.protocol2CodeConverter.asDocumentHighlights(result, token2);
12523
+ return client.protocol2CodeConverter.asDocumentHighlights(result, token2);
12524
12524
  }, (error) => {
12525
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.DocumentHighlightRequest.type, token2, error, null);
12525
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentHighlightRequest.type, token2, error, null);
12526
12526
  });
12527
12527
  };
12528
- const middleware = client2.middleware;
12528
+ const middleware = client.middleware;
12529
12529
  return middleware.provideDocumentHighlights ? middleware.provideDocumentHighlights(document, position, token, _provideDocumentHighlights) : _provideDocumentHighlights(document, position, token);
12530
12530
  }
12531
12531
  };
@@ -12578,8 +12578,8 @@ var require_documentSymbol = __commonJS({
12578
12578
  vscode_languageserver_protocol_1.SymbolTag.Deprecated
12579
12579
  ];
12580
12580
  var DocumentSymbolFeature = class extends features_1.TextDocumentLanguageFeature {
12581
- constructor(client2) {
12582
- super(client2, vscode_languageserver_protocol_1.DocumentSymbolRequest.type);
12581
+ constructor(client) {
12582
+ super(client, vscode_languageserver_protocol_1.DocumentSymbolRequest.type);
12583
12583
  }
12584
12584
  fillClientCapabilities(capabilities) {
12585
12585
  let symbolCapabilities = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "documentSymbol");
@@ -12604,10 +12604,10 @@ var require_documentSymbol = __commonJS({
12604
12604
  const selector = options.documentSelector;
12605
12605
  const provider = {
12606
12606
  provideDocumentSymbols: (document, token) => {
12607
- const client2 = this._client;
12607
+ const client = this._client;
12608
12608
  const _provideDocumentSymbols = async (document2, token2) => {
12609
12609
  try {
12610
- const data = await client2.sendRequest(vscode_languageserver_protocol_1.DocumentSymbolRequest.type, client2.code2ProtocolConverter.asDocumentSymbolParams(document2), token2);
12610
+ const data = await client.sendRequest(vscode_languageserver_protocol_1.DocumentSymbolRequest.type, client.code2ProtocolConverter.asDocumentSymbolParams(document2), token2);
12611
12611
  if (token2.isCancellationRequested || data === void 0 || data === null) {
12612
12612
  return null;
12613
12613
  }
@@ -12616,16 +12616,16 @@ var require_documentSymbol = __commonJS({
12616
12616
  } else {
12617
12617
  const first = data[0];
12618
12618
  if (vscode_languageserver_protocol_1.DocumentSymbol.is(first)) {
12619
- return await client2.protocol2CodeConverter.asDocumentSymbols(data, token2);
12619
+ return await client.protocol2CodeConverter.asDocumentSymbols(data, token2);
12620
12620
  } else {
12621
- return await client2.protocol2CodeConverter.asSymbolInformations(data, token2);
12621
+ return await client.protocol2CodeConverter.asSymbolInformations(data, token2);
12622
12622
  }
12623
12623
  }
12624
12624
  } catch (error) {
12625
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.DocumentSymbolRequest.type, token2, error, null);
12625
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentSymbolRequest.type, token2, error, null);
12626
12626
  }
12627
12627
  };
12628
- const middleware = client2.middleware;
12628
+ const middleware = client.middleware;
12629
12629
  return middleware.provideDocumentSymbols ? middleware.provideDocumentSymbols(document, token, _provideDocumentSymbols) : _provideDocumentSymbols(document, token);
12630
12630
  }
12631
12631
  };
@@ -12649,8 +12649,8 @@ var require_workspaceSymbol = __commonJS({
12649
12649
  var documentSymbol_1 = require_documentSymbol();
12650
12650
  var UUID = require_uuid();
12651
12651
  var WorkspaceSymbolFeature = class extends features_1.WorkspaceFeature {
12652
- constructor(client2) {
12653
- super(client2, vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type);
12652
+ constructor(client) {
12653
+ super(client, vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type);
12654
12654
  }
12655
12655
  fillClientCapabilities(capabilities) {
12656
12656
  let symbolCapabilities = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "workspace"), "symbol");
@@ -12675,33 +12675,33 @@ var require_workspaceSymbol = __commonJS({
12675
12675
  registerLanguageProvider(options) {
12676
12676
  const provider = {
12677
12677
  provideWorkspaceSymbols: (query, token) => {
12678
- const client2 = this._client;
12678
+ const client = this._client;
12679
12679
  const provideWorkspaceSymbols = (query2, token2) => {
12680
- return client2.sendRequest(vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type, { query: query2 }, token2).then((result) => {
12680
+ return client.sendRequest(vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type, { query: query2 }, token2).then((result) => {
12681
12681
  if (token2.isCancellationRequested) {
12682
12682
  return null;
12683
12683
  }
12684
- return client2.protocol2CodeConverter.asSymbolInformations(result, token2);
12684
+ return client.protocol2CodeConverter.asSymbolInformations(result, token2);
12685
12685
  }, (error) => {
12686
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type, token2, error, null);
12686
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.WorkspaceSymbolRequest.type, token2, error, null);
12687
12687
  });
12688
12688
  };
12689
- const middleware = client2.middleware;
12689
+ const middleware = client.middleware;
12690
12690
  return middleware.provideWorkspaceSymbols ? middleware.provideWorkspaceSymbols(query, token, provideWorkspaceSymbols) : provideWorkspaceSymbols(query, token);
12691
12691
  },
12692
12692
  resolveWorkspaceSymbol: options.resolveProvider === true ? (item, token) => {
12693
- const client2 = this._client;
12693
+ const client = this._client;
12694
12694
  const resolveWorkspaceSymbol = (item2, token2) => {
12695
- return client2.sendRequest(vscode_languageserver_protocol_1.WorkspaceSymbolResolveRequest.type, client2.code2ProtocolConverter.asWorkspaceSymbol(item2), token2).then((result) => {
12695
+ return client.sendRequest(vscode_languageserver_protocol_1.WorkspaceSymbolResolveRequest.type, client.code2ProtocolConverter.asWorkspaceSymbol(item2), token2).then((result) => {
12696
12696
  if (token2.isCancellationRequested) {
12697
12697
  return null;
12698
12698
  }
12699
- return client2.protocol2CodeConverter.asSymbolInformation(result);
12699
+ return client.protocol2CodeConverter.asSymbolInformation(result);
12700
12700
  }, (error) => {
12701
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.WorkspaceSymbolResolveRequest.type, token2, error, null);
12701
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.WorkspaceSymbolResolveRequest.type, token2, error, null);
12702
12702
  });
12703
12703
  };
12704
- const middleware = client2.middleware;
12704
+ const middleware = client.middleware;
12705
12705
  return middleware.resolveWorkspaceSymbol ? middleware.resolveWorkspaceSymbol(item, token, resolveWorkspaceSymbol) : resolveWorkspaceSymbol(item, token);
12706
12706
  } : void 0
12707
12707
  };
@@ -12723,8 +12723,8 @@ var require_reference = __commonJS({
12723
12723
  var features_1 = require_features();
12724
12724
  var UUID = require_uuid();
12725
12725
  var ReferencesFeature = class extends features_1.TextDocumentLanguageFeature {
12726
- constructor(client2) {
12727
- super(client2, vscode_languageserver_protocol_1.ReferencesRequest.type);
12726
+ constructor(client) {
12727
+ super(client, vscode_languageserver_protocol_1.ReferencesRequest.type);
12728
12728
  }
12729
12729
  fillClientCapabilities(capabilities) {
12730
12730
  (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "references").dynamicRegistration = true;
@@ -12740,18 +12740,18 @@ var require_reference = __commonJS({
12740
12740
  const selector = options.documentSelector;
12741
12741
  const provider = {
12742
12742
  provideReferences: (document, position, options2, token) => {
12743
- const client2 = this._client;
12743
+ const client = this._client;
12744
12744
  const _providerReferences = (document2, position2, options3, token2) => {
12745
- return client2.sendRequest(vscode_languageserver_protocol_1.ReferencesRequest.type, client2.code2ProtocolConverter.asReferenceParams(document2, position2, options3), token2).then((result) => {
12745
+ return client.sendRequest(vscode_languageserver_protocol_1.ReferencesRequest.type, client.code2ProtocolConverter.asReferenceParams(document2, position2, options3), token2).then((result) => {
12746
12746
  if (token2.isCancellationRequested) {
12747
12747
  return null;
12748
12748
  }
12749
- return client2.protocol2CodeConverter.asReferences(result, token2);
12749
+ return client.protocol2CodeConverter.asReferences(result, token2);
12750
12750
  }, (error) => {
12751
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.ReferencesRequest.type, token2, error, null);
12751
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.ReferencesRequest.type, token2, error, null);
12752
12752
  });
12753
12753
  };
12754
- const middleware = client2.middleware;
12754
+ const middleware = client.middleware;
12755
12755
  return middleware.provideReferences ? middleware.provideReferences(document, position, options2, token, _providerReferences) : _providerReferences(document, position, options2, token);
12756
12756
  }
12757
12757
  };
@@ -12776,8 +12776,8 @@ var require_codeAction = __commonJS({
12776
12776
  var UUID = require_uuid();
12777
12777
  var features_1 = require_features();
12778
12778
  var CodeActionFeature = class extends features_1.TextDocumentLanguageFeature {
12779
- constructor(client2) {
12780
- super(client2, vscode_languageserver_protocol_1.CodeActionRequest.type);
12779
+ constructor(client) {
12780
+ super(client, vscode_languageserver_protocol_1.CodeActionRequest.type);
12781
12781
  }
12782
12782
  fillClientCapabilities(capabilities) {
12783
12783
  const cap = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "codeAction");
@@ -12815,36 +12815,36 @@ var require_codeAction = __commonJS({
12815
12815
  const selector = options.documentSelector;
12816
12816
  const provider = {
12817
12817
  provideCodeActions: (document, range, context, token) => {
12818
- const client2 = this._client;
12818
+ const client = this._client;
12819
12819
  const _provideCodeActions = async (document2, range2, context2, token2) => {
12820
12820
  const params = {
12821
- textDocument: client2.code2ProtocolConverter.asTextDocumentIdentifier(document2),
12822
- range: client2.code2ProtocolConverter.asRange(range2),
12823
- context: client2.code2ProtocolConverter.asCodeActionContextSync(context2)
12821
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document2),
12822
+ range: client.code2ProtocolConverter.asRange(range2),
12823
+ context: client.code2ProtocolConverter.asCodeActionContextSync(context2)
12824
12824
  };
12825
- return client2.sendRequest(vscode_languageserver_protocol_1.CodeActionRequest.type, params, token2).then((values) => {
12825
+ return client.sendRequest(vscode_languageserver_protocol_1.CodeActionRequest.type, params, token2).then((values) => {
12826
12826
  if (token2.isCancellationRequested || values === null || values === void 0) {
12827
12827
  return null;
12828
12828
  }
12829
- return client2.protocol2CodeConverter.asCodeActionResult(values, token2);
12829
+ return client.protocol2CodeConverter.asCodeActionResult(values, token2);
12830
12830
  }, (error) => {
12831
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.CodeActionRequest.type, token2, error, null);
12831
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.CodeActionRequest.type, token2, error, null);
12832
12832
  });
12833
12833
  };
12834
- const middleware = client2.middleware;
12834
+ const middleware = client.middleware;
12835
12835
  return middleware.provideCodeActions ? middleware.provideCodeActions(document, range, context, token, _provideCodeActions) : _provideCodeActions(document, range, context, token);
12836
12836
  },
12837
12837
  resolveCodeAction: options.resolveProvider ? (item, token) => {
12838
- const client2 = this._client;
12838
+ const client = this._client;
12839
12839
  const middleware = this._client.middleware;
12840
12840
  const resolveCodeAction = async (item2, token2) => {
12841
- return client2.sendRequest(vscode_languageserver_protocol_1.CodeActionResolveRequest.type, client2.code2ProtocolConverter.asCodeActionSync(item2), token2).then((result) => {
12841
+ return client.sendRequest(vscode_languageserver_protocol_1.CodeActionResolveRequest.type, client.code2ProtocolConverter.asCodeActionSync(item2), token2).then((result) => {
12842
12842
  if (token2.isCancellationRequested) {
12843
12843
  return item2;
12844
12844
  }
12845
- return client2.protocol2CodeConverter.asCodeAction(result, token2);
12845
+ return client.protocol2CodeConverter.asCodeAction(result, token2);
12846
12846
  }, (error) => {
12847
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.CodeActionResolveRequest.type, token2, error, item2);
12847
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.CodeActionResolveRequest.type, token2, error, item2);
12848
12848
  });
12849
12849
  };
12850
12850
  return middleware.resolveCodeAction ? middleware.resolveCodeAction(item, token, resolveCodeAction) : resolveCodeAction(item, token);
@@ -12868,16 +12868,16 @@ var require_codeLens = __commonJS({
12868
12868
  var UUID = require_uuid();
12869
12869
  var features_1 = require_features();
12870
12870
  var CodeLensFeature = class extends features_1.TextDocumentLanguageFeature {
12871
- constructor(client2) {
12872
- super(client2, vscode_languageserver_protocol_1.CodeLensRequest.type);
12871
+ constructor(client) {
12872
+ super(client, vscode_languageserver_protocol_1.CodeLensRequest.type);
12873
12873
  }
12874
12874
  fillClientCapabilities(capabilities) {
12875
12875
  (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "codeLens").dynamicRegistration = true;
12876
12876
  (0, features_1.ensure)((0, features_1.ensure)(capabilities, "workspace"), "codeLens").refreshSupport = true;
12877
12877
  }
12878
12878
  initialize(capabilities, documentSelector) {
12879
- const client2 = this._client;
12880
- client2.onRequest(vscode_languageserver_protocol_1.CodeLensRefreshRequest.type, async () => {
12879
+ const client = this._client;
12880
+ client.onRequest(vscode_languageserver_protocol_1.CodeLensRefreshRequest.type, async () => {
12881
12881
  for (const provider of this.getAllProviders()) {
12882
12882
  provider.onDidChangeCodeLensEmitter.fire();
12883
12883
  }
@@ -12894,33 +12894,33 @@ var require_codeLens = __commonJS({
12894
12894
  const provider = {
12895
12895
  onDidChangeCodeLenses: eventEmitter.event,
12896
12896
  provideCodeLenses: (document, token) => {
12897
- const client2 = this._client;
12897
+ const client = this._client;
12898
12898
  const provideCodeLenses = (document2, token2) => {
12899
- return client2.sendRequest(vscode_languageserver_protocol_1.CodeLensRequest.type, client2.code2ProtocolConverter.asCodeLensParams(document2), token2).then((result) => {
12899
+ return client.sendRequest(vscode_languageserver_protocol_1.CodeLensRequest.type, client.code2ProtocolConverter.asCodeLensParams(document2), token2).then((result) => {
12900
12900
  if (token2.isCancellationRequested) {
12901
12901
  return null;
12902
12902
  }
12903
- return client2.protocol2CodeConverter.asCodeLenses(result, token2);
12903
+ return client.protocol2CodeConverter.asCodeLenses(result, token2);
12904
12904
  }, (error) => {
12905
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.CodeLensRequest.type, token2, error, null);
12905
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.CodeLensRequest.type, token2, error, null);
12906
12906
  });
12907
12907
  };
12908
- const middleware = client2.middleware;
12908
+ const middleware = client.middleware;
12909
12909
  return middleware.provideCodeLenses ? middleware.provideCodeLenses(document, token, provideCodeLenses) : provideCodeLenses(document, token);
12910
12910
  },
12911
12911
  resolveCodeLens: options.resolveProvider ? (codeLens, token) => {
12912
- const client2 = this._client;
12912
+ const client = this._client;
12913
12913
  const resolveCodeLens = (codeLens2, token2) => {
12914
- return client2.sendRequest(vscode_languageserver_protocol_1.CodeLensResolveRequest.type, client2.code2ProtocolConverter.asCodeLens(codeLens2), token2).then((result) => {
12914
+ return client.sendRequest(vscode_languageserver_protocol_1.CodeLensResolveRequest.type, client.code2ProtocolConverter.asCodeLens(codeLens2), token2).then((result) => {
12915
12915
  if (token2.isCancellationRequested) {
12916
12916
  return codeLens2;
12917
12917
  }
12918
- return client2.protocol2CodeConverter.asCodeLens(result);
12918
+ return client.protocol2CodeConverter.asCodeLens(result);
12919
12919
  }, (error) => {
12920
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.CodeLensResolveRequest.type, token2, error, codeLens2);
12920
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.CodeLensResolveRequest.type, token2, error, codeLens2);
12921
12921
  });
12922
12922
  };
12923
- const middleware = client2.middleware;
12923
+ const middleware = client.middleware;
12924
12924
  return middleware.resolveCodeLens ? middleware.resolveCodeLens(codeLens, token, resolveCodeLens) : resolveCodeLens(codeLens, token);
12925
12925
  } : void 0
12926
12926
  };
@@ -12954,8 +12954,8 @@ var require_formatting = __commonJS({
12954
12954
  FileFormattingOptions2.fromConfiguration = fromConfiguration;
12955
12955
  })(FileFormattingOptions || (FileFormattingOptions = {}));
12956
12956
  var DocumentFormattingFeature = class extends features_1.TextDocumentLanguageFeature {
12957
- constructor(client2) {
12958
- super(client2, vscode_languageserver_protocol_1.DocumentFormattingRequest.type);
12957
+ constructor(client) {
12958
+ super(client, vscode_languageserver_protocol_1.DocumentFormattingRequest.type);
12959
12959
  }
12960
12960
  fillClientCapabilities(capabilities) {
12961
12961
  (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "formatting").dynamicRegistration = true;
@@ -12971,22 +12971,22 @@ var require_formatting = __commonJS({
12971
12971
  const selector = options.documentSelector;
12972
12972
  const provider = {
12973
12973
  provideDocumentFormattingEdits: (document, options2, token) => {
12974
- const client2 = this._client;
12974
+ const client = this._client;
12975
12975
  const provideDocumentFormattingEdits = (document2, options3, token2) => {
12976
12976
  const params = {
12977
- textDocument: client2.code2ProtocolConverter.asTextDocumentIdentifier(document2),
12978
- options: client2.code2ProtocolConverter.asFormattingOptions(options3, FileFormattingOptions.fromConfiguration(document2))
12977
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document2),
12978
+ options: client.code2ProtocolConverter.asFormattingOptions(options3, FileFormattingOptions.fromConfiguration(document2))
12979
12979
  };
12980
- return client2.sendRequest(vscode_languageserver_protocol_1.DocumentFormattingRequest.type, params, token2).then((result) => {
12980
+ return client.sendRequest(vscode_languageserver_protocol_1.DocumentFormattingRequest.type, params, token2).then((result) => {
12981
12981
  if (token2.isCancellationRequested) {
12982
12982
  return null;
12983
12983
  }
12984
- return client2.protocol2CodeConverter.asTextEdits(result, token2);
12984
+ return client.protocol2CodeConverter.asTextEdits(result, token2);
12985
12985
  }, (error) => {
12986
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.DocumentFormattingRequest.type, token2, error, null);
12986
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentFormattingRequest.type, token2, error, null);
12987
12987
  });
12988
12988
  };
12989
- const middleware = client2.middleware;
12989
+ const middleware = client.middleware;
12990
12990
  return middleware.provideDocumentFormattingEdits ? middleware.provideDocumentFormattingEdits(document, options2, token, provideDocumentFormattingEdits) : provideDocumentFormattingEdits(document, options2, token);
12991
12991
  }
12992
12992
  };
@@ -12995,8 +12995,8 @@ var require_formatting = __commonJS({
12995
12995
  };
12996
12996
  exports2.DocumentFormattingFeature = DocumentFormattingFeature;
12997
12997
  var DocumentRangeFormattingFeature = class extends features_1.TextDocumentLanguageFeature {
12998
- constructor(client2) {
12999
- super(client2, vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type);
12998
+ constructor(client) {
12999
+ super(client, vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type);
13000
13000
  }
13001
13001
  fillClientCapabilities(capabilities) {
13002
13002
  const capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "rangeFormatting");
@@ -13014,45 +13014,45 @@ var require_formatting = __commonJS({
13014
13014
  const selector = options.documentSelector;
13015
13015
  const provider = {
13016
13016
  provideDocumentRangeFormattingEdits: (document, range, options2, token) => {
13017
- const client2 = this._client;
13017
+ const client = this._client;
13018
13018
  const provideDocumentRangeFormattingEdits = (document2, range2, options3, token2) => {
13019
13019
  const params = {
13020
- textDocument: client2.code2ProtocolConverter.asTextDocumentIdentifier(document2),
13021
- range: client2.code2ProtocolConverter.asRange(range2),
13022
- options: client2.code2ProtocolConverter.asFormattingOptions(options3, FileFormattingOptions.fromConfiguration(document2))
13020
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document2),
13021
+ range: client.code2ProtocolConverter.asRange(range2),
13022
+ options: client.code2ProtocolConverter.asFormattingOptions(options3, FileFormattingOptions.fromConfiguration(document2))
13023
13023
  };
13024
- return client2.sendRequest(vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type, params, token2).then((result) => {
13024
+ return client.sendRequest(vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type, params, token2).then((result) => {
13025
13025
  if (token2.isCancellationRequested) {
13026
13026
  return null;
13027
13027
  }
13028
- return client2.protocol2CodeConverter.asTextEdits(result, token2);
13028
+ return client.protocol2CodeConverter.asTextEdits(result, token2);
13029
13029
  }, (error) => {
13030
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type, token2, error, null);
13030
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentRangeFormattingRequest.type, token2, error, null);
13031
13031
  });
13032
13032
  };
13033
- const middleware = client2.middleware;
13033
+ const middleware = client.middleware;
13034
13034
  return middleware.provideDocumentRangeFormattingEdits ? middleware.provideDocumentRangeFormattingEdits(document, range, options2, token, provideDocumentRangeFormattingEdits) : provideDocumentRangeFormattingEdits(document, range, options2, token);
13035
13035
  }
13036
13036
  };
13037
13037
  if (options.rangesSupport) {
13038
13038
  provider.provideDocumentRangesFormattingEdits = (document, ranges, options2, token) => {
13039
- const client2 = this._client;
13039
+ const client = this._client;
13040
13040
  const provideDocumentRangesFormattingEdits = (document2, ranges2, options3, token2) => {
13041
13041
  const params = {
13042
- textDocument: client2.code2ProtocolConverter.asTextDocumentIdentifier(document2),
13043
- ranges: client2.code2ProtocolConverter.asRanges(ranges2),
13044
- options: client2.code2ProtocolConverter.asFormattingOptions(options3, FileFormattingOptions.fromConfiguration(document2))
13042
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document2),
13043
+ ranges: client.code2ProtocolConverter.asRanges(ranges2),
13044
+ options: client.code2ProtocolConverter.asFormattingOptions(options3, FileFormattingOptions.fromConfiguration(document2))
13045
13045
  };
13046
- return client2.sendRequest(vscode_languageserver_protocol_1.DocumentRangesFormattingRequest.type, params, token2).then((result) => {
13046
+ return client.sendRequest(vscode_languageserver_protocol_1.DocumentRangesFormattingRequest.type, params, token2).then((result) => {
13047
13047
  if (token2.isCancellationRequested) {
13048
13048
  return null;
13049
13049
  }
13050
- return client2.protocol2CodeConverter.asTextEdits(result, token2);
13050
+ return client.protocol2CodeConverter.asTextEdits(result, token2);
13051
13051
  }, (error) => {
13052
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.DocumentRangesFormattingRequest.type, token2, error, null);
13052
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentRangesFormattingRequest.type, token2, error, null);
13053
13053
  });
13054
13054
  };
13055
- const middleware = client2.middleware;
13055
+ const middleware = client.middleware;
13056
13056
  return middleware.provideDocumentRangesFormattingEdits ? middleware.provideDocumentRangesFormattingEdits(document, ranges, options2, token, provideDocumentRangesFormattingEdits) : provideDocumentRangesFormattingEdits(document, ranges, options2, token);
13057
13057
  };
13058
13058
  }
@@ -13061,8 +13061,8 @@ var require_formatting = __commonJS({
13061
13061
  };
13062
13062
  exports2.DocumentRangeFormattingFeature = DocumentRangeFormattingFeature;
13063
13063
  var DocumentOnTypeFormattingFeature = class extends features_1.TextDocumentLanguageFeature {
13064
- constructor(client2) {
13065
- super(client2, vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type);
13064
+ constructor(client) {
13065
+ super(client, vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type);
13066
13066
  }
13067
13067
  fillClientCapabilities(capabilities) {
13068
13068
  (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "onTypeFormatting").dynamicRegistration = true;
@@ -13078,24 +13078,24 @@ var require_formatting = __commonJS({
13078
13078
  const selector = options.documentSelector;
13079
13079
  const provider = {
13080
13080
  provideOnTypeFormattingEdits: (document, position, ch, options2, token) => {
13081
- const client2 = this._client;
13081
+ const client = this._client;
13082
13082
  const provideOnTypeFormattingEdits = (document2, position2, ch2, options3, token2) => {
13083
13083
  let params = {
13084
- textDocument: client2.code2ProtocolConverter.asTextDocumentIdentifier(document2),
13085
- position: client2.code2ProtocolConverter.asPosition(position2),
13084
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document2),
13085
+ position: client.code2ProtocolConverter.asPosition(position2),
13086
13086
  ch: ch2,
13087
- options: client2.code2ProtocolConverter.asFormattingOptions(options3, FileFormattingOptions.fromConfiguration(document2))
13087
+ options: client.code2ProtocolConverter.asFormattingOptions(options3, FileFormattingOptions.fromConfiguration(document2))
13088
13088
  };
13089
- return client2.sendRequest(vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type, params, token2).then((result) => {
13089
+ return client.sendRequest(vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type, params, token2).then((result) => {
13090
13090
  if (token2.isCancellationRequested) {
13091
13091
  return null;
13092
13092
  }
13093
- return client2.protocol2CodeConverter.asTextEdits(result, token2);
13093
+ return client.protocol2CodeConverter.asTextEdits(result, token2);
13094
13094
  }, (error) => {
13095
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type, token2, error, null);
13095
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentOnTypeFormattingRequest.type, token2, error, null);
13096
13096
  });
13097
13097
  };
13098
- const middleware = client2.middleware;
13098
+ const middleware = client.middleware;
13099
13099
  return middleware.provideOnTypeFormattingEdits ? middleware.provideOnTypeFormattingEdits(document, position, ch, options2, token, provideOnTypeFormattingEdits) : provideOnTypeFormattingEdits(document, position, ch, options2, token);
13100
13100
  }
13101
13101
  };
@@ -13119,8 +13119,8 @@ var require_rename = __commonJS({
13119
13119
  var Is = require_is();
13120
13120
  var features_1 = require_features();
13121
13121
  var RenameFeature = class extends features_1.TextDocumentLanguageFeature {
13122
- constructor(client2) {
13123
- super(client2, vscode_languageserver_protocol_1.RenameRequest.type);
13122
+ constructor(client) {
13123
+ super(client, vscode_languageserver_protocol_1.RenameRequest.type);
13124
13124
  }
13125
13125
  fillClientCapabilities(capabilities) {
13126
13126
  let rename = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "rename");
@@ -13143,43 +13143,43 @@ var require_rename = __commonJS({
13143
13143
  const selector = options.documentSelector;
13144
13144
  const provider = {
13145
13145
  provideRenameEdits: (document, position, newName, token) => {
13146
- const client2 = this._client;
13146
+ const client = this._client;
13147
13147
  const provideRenameEdits = (document2, position2, newName2, token2) => {
13148
13148
  let params = {
13149
- textDocument: client2.code2ProtocolConverter.asTextDocumentIdentifier(document2),
13150
- position: client2.code2ProtocolConverter.asPosition(position2),
13149
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document2),
13150
+ position: client.code2ProtocolConverter.asPosition(position2),
13151
13151
  newName: newName2
13152
13152
  };
13153
- return client2.sendRequest(vscode_languageserver_protocol_1.RenameRequest.type, params, token2).then((result) => {
13153
+ return client.sendRequest(vscode_languageserver_protocol_1.RenameRequest.type, params, token2).then((result) => {
13154
13154
  if (token2.isCancellationRequested) {
13155
13155
  return null;
13156
13156
  }
13157
- return client2.protocol2CodeConverter.asWorkspaceEdit(result, token2);
13157
+ return client.protocol2CodeConverter.asWorkspaceEdit(result, token2);
13158
13158
  }, (error) => {
13159
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.RenameRequest.type, token2, error, null, false);
13159
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.RenameRequest.type, token2, error, null, false);
13160
13160
  });
13161
13161
  };
13162
- const middleware = client2.middleware;
13162
+ const middleware = client.middleware;
13163
13163
  return middleware.provideRenameEdits ? middleware.provideRenameEdits(document, position, newName, token, provideRenameEdits) : provideRenameEdits(document, position, newName, token);
13164
13164
  },
13165
13165
  prepareRename: options.prepareProvider ? (document, position, token) => {
13166
- const client2 = this._client;
13166
+ const client = this._client;
13167
13167
  const prepareRename = (document2, position2, token2) => {
13168
13168
  let params = {
13169
- textDocument: client2.code2ProtocolConverter.asTextDocumentIdentifier(document2),
13170
- position: client2.code2ProtocolConverter.asPosition(position2)
13169
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document2),
13170
+ position: client.code2ProtocolConverter.asPosition(position2)
13171
13171
  };
13172
- return client2.sendRequest(vscode_languageserver_protocol_1.PrepareRenameRequest.type, params, token2).then((result) => {
13172
+ return client.sendRequest(vscode_languageserver_protocol_1.PrepareRenameRequest.type, params, token2).then((result) => {
13173
13173
  if (token2.isCancellationRequested) {
13174
13174
  return null;
13175
13175
  }
13176
13176
  if (vscode_languageserver_protocol_1.Range.is(result)) {
13177
- return client2.protocol2CodeConverter.asRange(result);
13177
+ return client.protocol2CodeConverter.asRange(result);
13178
13178
  } else if (this.isDefaultBehavior(result)) {
13179
13179
  return result.defaultBehavior === true ? null : Promise.reject(new Error(`The element can't be renamed.`));
13180
13180
  } else if (result && vscode_languageserver_protocol_1.Range.is(result.range)) {
13181
13181
  return {
13182
- range: client2.protocol2CodeConverter.asRange(result.range),
13182
+ range: client.protocol2CodeConverter.asRange(result.range),
13183
13183
  placeholder: result.placeholder
13184
13184
  };
13185
13185
  }
@@ -13192,7 +13192,7 @@ var require_rename = __commonJS({
13192
13192
  }
13193
13193
  });
13194
13194
  };
13195
- const middleware = client2.middleware;
13195
+ const middleware = client.middleware;
13196
13196
  return middleware.prepareRename ? middleware.prepareRename(document, position, token, prepareRename) : prepareRename(document, position, token);
13197
13197
  } : void 0
13198
13198
  };
@@ -13221,8 +13221,8 @@ var require_documentLink = __commonJS({
13221
13221
  var features_1 = require_features();
13222
13222
  var UUID = require_uuid();
13223
13223
  var DocumentLinkFeature = class extends features_1.TextDocumentLanguageFeature {
13224
- constructor(client2) {
13225
- super(client2, vscode_languageserver_protocol_1.DocumentLinkRequest.type);
13224
+ constructor(client) {
13225
+ super(client, vscode_languageserver_protocol_1.DocumentLinkRequest.type);
13226
13226
  }
13227
13227
  fillClientCapabilities(capabilities) {
13228
13228
  const documentLinkCapabilities = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "documentLink");
@@ -13240,33 +13240,33 @@ var require_documentLink = __commonJS({
13240
13240
  const selector = options.documentSelector;
13241
13241
  const provider = {
13242
13242
  provideDocumentLinks: (document, token) => {
13243
- const client2 = this._client;
13243
+ const client = this._client;
13244
13244
  const provideDocumentLinks = (document2, token2) => {
13245
- return client2.sendRequest(vscode_languageserver_protocol_1.DocumentLinkRequest.type, client2.code2ProtocolConverter.asDocumentLinkParams(document2), token2).then((result) => {
13245
+ return client.sendRequest(vscode_languageserver_protocol_1.DocumentLinkRequest.type, client.code2ProtocolConverter.asDocumentLinkParams(document2), token2).then((result) => {
13246
13246
  if (token2.isCancellationRequested) {
13247
13247
  return null;
13248
13248
  }
13249
- return client2.protocol2CodeConverter.asDocumentLinks(result, token2);
13249
+ return client.protocol2CodeConverter.asDocumentLinks(result, token2);
13250
13250
  }, (error) => {
13251
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.DocumentLinkRequest.type, token2, error, null);
13251
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentLinkRequest.type, token2, error, null);
13252
13252
  });
13253
13253
  };
13254
- const middleware = client2.middleware;
13254
+ const middleware = client.middleware;
13255
13255
  return middleware.provideDocumentLinks ? middleware.provideDocumentLinks(document, token, provideDocumentLinks) : provideDocumentLinks(document, token);
13256
13256
  },
13257
13257
  resolveDocumentLink: options.resolveProvider ? (link, token) => {
13258
- const client2 = this._client;
13258
+ const client = this._client;
13259
13259
  let resolveDocumentLink = (link2, token2) => {
13260
- return client2.sendRequest(vscode_languageserver_protocol_1.DocumentLinkResolveRequest.type, client2.code2ProtocolConverter.asDocumentLink(link2), token2).then((result) => {
13260
+ return client.sendRequest(vscode_languageserver_protocol_1.DocumentLinkResolveRequest.type, client.code2ProtocolConverter.asDocumentLink(link2), token2).then((result) => {
13261
13261
  if (token2.isCancellationRequested) {
13262
13262
  return link2;
13263
13263
  }
13264
- return client2.protocol2CodeConverter.asDocumentLink(result);
13264
+ return client.protocol2CodeConverter.asDocumentLink(result);
13265
13265
  }, (error) => {
13266
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.DocumentLinkResolveRequest.type, token2, error, link2);
13266
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentLinkResolveRequest.type, token2, error, link2);
13267
13267
  });
13268
13268
  };
13269
- const middleware = client2.middleware;
13269
+ const middleware = client.middleware;
13270
13270
  return middleware.resolveDocumentLink ? middleware.resolveDocumentLink(link, token, resolveDocumentLink) : resolveDocumentLink(link, token);
13271
13271
  } : void 0
13272
13272
  };
@@ -13288,8 +13288,8 @@ var require_executeCommand = __commonJS({
13288
13288
  var UUID = require_uuid();
13289
13289
  var features_1 = require_features();
13290
13290
  var ExecuteCommandFeature = class {
13291
- constructor(client2) {
13292
- this._client = client2;
13291
+ constructor(client) {
13292
+ this._client = client;
13293
13293
  this._commands = /* @__PURE__ */ new Map();
13294
13294
  }
13295
13295
  getState() {
@@ -13311,15 +13311,15 @@ var require_executeCommand = __commonJS({
13311
13311
  });
13312
13312
  }
13313
13313
  register(data) {
13314
- const client2 = this._client;
13315
- const middleware = client2.middleware;
13314
+ const client = this._client;
13315
+ const middleware = client.middleware;
13316
13316
  const executeCommand = (command, args) => {
13317
13317
  let params = {
13318
13318
  command,
13319
13319
  arguments: args
13320
13320
  };
13321
- return client2.sendRequest(vscode_languageserver_protocol_1.ExecuteCommandRequest.type, params).then(void 0, (error) => {
13322
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.ExecuteCommandRequest.type, void 0, error, void 0);
13321
+ return client.sendRequest(vscode_languageserver_protocol_1.ExecuteCommandRequest.type, params).then(void 0, (error) => {
13322
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.ExecuteCommandRequest.type, void 0, error, void 0);
13323
13323
  });
13324
13324
  };
13325
13325
  if (data.registerOptions.commands) {
@@ -13359,8 +13359,8 @@ var require_fileSystemWatcher = __commonJS({
13359
13359
  var vscode_languageserver_protocol_1 = require_main3();
13360
13360
  var features_1 = require_features();
13361
13361
  var FileSystemWatcherFeature = class {
13362
- constructor(client2, notifyFileEvent) {
13363
- this._client = client2;
13362
+ constructor(client, notifyFileEvent) {
13363
+ this._client = client;
13364
13364
  this._notifyFileEvent = notifyFileEvent;
13365
13365
  this._watchers = /* @__PURE__ */ new Map();
13366
13366
  }
@@ -13456,8 +13456,8 @@ var require_colorProvider = __commonJS({
13456
13456
  var vscode_languageserver_protocol_1 = require_main3();
13457
13457
  var features_1 = require_features();
13458
13458
  var ColorProviderFeature = class extends features_1.TextDocumentLanguageFeature {
13459
- constructor(client2) {
13460
- super(client2, vscode_languageserver_protocol_1.DocumentColorRequest.type);
13459
+ constructor(client) {
13460
+ super(client, vscode_languageserver_protocol_1.DocumentColorRequest.type);
13461
13461
  }
13462
13462
  fillClientCapabilities(capabilities) {
13463
13463
  (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "colorProvider").dynamicRegistration = true;
@@ -13473,41 +13473,41 @@ var require_colorProvider = __commonJS({
13473
13473
  const selector = options.documentSelector;
13474
13474
  const provider = {
13475
13475
  provideColorPresentations: (color, context, token) => {
13476
- const client2 = this._client;
13476
+ const client = this._client;
13477
13477
  const provideColorPresentations = (color2, context2, token2) => {
13478
13478
  const requestParams = {
13479
13479
  color: color2,
13480
- textDocument: client2.code2ProtocolConverter.asTextDocumentIdentifier(context2.document),
13481
- range: client2.code2ProtocolConverter.asRange(context2.range)
13480
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(context2.document),
13481
+ range: client.code2ProtocolConverter.asRange(context2.range)
13482
13482
  };
13483
- return client2.sendRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, requestParams, token2).then((result) => {
13483
+ return client.sendRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, requestParams, token2).then((result) => {
13484
13484
  if (token2.isCancellationRequested) {
13485
13485
  return null;
13486
13486
  }
13487
13487
  return this._client.protocol2CodeConverter.asColorPresentations(result, token2);
13488
13488
  }, (error) => {
13489
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, token2, error, null);
13489
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.ColorPresentationRequest.type, token2, error, null);
13490
13490
  });
13491
13491
  };
13492
- const middleware = client2.middleware;
13492
+ const middleware = client.middleware;
13493
13493
  return middleware.provideColorPresentations ? middleware.provideColorPresentations(color, context, token, provideColorPresentations) : provideColorPresentations(color, context, token);
13494
13494
  },
13495
13495
  provideDocumentColors: (document, token) => {
13496
- const client2 = this._client;
13496
+ const client = this._client;
13497
13497
  const provideDocumentColors = (document2, token2) => {
13498
13498
  const requestParams = {
13499
- textDocument: client2.code2ProtocolConverter.asTextDocumentIdentifier(document2)
13499
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document2)
13500
13500
  };
13501
- return client2.sendRequest(vscode_languageserver_protocol_1.DocumentColorRequest.type, requestParams, token2).then((result) => {
13501
+ return client.sendRequest(vscode_languageserver_protocol_1.DocumentColorRequest.type, requestParams, token2).then((result) => {
13502
13502
  if (token2.isCancellationRequested) {
13503
13503
  return null;
13504
13504
  }
13505
13505
  return this._client.protocol2CodeConverter.asColorInformations(result, token2);
13506
13506
  }, (error) => {
13507
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.DocumentColorRequest.type, token2, error, null);
13507
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.DocumentColorRequest.type, token2, error, null);
13508
13508
  });
13509
13509
  };
13510
- const middleware = client2.middleware;
13510
+ const middleware = client.middleware;
13511
13511
  return middleware.provideDocumentColors ? middleware.provideDocumentColors(document, token, provideDocumentColors) : provideDocumentColors(document, token);
13512
13512
  }
13513
13513
  };
@@ -13528,8 +13528,8 @@ var require_implementation = __commonJS({
13528
13528
  var vscode_languageserver_protocol_1 = require_main3();
13529
13529
  var features_1 = require_features();
13530
13530
  var ImplementationFeature = class extends features_1.TextDocumentLanguageFeature {
13531
- constructor(client2) {
13532
- super(client2, vscode_languageserver_protocol_1.ImplementationRequest.type);
13531
+ constructor(client) {
13532
+ super(client, vscode_languageserver_protocol_1.ImplementationRequest.type);
13533
13533
  }
13534
13534
  fillClientCapabilities(capabilities) {
13535
13535
  let implementationSupport = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "implementation");
@@ -13547,18 +13547,18 @@ var require_implementation = __commonJS({
13547
13547
  const selector = options.documentSelector;
13548
13548
  const provider = {
13549
13549
  provideImplementation: (document, position, token) => {
13550
- const client2 = this._client;
13550
+ const client = this._client;
13551
13551
  const provideImplementation = (document2, position2, token2) => {
13552
- return client2.sendRequest(vscode_languageserver_protocol_1.ImplementationRequest.type, client2.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2), token2).then((result) => {
13552
+ return client.sendRequest(vscode_languageserver_protocol_1.ImplementationRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2), token2).then((result) => {
13553
13553
  if (token2.isCancellationRequested) {
13554
13554
  return null;
13555
13555
  }
13556
- return client2.protocol2CodeConverter.asDefinitionResult(result, token2);
13556
+ return client.protocol2CodeConverter.asDefinitionResult(result, token2);
13557
13557
  }, (error) => {
13558
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.ImplementationRequest.type, token2, error, null);
13558
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.ImplementationRequest.type, token2, error, null);
13559
13559
  });
13560
13560
  };
13561
- const middleware = client2.middleware;
13561
+ const middleware = client.middleware;
13562
13562
  return middleware.provideImplementation ? middleware.provideImplementation(document, position, token, provideImplementation) : provideImplementation(document, position, token);
13563
13563
  }
13564
13564
  };
@@ -13582,8 +13582,8 @@ var require_typeDefinition = __commonJS({
13582
13582
  var vscode_languageserver_protocol_1 = require_main3();
13583
13583
  var features_1 = require_features();
13584
13584
  var TypeDefinitionFeature = class extends features_1.TextDocumentLanguageFeature {
13585
- constructor(client2) {
13586
- super(client2, vscode_languageserver_protocol_1.TypeDefinitionRequest.type);
13585
+ constructor(client) {
13586
+ super(client, vscode_languageserver_protocol_1.TypeDefinitionRequest.type);
13587
13587
  }
13588
13588
  fillClientCapabilities(capabilities) {
13589
13589
  (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "typeDefinition").dynamicRegistration = true;
@@ -13602,18 +13602,18 @@ var require_typeDefinition = __commonJS({
13602
13602
  const selector = options.documentSelector;
13603
13603
  const provider = {
13604
13604
  provideTypeDefinition: (document, position, token) => {
13605
- const client2 = this._client;
13605
+ const client = this._client;
13606
13606
  const provideTypeDefinition = (document2, position2, token2) => {
13607
- return client2.sendRequest(vscode_languageserver_protocol_1.TypeDefinitionRequest.type, client2.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2), token2).then((result) => {
13607
+ return client.sendRequest(vscode_languageserver_protocol_1.TypeDefinitionRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2), token2).then((result) => {
13608
13608
  if (token2.isCancellationRequested) {
13609
13609
  return null;
13610
13610
  }
13611
- return client2.protocol2CodeConverter.asDefinitionResult(result, token2);
13611
+ return client.protocol2CodeConverter.asDefinitionResult(result, token2);
13612
13612
  }, (error) => {
13613
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.TypeDefinitionRequest.type, token2, error, null);
13613
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.TypeDefinitionRequest.type, token2, error, null);
13614
13614
  });
13615
13615
  };
13616
- const middleware = client2.middleware;
13616
+ const middleware = client.middleware;
13617
13617
  return middleware.provideTypeDefinition ? middleware.provideTypeDefinition(document, position, token, provideTypeDefinition) : provideTypeDefinition(document, position, token);
13618
13618
  }
13619
13619
  };
@@ -13647,8 +13647,8 @@ var require_workspaceFolder = __commonJS({
13647
13647
  }
13648
13648
  exports2.arrayDiff = arrayDiff;
13649
13649
  var WorkspaceFoldersFeature = class {
13650
- constructor(client2) {
13651
- this._client = client2;
13650
+ constructor(client) {
13651
+ this._client = client;
13652
13652
  this._listeners = /* @__PURE__ */ new Map();
13653
13653
  }
13654
13654
  getState() {
@@ -13674,8 +13674,8 @@ var require_workspaceFolder = __commonJS({
13674
13674
  capabilities.workspace.workspaceFolders = true;
13675
13675
  }
13676
13676
  initialize(capabilities) {
13677
- const client2 = this._client;
13678
- client2.onRequest(vscode_languageserver_protocol_1.WorkspaceFoldersRequest.type, (token) => {
13677
+ const client = this._client;
13678
+ client.onRequest(vscode_languageserver_protocol_1.WorkspaceFoldersRequest.type, (token) => {
13679
13679
  const workspaceFolders = () => {
13680
13680
  const folders = vscode_1.workspace.workspaceFolders;
13681
13681
  if (folders === void 0) {
@@ -13686,7 +13686,7 @@ var require_workspaceFolder = __commonJS({
13686
13686
  });
13687
13687
  return result;
13688
13688
  };
13689
- const middleware = client2.middleware.workspace;
13689
+ const middleware = client.middleware.workspace;
13690
13690
  return middleware && middleware.workspaceFolders ? middleware.workspaceFolders(token, workspaceFolders) : workspaceFolders(token);
13691
13691
  });
13692
13692
  const value = access(access(access(capabilities, "workspace"), "workspaceFolders"), "changeNotifications");
@@ -13730,12 +13730,12 @@ var require_workspaceFolder = __commonJS({
13730
13730
  }
13731
13731
  register(data) {
13732
13732
  let id = data.id;
13733
- let client2 = this._client;
13733
+ let client = this._client;
13734
13734
  let disposable = vscode_1.workspace.onDidChangeWorkspaceFolders((event) => {
13735
13735
  let didChangeWorkspaceFolders = (event2) => {
13736
13736
  return this.doSendEvent(event2.added, event2.removed);
13737
13737
  };
13738
- let middleware = client2.middleware.workspace;
13738
+ let middleware = client.middleware.workspace;
13739
13739
  const promise = middleware && middleware.didChangeWorkspaceFolders ? middleware.didChangeWorkspaceFolders(event, didChangeWorkspaceFolders) : didChangeWorkspaceFolders(event);
13740
13740
  promise.catch((error) => {
13741
13741
  this._client.error(`Sending notification ${vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type.method} failed`, error);
@@ -13779,8 +13779,8 @@ var require_foldingRange = __commonJS({
13779
13779
  var vscode_languageserver_protocol_1 = require_main3();
13780
13780
  var features_1 = require_features();
13781
13781
  var FoldingRangeFeature = class extends features_1.TextDocumentLanguageFeature {
13782
- constructor(client2) {
13783
- super(client2, vscode_languageserver_protocol_1.FoldingRangeRequest.type);
13782
+ constructor(client) {
13783
+ super(client, vscode_languageserver_protocol_1.FoldingRangeRequest.type);
13784
13784
  }
13785
13785
  fillClientCapabilities(capabilities) {
13786
13786
  let capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "foldingRange");
@@ -13809,21 +13809,21 @@ var require_foldingRange = __commonJS({
13809
13809
  const provider = {
13810
13810
  onDidChangeFoldingRanges: eventEmitter.event,
13811
13811
  provideFoldingRanges: (document, context, token) => {
13812
- const client2 = this._client;
13812
+ const client = this._client;
13813
13813
  const provideFoldingRanges = (document2, _, token2) => {
13814
13814
  const requestParams = {
13815
- textDocument: client2.code2ProtocolConverter.asTextDocumentIdentifier(document2)
13815
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document2)
13816
13816
  };
13817
- return client2.sendRequest(vscode_languageserver_protocol_1.FoldingRangeRequest.type, requestParams, token2).then((result) => {
13817
+ return client.sendRequest(vscode_languageserver_protocol_1.FoldingRangeRequest.type, requestParams, token2).then((result) => {
13818
13818
  if (token2.isCancellationRequested) {
13819
13819
  return null;
13820
13820
  }
13821
- return client2.protocol2CodeConverter.asFoldingRanges(result, token2);
13821
+ return client.protocol2CodeConverter.asFoldingRanges(result, token2);
13822
13822
  }, (error) => {
13823
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.FoldingRangeRequest.type, token2, error, null);
13823
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.FoldingRangeRequest.type, token2, error, null);
13824
13824
  });
13825
13825
  };
13826
- const middleware = client2.middleware;
13826
+ const middleware = client.middleware;
13827
13827
  return middleware.provideFoldingRanges ? middleware.provideFoldingRanges(document, context, token, provideFoldingRanges) : provideFoldingRanges(document, context, token);
13828
13828
  }
13829
13829
  };
@@ -13844,8 +13844,8 @@ var require_declaration = __commonJS({
13844
13844
  var vscode_languageserver_protocol_1 = require_main3();
13845
13845
  var features_1 = require_features();
13846
13846
  var DeclarationFeature = class extends features_1.TextDocumentLanguageFeature {
13847
- constructor(client2) {
13848
- super(client2, vscode_languageserver_protocol_1.DeclarationRequest.type);
13847
+ constructor(client) {
13848
+ super(client, vscode_languageserver_protocol_1.DeclarationRequest.type);
13849
13849
  }
13850
13850
  fillClientCapabilities(capabilities) {
13851
13851
  const declarationSupport = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "declaration");
@@ -13863,18 +13863,18 @@ var require_declaration = __commonJS({
13863
13863
  const selector = options.documentSelector;
13864
13864
  const provider = {
13865
13865
  provideDeclaration: (document, position, token) => {
13866
- const client2 = this._client;
13866
+ const client = this._client;
13867
13867
  const provideDeclaration = (document2, position2, token2) => {
13868
- return client2.sendRequest(vscode_languageserver_protocol_1.DeclarationRequest.type, client2.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2), token2).then((result) => {
13868
+ return client.sendRequest(vscode_languageserver_protocol_1.DeclarationRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2), token2).then((result) => {
13869
13869
  if (token2.isCancellationRequested) {
13870
13870
  return null;
13871
13871
  }
13872
- return client2.protocol2CodeConverter.asDeclarationResult(result, token2);
13872
+ return client.protocol2CodeConverter.asDeclarationResult(result, token2);
13873
13873
  }, (error) => {
13874
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.DeclarationRequest.type, token2, error, null);
13874
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.DeclarationRequest.type, token2, error, null);
13875
13875
  });
13876
13876
  };
13877
- const middleware = client2.middleware;
13877
+ const middleware = client.middleware;
13878
13878
  return middleware.provideDeclaration ? middleware.provideDeclaration(document, position, token, provideDeclaration) : provideDeclaration(document, position, token);
13879
13879
  }
13880
13880
  };
@@ -13898,8 +13898,8 @@ var require_selectionRange = __commonJS({
13898
13898
  var vscode_languageserver_protocol_1 = require_main3();
13899
13899
  var features_1 = require_features();
13900
13900
  var SelectionRangeFeature = class extends features_1.TextDocumentLanguageFeature {
13901
- constructor(client2) {
13902
- super(client2, vscode_languageserver_protocol_1.SelectionRangeRequest.type);
13901
+ constructor(client) {
13902
+ super(client, vscode_languageserver_protocol_1.SelectionRangeRequest.type);
13903
13903
  }
13904
13904
  fillClientCapabilities(capabilities) {
13905
13905
  const capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "selectionRange");
@@ -13916,22 +13916,22 @@ var require_selectionRange = __commonJS({
13916
13916
  const selector = options.documentSelector;
13917
13917
  const provider = {
13918
13918
  provideSelectionRanges: (document, positions, token) => {
13919
- const client2 = this._client;
13919
+ const client = this._client;
13920
13920
  const provideSelectionRanges = async (document2, positions2, token2) => {
13921
13921
  const requestParams = {
13922
- textDocument: client2.code2ProtocolConverter.asTextDocumentIdentifier(document2),
13923
- positions: client2.code2ProtocolConverter.asPositionsSync(positions2, token2)
13922
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document2),
13923
+ positions: client.code2ProtocolConverter.asPositionsSync(positions2, token2)
13924
13924
  };
13925
- return client2.sendRequest(vscode_languageserver_protocol_1.SelectionRangeRequest.type, requestParams, token2).then((ranges) => {
13925
+ return client.sendRequest(vscode_languageserver_protocol_1.SelectionRangeRequest.type, requestParams, token2).then((ranges) => {
13926
13926
  if (token2.isCancellationRequested) {
13927
13927
  return null;
13928
13928
  }
13929
- return client2.protocol2CodeConverter.asSelectionRanges(ranges, token2);
13929
+ return client.protocol2CodeConverter.asSelectionRanges(ranges, token2);
13930
13930
  }, (error) => {
13931
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.SelectionRangeRequest.type, token2, error, null);
13931
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.SelectionRangeRequest.type, token2, error, null);
13932
13932
  });
13933
13933
  };
13934
- const middleware = client2.middleware;
13934
+ const middleware = client.middleware;
13935
13935
  return middleware.provideSelectionRanges ? middleware.provideSelectionRanges(document, positions, token, provideSelectionRanges) : provideSelectionRanges(document, positions, token);
13936
13936
  }
13937
13937
  };
@@ -13971,14 +13971,14 @@ var require_progress = __commonJS({
13971
13971
  ensure(capabilities, "window").workDoneProgress = true;
13972
13972
  }
13973
13973
  initialize() {
13974
- const client2 = this._client;
13974
+ const client = this._client;
13975
13975
  const deleteHandler = (part) => {
13976
13976
  this.activeParts.delete(part);
13977
13977
  };
13978
13978
  const createHandler = (params) => {
13979
13979
  this.activeParts.add(new progressPart_1.ProgressPart(this._client, params.token, deleteHandler));
13980
13980
  };
13981
- client2.onRequest(vscode_languageserver_protocol_1.WorkDoneProgressCreateRequest.type, createHandler);
13981
+ client.onRequest(vscode_languageserver_protocol_1.WorkDoneProgressCreateRequest.type, createHandler);
13982
13982
  }
13983
13983
  clear() {
13984
13984
  for (const part of this.activeParts) {
@@ -14001,66 +14001,66 @@ var require_callHierarchy = __commonJS({
14001
14001
  var vscode_languageserver_protocol_1 = require_main3();
14002
14002
  var features_1 = require_features();
14003
14003
  var CallHierarchyProvider = class {
14004
- constructor(client2) {
14005
- this.client = client2;
14006
- this.middleware = client2.middleware;
14004
+ constructor(client) {
14005
+ this.client = client;
14006
+ this.middleware = client.middleware;
14007
14007
  }
14008
14008
  prepareCallHierarchy(document, position, token) {
14009
- const client2 = this.client;
14009
+ const client = this.client;
14010
14010
  const middleware = this.middleware;
14011
14011
  const prepareCallHierarchy = (document2, position2, token2) => {
14012
- const params = client2.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2);
14013
- return client2.sendRequest(vscode_languageserver_protocol_1.CallHierarchyPrepareRequest.type, params, token2).then((result) => {
14012
+ const params = client.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2);
14013
+ return client.sendRequest(vscode_languageserver_protocol_1.CallHierarchyPrepareRequest.type, params, token2).then((result) => {
14014
14014
  if (token2.isCancellationRequested) {
14015
14015
  return null;
14016
14016
  }
14017
- return client2.protocol2CodeConverter.asCallHierarchyItems(result, token2);
14017
+ return client.protocol2CodeConverter.asCallHierarchyItems(result, token2);
14018
14018
  }, (error) => {
14019
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyPrepareRequest.type, token2, error, null);
14019
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyPrepareRequest.type, token2, error, null);
14020
14020
  });
14021
14021
  };
14022
14022
  return middleware.prepareCallHierarchy ? middleware.prepareCallHierarchy(document, position, token, prepareCallHierarchy) : prepareCallHierarchy(document, position, token);
14023
14023
  }
14024
14024
  provideCallHierarchyIncomingCalls(item, token) {
14025
- const client2 = this.client;
14025
+ const client = this.client;
14026
14026
  const middleware = this.middleware;
14027
14027
  const provideCallHierarchyIncomingCalls = (item2, token2) => {
14028
14028
  const params = {
14029
- item: client2.code2ProtocolConverter.asCallHierarchyItem(item2)
14029
+ item: client.code2ProtocolConverter.asCallHierarchyItem(item2)
14030
14030
  };
14031
- return client2.sendRequest(vscode_languageserver_protocol_1.CallHierarchyIncomingCallsRequest.type, params, token2).then((result) => {
14031
+ return client.sendRequest(vscode_languageserver_protocol_1.CallHierarchyIncomingCallsRequest.type, params, token2).then((result) => {
14032
14032
  if (token2.isCancellationRequested) {
14033
14033
  return null;
14034
14034
  }
14035
- return client2.protocol2CodeConverter.asCallHierarchyIncomingCalls(result, token2);
14035
+ return client.protocol2CodeConverter.asCallHierarchyIncomingCalls(result, token2);
14036
14036
  }, (error) => {
14037
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyIncomingCallsRequest.type, token2, error, null);
14037
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyIncomingCallsRequest.type, token2, error, null);
14038
14038
  });
14039
14039
  };
14040
14040
  return middleware.provideCallHierarchyIncomingCalls ? middleware.provideCallHierarchyIncomingCalls(item, token, provideCallHierarchyIncomingCalls) : provideCallHierarchyIncomingCalls(item, token);
14041
14041
  }
14042
14042
  provideCallHierarchyOutgoingCalls(item, token) {
14043
- const client2 = this.client;
14043
+ const client = this.client;
14044
14044
  const middleware = this.middleware;
14045
14045
  const provideCallHierarchyOutgoingCalls = (item2, token2) => {
14046
14046
  const params = {
14047
- item: client2.code2ProtocolConverter.asCallHierarchyItem(item2)
14047
+ item: client.code2ProtocolConverter.asCallHierarchyItem(item2)
14048
14048
  };
14049
- return client2.sendRequest(vscode_languageserver_protocol_1.CallHierarchyOutgoingCallsRequest.type, params, token2).then((result) => {
14049
+ return client.sendRequest(vscode_languageserver_protocol_1.CallHierarchyOutgoingCallsRequest.type, params, token2).then((result) => {
14050
14050
  if (token2.isCancellationRequested) {
14051
14051
  return null;
14052
14052
  }
14053
- return client2.protocol2CodeConverter.asCallHierarchyOutgoingCalls(result, token2);
14053
+ return client.protocol2CodeConverter.asCallHierarchyOutgoingCalls(result, token2);
14054
14054
  }, (error) => {
14055
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyOutgoingCallsRequest.type, token2, error, null);
14055
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.CallHierarchyOutgoingCallsRequest.type, token2, error, null);
14056
14056
  });
14057
14057
  };
14058
14058
  return middleware.provideCallHierarchyOutgoingCalls ? middleware.provideCallHierarchyOutgoingCalls(item, token, provideCallHierarchyOutgoingCalls) : provideCallHierarchyOutgoingCalls(item, token);
14059
14059
  }
14060
14060
  };
14061
14061
  var CallHierarchyFeature = class extends features_1.TextDocumentLanguageFeature {
14062
- constructor(client2) {
14063
- super(client2, vscode_languageserver_protocol_1.CallHierarchyPrepareRequest.type);
14062
+ constructor(client) {
14063
+ super(client, vscode_languageserver_protocol_1.CallHierarchyPrepareRequest.type);
14064
14064
  }
14065
14065
  fillClientCapabilities(cap) {
14066
14066
  const capabilities = cap;
@@ -14075,8 +14075,8 @@ var require_callHierarchy = __commonJS({
14075
14075
  this.register({ id, registerOptions: options });
14076
14076
  }
14077
14077
  registerLanguageProvider(options) {
14078
- const client2 = this._client;
14079
- const provider = new CallHierarchyProvider(client2);
14078
+ const client = this._client;
14079
+ const provider = new CallHierarchyProvider(client);
14080
14080
  return [vscode_1.languages.registerCallHierarchyProvider(this._client.protocol2CodeConverter.asDocumentSelector(options.documentSelector), provider), provider];
14081
14081
  }
14082
14082
  };
@@ -14095,8 +14095,8 @@ var require_semanticTokens = __commonJS({
14095
14095
  var features_1 = require_features();
14096
14096
  var Is = require_is();
14097
14097
  var SemanticTokensFeature = class extends features_1.TextDocumentLanguageFeature {
14098
- constructor(client2) {
14099
- super(client2, vscode_languageserver_protocol_1.SemanticTokensRegistrationType.type);
14098
+ constructor(client) {
14099
+ super(client, vscode_languageserver_protocol_1.SemanticTokensRegistrationType.type);
14100
14100
  }
14101
14101
  fillClientCapabilities(capabilities) {
14102
14102
  const capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "semanticTokens");
@@ -14152,8 +14152,8 @@ var require_semanticTokens = __commonJS({
14152
14152
  (0, features_1.ensure)((0, features_1.ensure)(capabilities, "workspace"), "semanticTokens").refreshSupport = true;
14153
14153
  }
14154
14154
  initialize(capabilities, documentSelector) {
14155
- const client2 = this._client;
14156
- client2.onRequest(vscode_languageserver_protocol_1.SemanticTokensRefreshRequest.type, async () => {
14155
+ const client = this._client;
14156
+ client.onRequest(vscode_languageserver_protocol_1.SemanticTokensRefreshRequest.type, async () => {
14157
14157
  for (const provider of this.getAllProviders()) {
14158
14158
  provider.onDidChangeSemanticTokensEmitter.fire();
14159
14159
  }
@@ -14172,42 +14172,42 @@ var require_semanticTokens = __commonJS({
14172
14172
  const documentProvider = fullProvider ? {
14173
14173
  onDidChangeSemanticTokens: eventEmitter.event,
14174
14174
  provideDocumentSemanticTokens: (document, token) => {
14175
- const client3 = this._client;
14176
- const middleware = client3.middleware;
14175
+ const client2 = this._client;
14176
+ const middleware = client2.middleware;
14177
14177
  const provideDocumentSemanticTokens = (document2, token2) => {
14178
14178
  const params = {
14179
- textDocument: client3.code2ProtocolConverter.asTextDocumentIdentifier(document2)
14179
+ textDocument: client2.code2ProtocolConverter.asTextDocumentIdentifier(document2)
14180
14180
  };
14181
- return client3.sendRequest(vscode_languageserver_protocol_1.SemanticTokensRequest.type, params, token2).then((result) => {
14181
+ return client2.sendRequest(vscode_languageserver_protocol_1.SemanticTokensRequest.type, params, token2).then((result) => {
14182
14182
  if (token2.isCancellationRequested) {
14183
14183
  return null;
14184
14184
  }
14185
- return client3.protocol2CodeConverter.asSemanticTokens(result, token2);
14185
+ return client2.protocol2CodeConverter.asSemanticTokens(result, token2);
14186
14186
  }, (error) => {
14187
- return client3.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensRequest.type, token2, error, null);
14187
+ return client2.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensRequest.type, token2, error, null);
14188
14188
  });
14189
14189
  };
14190
14190
  return middleware.provideDocumentSemanticTokens ? middleware.provideDocumentSemanticTokens(document, token, provideDocumentSemanticTokens) : provideDocumentSemanticTokens(document, token);
14191
14191
  },
14192
14192
  provideDocumentSemanticTokensEdits: hasEditProvider ? (document, previousResultId, token) => {
14193
- const client3 = this._client;
14194
- const middleware = client3.middleware;
14193
+ const client2 = this._client;
14194
+ const middleware = client2.middleware;
14195
14195
  const provideDocumentSemanticTokensEdits = (document2, previousResultId2, token2) => {
14196
14196
  const params = {
14197
- textDocument: client3.code2ProtocolConverter.asTextDocumentIdentifier(document2),
14197
+ textDocument: client2.code2ProtocolConverter.asTextDocumentIdentifier(document2),
14198
14198
  previousResultId: previousResultId2
14199
14199
  };
14200
- return client3.sendRequest(vscode_languageserver_protocol_1.SemanticTokensDeltaRequest.type, params, token2).then(async (result) => {
14200
+ return client2.sendRequest(vscode_languageserver_protocol_1.SemanticTokensDeltaRequest.type, params, token2).then(async (result) => {
14201
14201
  if (token2.isCancellationRequested) {
14202
14202
  return null;
14203
14203
  }
14204
14204
  if (vscode_languageserver_protocol_1.SemanticTokens.is(result)) {
14205
- return await client3.protocol2CodeConverter.asSemanticTokens(result, token2);
14205
+ return await client2.protocol2CodeConverter.asSemanticTokens(result, token2);
14206
14206
  } else {
14207
- return await client3.protocol2CodeConverter.asSemanticTokensEdits(result, token2);
14207
+ return await client2.protocol2CodeConverter.asSemanticTokensEdits(result, token2);
14208
14208
  }
14209
14209
  }, (error) => {
14210
- return client3.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensDeltaRequest.type, token2, error, null);
14210
+ return client2.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensDeltaRequest.type, token2, error, null);
14211
14211
  });
14212
14212
  };
14213
14213
  return middleware.provideDocumentSemanticTokensEdits ? middleware.provideDocumentSemanticTokensEdits(document, previousResultId, token, provideDocumentSemanticTokensEdits) : provideDocumentSemanticTokensEdits(document, previousResultId, token);
@@ -14216,29 +14216,29 @@ var require_semanticTokens = __commonJS({
14216
14216
  const hasRangeProvider = options.range === true;
14217
14217
  const rangeProvider = hasRangeProvider ? {
14218
14218
  provideDocumentRangeSemanticTokens: (document, range, token) => {
14219
- const client3 = this._client;
14220
- const middleware = client3.middleware;
14219
+ const client2 = this._client;
14220
+ const middleware = client2.middleware;
14221
14221
  const provideDocumentRangeSemanticTokens = (document2, range2, token2) => {
14222
14222
  const params = {
14223
- textDocument: client3.code2ProtocolConverter.asTextDocumentIdentifier(document2),
14224
- range: client3.code2ProtocolConverter.asRange(range2)
14223
+ textDocument: client2.code2ProtocolConverter.asTextDocumentIdentifier(document2),
14224
+ range: client2.code2ProtocolConverter.asRange(range2)
14225
14225
  };
14226
- return client3.sendRequest(vscode_languageserver_protocol_1.SemanticTokensRangeRequest.type, params, token2).then((result) => {
14226
+ return client2.sendRequest(vscode_languageserver_protocol_1.SemanticTokensRangeRequest.type, params, token2).then((result) => {
14227
14227
  if (token2.isCancellationRequested) {
14228
14228
  return null;
14229
14229
  }
14230
- return client3.protocol2CodeConverter.asSemanticTokens(result, token2);
14230
+ return client2.protocol2CodeConverter.asSemanticTokens(result, token2);
14231
14231
  }, (error) => {
14232
- return client3.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensRangeRequest.type, token2, error, null);
14232
+ return client2.handleFailedRequest(vscode_languageserver_protocol_1.SemanticTokensRangeRequest.type, token2, error, null);
14233
14233
  });
14234
14234
  };
14235
14235
  return middleware.provideDocumentRangeSemanticTokens ? middleware.provideDocumentRangeSemanticTokens(document, range, token, provideDocumentRangeSemanticTokens) : provideDocumentRangeSemanticTokens(document, range, token);
14236
14236
  }
14237
14237
  } : void 0;
14238
14238
  const disposables = [];
14239
- const client2 = this._client;
14240
- const legend = client2.protocol2CodeConverter.asSemanticTokensLegend(options.legend);
14241
- const documentSelector = client2.protocol2CodeConverter.asDocumentSelector(selector);
14239
+ const client = this._client;
14240
+ const legend = client.protocol2CodeConverter.asSemanticTokensLegend(options.legend);
14241
+ const documentSelector = client.protocol2CodeConverter.asDocumentSelector(selector);
14242
14242
  if (documentProvider !== void 0) {
14243
14243
  disposables.push(vscode.languages.registerDocumentSemanticTokensProvider(documentSelector, documentProvider, legend));
14244
14244
  }
@@ -14275,8 +14275,8 @@ var require_fileOperations = __commonJS({
14275
14275
  target[key] = value;
14276
14276
  }
14277
14277
  var FileOperationFeature = class _FileOperationFeature {
14278
- constructor(client2, event, registrationType, clientCapability, serverCapability) {
14279
- this._client = client2;
14278
+ constructor(client, event, registrationType, clientCapability, serverCapability) {
14279
+ this._client = client;
14280
14280
  this._event = event;
14281
14281
  this._registrationType = registrationType;
14282
14282
  this._clientCapability = clientCapability;
@@ -14344,13 +14344,13 @@ var require_fileOperations = __commonJS({
14344
14344
  async filter(event, prop) {
14345
14345
  const fileMatches = await Promise.all(event.files.map(async (item) => {
14346
14346
  const uri = prop(item);
14347
- const path2 = uri.fsPath.replace(/\\/g, "/");
14347
+ const path3 = uri.fsPath.replace(/\\/g, "/");
14348
14348
  for (const filters of this._filters.values()) {
14349
14349
  for (const filter of filters) {
14350
14350
  if (filter.scheme !== void 0 && filter.scheme !== uri.scheme) {
14351
14351
  continue;
14352
14352
  }
14353
- if (filter.matcher.match(path2)) {
14353
+ if (filter.matcher.match(path3)) {
14354
14354
  if (filter.kind === void 0) {
14355
14355
  return true;
14356
14356
  }
@@ -14364,7 +14364,7 @@ var require_fileOperations = __commonJS({
14364
14364
  }
14365
14365
  } else if (filter.kind === proto.FileOperationPatternKind.folder) {
14366
14366
  const fileType = await _FileOperationFeature.getFileType(uri);
14367
- if (fileType === code.FileType.Directory && filter.matcher.match(`${path2}/`)) {
14367
+ if (fileType === code.FileType.Directory && filter.matcher.match(`${path3}/`)) {
14368
14368
  return true;
14369
14369
  }
14370
14370
  }
@@ -14391,8 +14391,8 @@ var require_fileOperations = __commonJS({
14391
14391
  }
14392
14392
  };
14393
14393
  var NotificationFileOperationFeature = class extends FileOperationFeature {
14394
- constructor(client2, event, notificationType, clientCapability, serverCapability, accessUri, createParams) {
14395
- super(client2, event, notificationType, clientCapability, serverCapability);
14394
+ constructor(client, event, notificationType, clientCapability, serverCapability, accessUri, createParams) {
14395
+ super(client, event, notificationType, clientCapability, serverCapability);
14396
14396
  this._notificationType = notificationType;
14397
14397
  this._accessUri = accessUri;
14398
14398
  this._createParams = createParams;
@@ -14445,8 +14445,8 @@ var require_fileOperations = __commonJS({
14445
14445
  }
14446
14446
  };
14447
14447
  var DidCreateFilesFeature = class extends NotificationFileOperationFeature {
14448
- constructor(client2) {
14449
- super(client2, code.workspace.onDidCreateFiles, proto.DidCreateFilesNotification.type, "didCreate", "didCreate", (i) => i, client2.code2ProtocolConverter.asDidCreateFilesParams);
14448
+ constructor(client) {
14449
+ super(client, code.workspace.onDidCreateFiles, proto.DidCreateFilesNotification.type, "didCreate", "didCreate", (i) => i, client.code2ProtocolConverter.asDidCreateFilesParams);
14450
14450
  }
14451
14451
  doSend(event, next) {
14452
14452
  const middleware = this._client.middleware.workspace;
@@ -14455,8 +14455,8 @@ var require_fileOperations = __commonJS({
14455
14455
  };
14456
14456
  exports2.DidCreateFilesFeature = DidCreateFilesFeature;
14457
14457
  var DidRenameFilesFeature = class extends CachingNotificationFileOperationFeature {
14458
- constructor(client2) {
14459
- super(client2, code.workspace.onDidRenameFiles, proto.DidRenameFilesNotification.type, "didRename", "didRename", (i) => i.oldUri, client2.code2ProtocolConverter.asDidRenameFilesParams);
14458
+ constructor(client) {
14459
+ super(client, code.workspace.onDidRenameFiles, proto.DidRenameFilesNotification.type, "didRename", "didRename", (i) => i.oldUri, client.code2ProtocolConverter.asDidRenameFilesParams);
14460
14460
  }
14461
14461
  register(data) {
14462
14462
  if (!this._willListener) {
@@ -14475,8 +14475,8 @@ var require_fileOperations = __commonJS({
14475
14475
  };
14476
14476
  exports2.DidRenameFilesFeature = DidRenameFilesFeature;
14477
14477
  var DidDeleteFilesFeature = class extends CachingNotificationFileOperationFeature {
14478
- constructor(client2) {
14479
- super(client2, code.workspace.onDidDeleteFiles, proto.DidDeleteFilesNotification.type, "didDelete", "didDelete", (i) => i, client2.code2ProtocolConverter.asDidDeleteFilesParams);
14478
+ constructor(client) {
14479
+ super(client, code.workspace.onDidDeleteFiles, proto.DidDeleteFilesNotification.type, "didDelete", "didDelete", (i) => i, client.code2ProtocolConverter.asDidDeleteFilesParams);
14480
14480
  }
14481
14481
  register(data) {
14482
14482
  if (!this._willListener) {
@@ -14495,8 +14495,8 @@ var require_fileOperations = __commonJS({
14495
14495
  };
14496
14496
  exports2.DidDeleteFilesFeature = DidDeleteFilesFeature;
14497
14497
  var RequestFileOperationFeature = class extends FileOperationFeature {
14498
- constructor(client2, event, requestType, clientCapability, serverCapability, accessUri, createParams) {
14499
- super(client2, event, requestType, clientCapability, serverCapability);
14498
+ constructor(client, event, requestType, clientCapability, serverCapability, accessUri, createParams) {
14499
+ super(client, event, requestType, clientCapability, serverCapability);
14500
14500
  this._requestType = requestType;
14501
14501
  this._accessUri = accessUri;
14502
14502
  this._createParams = createParams;
@@ -14518,8 +14518,8 @@ var require_fileOperations = __commonJS({
14518
14518
  }
14519
14519
  };
14520
14520
  var WillCreateFilesFeature = class extends RequestFileOperationFeature {
14521
- constructor(client2) {
14522
- super(client2, code.workspace.onWillCreateFiles, proto.WillCreateFilesRequest.type, "willCreate", "willCreate", (i) => i, client2.code2ProtocolConverter.asWillCreateFilesParams);
14521
+ constructor(client) {
14522
+ super(client, code.workspace.onWillCreateFiles, proto.WillCreateFilesRequest.type, "willCreate", "willCreate", (i) => i, client.code2ProtocolConverter.asWillCreateFilesParams);
14523
14523
  }
14524
14524
  doSend(event, next) {
14525
14525
  const middleware = this._client.middleware.workspace;
@@ -14528,8 +14528,8 @@ var require_fileOperations = __commonJS({
14528
14528
  };
14529
14529
  exports2.WillCreateFilesFeature = WillCreateFilesFeature;
14530
14530
  var WillRenameFilesFeature = class extends RequestFileOperationFeature {
14531
- constructor(client2) {
14532
- super(client2, code.workspace.onWillRenameFiles, proto.WillRenameFilesRequest.type, "willRename", "willRename", (i) => i.oldUri, client2.code2ProtocolConverter.asWillRenameFilesParams);
14531
+ constructor(client) {
14532
+ super(client, code.workspace.onWillRenameFiles, proto.WillRenameFilesRequest.type, "willRename", "willRename", (i) => i.oldUri, client.code2ProtocolConverter.asWillRenameFilesParams);
14533
14533
  }
14534
14534
  doSend(event, next) {
14535
14535
  const middleware = this._client.middleware.workspace;
@@ -14538,8 +14538,8 @@ var require_fileOperations = __commonJS({
14538
14538
  };
14539
14539
  exports2.WillRenameFilesFeature = WillRenameFilesFeature;
14540
14540
  var WillDeleteFilesFeature = class extends RequestFileOperationFeature {
14541
- constructor(client2) {
14542
- super(client2, code.workspace.onWillDeleteFiles, proto.WillDeleteFilesRequest.type, "willDelete", "willDelete", (i) => i, client2.code2ProtocolConverter.asWillDeleteFilesParams);
14541
+ constructor(client) {
14542
+ super(client, code.workspace.onWillDeleteFiles, proto.WillDeleteFilesRequest.type, "willDelete", "willDelete", (i) => i, client.code2ProtocolConverter.asWillDeleteFilesParams);
14543
14543
  }
14544
14544
  doSend(event, next) {
14545
14545
  const middleware = this._client.middleware.workspace;
@@ -14560,8 +14560,8 @@ var require_linkedEditingRange = __commonJS({
14560
14560
  var proto = require_main3();
14561
14561
  var features_1 = require_features();
14562
14562
  var LinkedEditingFeature = class extends features_1.TextDocumentLanguageFeature {
14563
- constructor(client2) {
14564
- super(client2, proto.LinkedEditingRangeRequest.type);
14563
+ constructor(client) {
14564
+ super(client, proto.LinkedEditingRangeRequest.type);
14565
14565
  }
14566
14566
  fillClientCapabilities(capabilities) {
14567
14567
  const linkedEditingSupport = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "linkedEditingRange");
@@ -14578,18 +14578,18 @@ var require_linkedEditingRange = __commonJS({
14578
14578
  const selector = options.documentSelector;
14579
14579
  const provider = {
14580
14580
  provideLinkedEditingRanges: (document, position, token) => {
14581
- const client2 = this._client;
14581
+ const client = this._client;
14582
14582
  const provideLinkedEditing = (document2, position2, token2) => {
14583
- return client2.sendRequest(proto.LinkedEditingRangeRequest.type, client2.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2), token2).then((result) => {
14583
+ return client.sendRequest(proto.LinkedEditingRangeRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2), token2).then((result) => {
14584
14584
  if (token2.isCancellationRequested) {
14585
14585
  return null;
14586
14586
  }
14587
- return client2.protocol2CodeConverter.asLinkedEditingRanges(result, token2);
14587
+ return client.protocol2CodeConverter.asLinkedEditingRanges(result, token2);
14588
14588
  }, (error) => {
14589
- return client2.handleFailedRequest(proto.LinkedEditingRangeRequest.type, token2, error, null);
14589
+ return client.handleFailedRequest(proto.LinkedEditingRangeRequest.type, token2, error, null);
14590
14590
  });
14591
14591
  };
14592
- const middleware = client2.middleware;
14592
+ const middleware = client.middleware;
14593
14593
  return middleware.provideLinkedEditingRange ? middleware.provideLinkedEditingRange(document, position, token, provideLinkedEditing) : provideLinkedEditing(document, position, token);
14594
14594
  }
14595
14595
  };
@@ -14613,66 +14613,66 @@ var require_typeHierarchy = __commonJS({
14613
14613
  var vscode_languageserver_protocol_1 = require_main3();
14614
14614
  var features_1 = require_features();
14615
14615
  var TypeHierarchyProvider = class {
14616
- constructor(client2) {
14617
- this.client = client2;
14618
- this.middleware = client2.middleware;
14616
+ constructor(client) {
14617
+ this.client = client;
14618
+ this.middleware = client.middleware;
14619
14619
  }
14620
14620
  prepareTypeHierarchy(document, position, token) {
14621
- const client2 = this.client;
14621
+ const client = this.client;
14622
14622
  const middleware = this.middleware;
14623
14623
  const prepareTypeHierarchy = (document2, position2, token2) => {
14624
- const params = client2.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2);
14625
- return client2.sendRequest(vscode_languageserver_protocol_1.TypeHierarchyPrepareRequest.type, params, token2).then((result) => {
14624
+ const params = client.code2ProtocolConverter.asTextDocumentPositionParams(document2, position2);
14625
+ return client.sendRequest(vscode_languageserver_protocol_1.TypeHierarchyPrepareRequest.type, params, token2).then((result) => {
14626
14626
  if (token2.isCancellationRequested) {
14627
14627
  return null;
14628
14628
  }
14629
- return client2.protocol2CodeConverter.asTypeHierarchyItems(result, token2);
14629
+ return client.protocol2CodeConverter.asTypeHierarchyItems(result, token2);
14630
14630
  }, (error) => {
14631
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.TypeHierarchyPrepareRequest.type, token2, error, null);
14631
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.TypeHierarchyPrepareRequest.type, token2, error, null);
14632
14632
  });
14633
14633
  };
14634
14634
  return middleware.prepareTypeHierarchy ? middleware.prepareTypeHierarchy(document, position, token, prepareTypeHierarchy) : prepareTypeHierarchy(document, position, token);
14635
14635
  }
14636
14636
  provideTypeHierarchySupertypes(item, token) {
14637
- const client2 = this.client;
14637
+ const client = this.client;
14638
14638
  const middleware = this.middleware;
14639
14639
  const provideTypeHierarchySupertypes = (item2, token2) => {
14640
14640
  const params = {
14641
- item: client2.code2ProtocolConverter.asTypeHierarchyItem(item2)
14641
+ item: client.code2ProtocolConverter.asTypeHierarchyItem(item2)
14642
14642
  };
14643
- return client2.sendRequest(vscode_languageserver_protocol_1.TypeHierarchySupertypesRequest.type, params, token2).then((result) => {
14643
+ return client.sendRequest(vscode_languageserver_protocol_1.TypeHierarchySupertypesRequest.type, params, token2).then((result) => {
14644
14644
  if (token2.isCancellationRequested) {
14645
14645
  return null;
14646
14646
  }
14647
- return client2.protocol2CodeConverter.asTypeHierarchyItems(result, token2);
14647
+ return client.protocol2CodeConverter.asTypeHierarchyItems(result, token2);
14648
14648
  }, (error) => {
14649
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.TypeHierarchySupertypesRequest.type, token2, error, null);
14649
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.TypeHierarchySupertypesRequest.type, token2, error, null);
14650
14650
  });
14651
14651
  };
14652
14652
  return middleware.provideTypeHierarchySupertypes ? middleware.provideTypeHierarchySupertypes(item, token, provideTypeHierarchySupertypes) : provideTypeHierarchySupertypes(item, token);
14653
14653
  }
14654
14654
  provideTypeHierarchySubtypes(item, token) {
14655
- const client2 = this.client;
14655
+ const client = this.client;
14656
14656
  const middleware = this.middleware;
14657
14657
  const provideTypeHierarchySubtypes = (item2, token2) => {
14658
14658
  const params = {
14659
- item: client2.code2ProtocolConverter.asTypeHierarchyItem(item2)
14659
+ item: client.code2ProtocolConverter.asTypeHierarchyItem(item2)
14660
14660
  };
14661
- return client2.sendRequest(vscode_languageserver_protocol_1.TypeHierarchySubtypesRequest.type, params, token2).then((result) => {
14661
+ return client.sendRequest(vscode_languageserver_protocol_1.TypeHierarchySubtypesRequest.type, params, token2).then((result) => {
14662
14662
  if (token2.isCancellationRequested) {
14663
14663
  return null;
14664
14664
  }
14665
- return client2.protocol2CodeConverter.asTypeHierarchyItems(result, token2);
14665
+ return client.protocol2CodeConverter.asTypeHierarchyItems(result, token2);
14666
14666
  }, (error) => {
14667
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.TypeHierarchySubtypesRequest.type, token2, error, null);
14667
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.TypeHierarchySubtypesRequest.type, token2, error, null);
14668
14668
  });
14669
14669
  };
14670
14670
  return middleware.provideTypeHierarchySubtypes ? middleware.provideTypeHierarchySubtypes(item, token, provideTypeHierarchySubtypes) : provideTypeHierarchySubtypes(item, token);
14671
14671
  }
14672
14672
  };
14673
14673
  var TypeHierarchyFeature = class extends features_1.TextDocumentLanguageFeature {
14674
- constructor(client2) {
14675
- super(client2, vscode_languageserver_protocol_1.TypeHierarchyPrepareRequest.type);
14674
+ constructor(client) {
14675
+ super(client, vscode_languageserver_protocol_1.TypeHierarchyPrepareRequest.type);
14676
14676
  }
14677
14677
  fillClientCapabilities(capabilities) {
14678
14678
  const capability = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "typeHierarchy");
@@ -14686,9 +14686,9 @@ var require_typeHierarchy = __commonJS({
14686
14686
  this.register({ id, registerOptions: options });
14687
14687
  }
14688
14688
  registerLanguageProvider(options) {
14689
- const client2 = this._client;
14690
- const provider = new TypeHierarchyProvider(client2);
14691
- return [vscode_1.languages.registerTypeHierarchyProvider(client2.protocol2CodeConverter.asDocumentSelector(options.documentSelector), provider), provider];
14689
+ const client = this._client;
14690
+ const provider = new TypeHierarchyProvider(client);
14691
+ return [vscode_1.languages.registerTypeHierarchyProvider(client.protocol2CodeConverter.asDocumentSelector(options.documentSelector), provider), provider];
14692
14692
  }
14693
14693
  };
14694
14694
  exports2.TypeHierarchyFeature = TypeHierarchyFeature;
@@ -14705,8 +14705,8 @@ var require_inlineValue = __commonJS({
14705
14705
  var vscode_languageserver_protocol_1 = require_main3();
14706
14706
  var features_1 = require_features();
14707
14707
  var InlineValueFeature = class extends features_1.TextDocumentLanguageFeature {
14708
- constructor(client2) {
14709
- super(client2, vscode_languageserver_protocol_1.InlineValueRequest.type);
14708
+ constructor(client) {
14709
+ super(client, vscode_languageserver_protocol_1.InlineValueRequest.type);
14710
14710
  }
14711
14711
  fillClientCapabilities(capabilities) {
14712
14712
  (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "inlineValue").dynamicRegistration = true;
@@ -14730,23 +14730,23 @@ var require_inlineValue = __commonJS({
14730
14730
  const provider = {
14731
14731
  onDidChangeInlineValues: eventEmitter.event,
14732
14732
  provideInlineValues: (document, viewPort, context, token) => {
14733
- const client2 = this._client;
14733
+ const client = this._client;
14734
14734
  const provideInlineValues = (document2, viewPort2, context2, token2) => {
14735
14735
  const requestParams = {
14736
- textDocument: client2.code2ProtocolConverter.asTextDocumentIdentifier(document2),
14737
- range: client2.code2ProtocolConverter.asRange(viewPort2),
14738
- context: client2.code2ProtocolConverter.asInlineValueContext(context2)
14736
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document2),
14737
+ range: client.code2ProtocolConverter.asRange(viewPort2),
14738
+ context: client.code2ProtocolConverter.asInlineValueContext(context2)
14739
14739
  };
14740
- return client2.sendRequest(vscode_languageserver_protocol_1.InlineValueRequest.type, requestParams, token2).then((values) => {
14740
+ return client.sendRequest(vscode_languageserver_protocol_1.InlineValueRequest.type, requestParams, token2).then((values) => {
14741
14741
  if (token2.isCancellationRequested) {
14742
14742
  return null;
14743
14743
  }
14744
- return client2.protocol2CodeConverter.asInlineValues(values, token2);
14744
+ return client.protocol2CodeConverter.asInlineValues(values, token2);
14745
14745
  }, (error) => {
14746
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.InlineValueRequest.type, token2, error, null);
14746
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.InlineValueRequest.type, token2, error, null);
14747
14747
  });
14748
14748
  };
14749
- const middleware = client2.middleware;
14749
+ const middleware = client.middleware;
14750
14750
  return middleware.provideInlineValues ? middleware.provideInlineValues(document, viewPort, context, token, provideInlineValues) : provideInlineValues(document, viewPort, context, token);
14751
14751
  }
14752
14752
  };
@@ -14770,8 +14770,8 @@ var require_inlayHint = __commonJS({
14770
14770
  var vscode_languageserver_protocol_1 = require_main3();
14771
14771
  var features_1 = require_features();
14772
14772
  var InlayHintsFeature = class extends features_1.TextDocumentLanguageFeature {
14773
- constructor(client2) {
14774
- super(client2, vscode_languageserver_protocol_1.InlayHintRequest.type);
14773
+ constructor(client) {
14774
+ super(client, vscode_languageserver_protocol_1.InlayHintRequest.type);
14775
14775
  }
14776
14776
  fillClientCapabilities(capabilities) {
14777
14777
  const inlayHint = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "inlayHint");
@@ -14799,41 +14799,41 @@ var require_inlayHint = __commonJS({
14799
14799
  const provider = {
14800
14800
  onDidChangeInlayHints: eventEmitter.event,
14801
14801
  provideInlayHints: (document, viewPort, token) => {
14802
- const client2 = this._client;
14802
+ const client = this._client;
14803
14803
  const provideInlayHints = async (document2, viewPort2, token2) => {
14804
14804
  const requestParams = {
14805
- textDocument: client2.code2ProtocolConverter.asTextDocumentIdentifier(document2),
14806
- range: client2.code2ProtocolConverter.asRange(viewPort2)
14805
+ textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document2),
14806
+ range: client.code2ProtocolConverter.asRange(viewPort2)
14807
14807
  };
14808
14808
  try {
14809
- const values = await client2.sendRequest(vscode_languageserver_protocol_1.InlayHintRequest.type, requestParams, token2);
14809
+ const values = await client.sendRequest(vscode_languageserver_protocol_1.InlayHintRequest.type, requestParams, token2);
14810
14810
  if (token2.isCancellationRequested) {
14811
14811
  return null;
14812
14812
  }
14813
- return client2.protocol2CodeConverter.asInlayHints(values, token2);
14813
+ return client.protocol2CodeConverter.asInlayHints(values, token2);
14814
14814
  } catch (error) {
14815
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.InlayHintRequest.type, token2, error, null);
14815
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.InlayHintRequest.type, token2, error, null);
14816
14816
  }
14817
14817
  };
14818
- const middleware = client2.middleware;
14818
+ const middleware = client.middleware;
14819
14819
  return middleware.provideInlayHints ? middleware.provideInlayHints(document, viewPort, token, provideInlayHints) : provideInlayHints(document, viewPort, token);
14820
14820
  }
14821
14821
  };
14822
14822
  provider.resolveInlayHint = options.resolveProvider === true ? (hint, token) => {
14823
- const client2 = this._client;
14823
+ const client = this._client;
14824
14824
  const resolveInlayHint = async (item, token2) => {
14825
14825
  try {
14826
- const value = await client2.sendRequest(vscode_languageserver_protocol_1.InlayHintResolveRequest.type, client2.code2ProtocolConverter.asInlayHint(item), token2);
14826
+ const value = await client.sendRequest(vscode_languageserver_protocol_1.InlayHintResolveRequest.type, client.code2ProtocolConverter.asInlayHint(item), token2);
14827
14827
  if (token2.isCancellationRequested) {
14828
14828
  return null;
14829
14829
  }
14830
- const result = client2.protocol2CodeConverter.asInlayHint(value, token2);
14830
+ const result = client.protocol2CodeConverter.asInlayHint(value, token2);
14831
14831
  return token2.isCancellationRequested ? null : result;
14832
14832
  } catch (error) {
14833
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.InlayHintResolveRequest.type, token2, error, null);
14833
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.InlayHintResolveRequest.type, token2, error, null);
14834
14834
  }
14835
14835
  };
14836
- const middleware = client2.middleware;
14836
+ const middleware = client.middleware;
14837
14837
  return middleware.resolveInlayHint ? middleware.resolveInlayHint(hint, token, resolveInlayHint) : resolveInlayHint(hint, token);
14838
14838
  } : void 0;
14839
14839
  return [this.registerProvider(selector, provider), { provider, onDidChangeInlayHints: eventEmitter }];
@@ -14857,8 +14857,8 @@ var require_inlineCompletion = __commonJS({
14857
14857
  var features_1 = require_features();
14858
14858
  var UUID = require_uuid();
14859
14859
  var InlineCompletionItemFeature = class extends features_1.TextDocumentLanguageFeature {
14860
- constructor(client2) {
14861
- super(client2, vscode_languageserver_protocol_1.InlineCompletionRequest.type);
14860
+ constructor(client) {
14861
+ super(client, vscode_languageserver_protocol_1.InlineCompletionRequest.type);
14862
14862
  }
14863
14863
  fillClientCapabilities(capabilities) {
14864
14864
  let inlineCompletion = (0, features_1.ensure)((0, features_1.ensure)(capabilities, "textDocument"), "inlineCompletion");
@@ -14878,16 +14878,16 @@ var require_inlineCompletion = __commonJS({
14878
14878
  const selector = options.documentSelector;
14879
14879
  const provider = {
14880
14880
  provideInlineCompletionItems: (document, position, context, token) => {
14881
- const client2 = this._client;
14881
+ const client = this._client;
14882
14882
  const middleware = this._client.middleware;
14883
14883
  const provideInlineCompletionItems = (document2, position2, context2, token2) => {
14884
- return client2.sendRequest(vscode_languageserver_protocol_1.InlineCompletionRequest.type, client2.code2ProtocolConverter.asInlineCompletionParams(document2, position2, context2), token2).then((result) => {
14884
+ return client.sendRequest(vscode_languageserver_protocol_1.InlineCompletionRequest.type, client.code2ProtocolConverter.asInlineCompletionParams(document2, position2, context2), token2).then((result) => {
14885
14885
  if (token2.isCancellationRequested) {
14886
14886
  return null;
14887
14887
  }
14888
- return client2.protocol2CodeConverter.asInlineCompletionResult(result, token2);
14888
+ return client.protocol2CodeConverter.asInlineCompletionResult(result, token2);
14889
14889
  }, (error) => {
14890
- return client2.handleFailedRequest(vscode_languageserver_protocol_1.InlineCompletionRequest.type, token2, error, null);
14890
+ return client.handleFailedRequest(vscode_languageserver_protocol_1.InlineCompletionRequest.type, token2, error, null);
14891
14891
  });
14892
14892
  };
14893
14893
  return middleware.provideInlineCompletionItems ? middleware.provideInlineCompletionItems(document, position, context, token, provideInlineCompletionItems) : provideInlineCompletionItems(document, position, context, token);
@@ -14993,8 +14993,8 @@ var require_client = __commonJS({
14993
14993
  ResolvedClientOptions2.sanitizeIsTrusted = sanitizeIsTrusted;
14994
14994
  })(ResolvedClientOptions || (ResolvedClientOptions = {}));
14995
14995
  var DefaultErrorHandler = class {
14996
- constructor(client2, maxRestartCount) {
14997
- this.client = client2;
14996
+ constructor(client, maxRestartCount) {
14997
+ this.client = client;
14998
14998
  this.maxRestartCount = maxRestartCount;
14999
14999
  this.restarts = [];
15000
15000
  }
@@ -15466,7 +15466,7 @@ var require_client = __commonJS({
15466
15466
  if (this._onStart !== void 0) {
15467
15467
  return this._onStart;
15468
15468
  }
15469
- const [promise, resolve, reject] = this.createOnStartPromise();
15469
+ const [promise, resolve2, reject] = this.createOnStartPromise();
15470
15470
  this._onStart = promise;
15471
15471
  if (this._diagnostics === void 0) {
15472
15472
  this._diagnostics = this._clientOptions.diagnosticCollectionName ? vscode_1.languages.createDiagnosticCollection(this._clientOptions.diagnosticCollectionName) : vscode_1.languages.createDiagnosticCollection();
@@ -15576,7 +15576,7 @@ var require_client = __commonJS({
15576
15576
  });
15577
15577
  connection.listen();
15578
15578
  await this.initialize(connection);
15579
- resolve();
15579
+ resolve2();
15580
15580
  } catch (error) {
15581
15581
  this.$state = ClientState.StartFailed;
15582
15582
  this.error(`${this._name} client: couldn't create connection to server.`, error, "force");
@@ -15585,13 +15585,13 @@ var require_client = __commonJS({
15585
15585
  return this._onStart;
15586
15586
  }
15587
15587
  createOnStartPromise() {
15588
- let resolve;
15588
+ let resolve2;
15589
15589
  let reject;
15590
15590
  const promise = new Promise((_resolve, _reject) => {
15591
- resolve = _resolve;
15591
+ resolve2 = _resolve;
15592
15592
  reject = _reject;
15593
15593
  });
15594
- return [promise, resolve, reject];
15594
+ return [promise, resolve2, reject];
15595
15595
  }
15596
15596
  async initialize(connection) {
15597
15597
  this.refreshTrace(connection, false);
@@ -15802,17 +15802,17 @@ var require_client = __commonJS({
15802
15802
  }
15803
15803
  }
15804
15804
  notifyFileEvent(event) {
15805
- const client2 = this;
15805
+ const client = this;
15806
15806
  async function didChangeWatchedFile(event2) {
15807
- client2._fileEvents.push(event2);
15808
- return client2._fileEventDelayer.trigger(async () => {
15809
- await client2.sendNotification(vscode_languageserver_protocol_1.DidChangeWatchedFilesNotification.type, { changes: client2._fileEvents });
15810
- client2._fileEvents = [];
15807
+ client._fileEvents.push(event2);
15808
+ return client._fileEventDelayer.trigger(async () => {
15809
+ await client.sendNotification(vscode_languageserver_protocol_1.DidChangeWatchedFilesNotification.type, { changes: client._fileEvents });
15810
+ client._fileEvents = [];
15811
15811
  });
15812
15812
  }
15813
15813
  const workSpaceMiddleware = this.clientOptions.middleware?.workspace;
15814
15814
  (workSpaceMiddleware?.didChangeWatchedFile ? workSpaceMiddleware.didChangeWatchedFile(event, didChangeWatchedFile) : didChangeWatchedFile(event)).catch((error) => {
15815
- client2.error(`Notify file events failed.`, error);
15815
+ client.error(`Notify file events failed.`, error);
15816
15816
  });
15817
15817
  }
15818
15818
  async sendPendingFullTextDocumentChanges(connection) {
@@ -17096,12 +17096,12 @@ var require_comparator = __commonJS({
17096
17096
  if (this.value === "") {
17097
17097
  return true;
17098
17098
  }
17099
- return new Range(comp.value, options).test(this.value);
17099
+ return new Range2(comp.value, options).test(this.value);
17100
17100
  } else if (comp.operator === "") {
17101
17101
  if (comp.value === "") {
17102
17102
  return true;
17103
17103
  }
17104
- return new Range(this.value, options).test(comp.semver);
17104
+ return new Range2(this.value, options).test(comp.semver);
17105
17105
  }
17106
17106
  options = parseOptions(options);
17107
17107
  if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
@@ -17134,7 +17134,7 @@ var require_comparator = __commonJS({
17134
17134
  var cmp = require_cmp();
17135
17135
  var debug = require_debug();
17136
17136
  var SemVer = require_semver();
17137
- var Range = require_range();
17137
+ var Range2 = require_range();
17138
17138
  }
17139
17139
  });
17140
17140
 
@@ -17143,7 +17143,7 @@ var require_range = __commonJS({
17143
17143
  "../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/classes/range.js"(exports2, module2) {
17144
17144
  "use strict";
17145
17145
  var SPACE_CHARACTERS = /\s+/g;
17146
- var Range = class _Range {
17146
+ var Range2 = class _Range {
17147
17147
  constructor(range, options) {
17148
17148
  options = parseOptions(options);
17149
17149
  if (range instanceof _Range) {
@@ -17282,7 +17282,7 @@ var require_range = __commonJS({
17282
17282
  return false;
17283
17283
  }
17284
17284
  };
17285
- module2.exports = Range;
17285
+ module2.exports = Range2;
17286
17286
  var LRU = require_lrucache();
17287
17287
  var cache = new LRU();
17288
17288
  var parseOptions = require_parse_options();
@@ -17522,10 +17522,10 @@ var require_range = __commonJS({
17522
17522
  var require_satisfies = __commonJS({
17523
17523
  "../../node_modules/.pnpm/semver@7.8.1/node_modules/semver/functions/satisfies.js"(exports2, module2) {
17524
17524
  "use strict";
17525
- var Range = require_range();
17525
+ var Range2 = require_range();
17526
17526
  var satisfies = (version, range, options) => {
17527
17527
  try {
17528
- range = new Range(range, options);
17528
+ range = new Range2(range, options);
17529
17529
  } catch (er) {
17530
17530
  return false;
17531
17531
  }
@@ -17593,8 +17593,8 @@ var require_main4 = __commonJS({
17593
17593
  Object.defineProperty(exports2, "__esModule", { value: true });
17594
17594
  exports2.SettingMonitor = exports2.LanguageClient = exports2.TransportKind = void 0;
17595
17595
  var cp = require("child_process");
17596
- var fs = require("fs");
17597
- var path2 = require("path");
17596
+ var fs2 = require("fs");
17597
+ var path3 = require("path");
17598
17598
  var vscode_1 = require("vscode");
17599
17599
  var Is = require_is();
17600
17600
  var client_1 = require_client();
@@ -17605,18 +17605,18 @@ var require_main4 = __commonJS({
17605
17605
  __exportStar(require_node2(), exports2);
17606
17606
  __exportStar(require_api3(), exports2);
17607
17607
  var REQUIRED_VSCODE_VERSION = "^1.82.0";
17608
- var TransportKind2;
17609
- (function(TransportKind3) {
17610
- TransportKind3[TransportKind3["stdio"] = 0] = "stdio";
17611
- TransportKind3[TransportKind3["ipc"] = 1] = "ipc";
17612
- TransportKind3[TransportKind3["pipe"] = 2] = "pipe";
17613
- TransportKind3[TransportKind3["socket"] = 3] = "socket";
17614
- })(TransportKind2 || (exports2.TransportKind = TransportKind2 = {}));
17608
+ var TransportKind;
17609
+ (function(TransportKind2) {
17610
+ TransportKind2[TransportKind2["stdio"] = 0] = "stdio";
17611
+ TransportKind2[TransportKind2["ipc"] = 1] = "ipc";
17612
+ TransportKind2[TransportKind2["pipe"] = 2] = "pipe";
17613
+ TransportKind2[TransportKind2["socket"] = 3] = "socket";
17614
+ })(TransportKind || (exports2.TransportKind = TransportKind = {}));
17615
17615
  var Transport;
17616
17616
  (function(Transport2) {
17617
17617
  function isSocket(value) {
17618
17618
  const candidate = value;
17619
- return candidate && candidate.kind === TransportKind2.socket && Is.number(candidate.port);
17619
+ return candidate && candidate.kind === TransportKind.socket && Is.number(candidate.port);
17620
17620
  }
17621
17621
  Transport2.isSocket = isSocket;
17622
17622
  })(Transport || (Transport = {}));
@@ -17704,7 +17704,7 @@ var require_main4 = __commonJS({
17704
17704
  async restart() {
17705
17705
  await this.stop();
17706
17706
  if (this.isInDebugMode) {
17707
- await new Promise((resolve) => setTimeout(resolve, 1e3));
17707
+ await new Promise((resolve2) => setTimeout(resolve2, 1e3));
17708
17708
  await this.start();
17709
17709
  } else {
17710
17710
  await this.start();
@@ -17817,7 +17817,7 @@ var require_main4 = __commonJS({
17817
17817
  return this._getServerWorkingDir(json.options).then((serverWorkingDir) => {
17818
17818
  if (NodeModule.is(json) && json.module) {
17819
17819
  let node = json;
17820
- let transport = node.transport || TransportKind2.stdio;
17820
+ let transport = node.transport || TransportKind.stdio;
17821
17821
  if (node.runtime) {
17822
17822
  const args = [];
17823
17823
  const options = node.options ?? /* @__PURE__ */ Object.create(null);
@@ -17833,32 +17833,32 @@ var require_main4 = __commonJS({
17833
17833
  execOptions.env = getEnvironment(options.env, false);
17834
17834
  const runtime = this._getRuntimePath(node.runtime, serverWorkingDir);
17835
17835
  let pipeName = void 0;
17836
- if (transport === TransportKind2.ipc) {
17836
+ if (transport === TransportKind.ipc) {
17837
17837
  execOptions.stdio = [null, null, null, "ipc"];
17838
17838
  args.push("--node-ipc");
17839
- } else if (transport === TransportKind2.stdio) {
17839
+ } else if (transport === TransportKind.stdio) {
17840
17840
  args.push("--stdio");
17841
- } else if (transport === TransportKind2.pipe) {
17841
+ } else if (transport === TransportKind.pipe) {
17842
17842
  pipeName = (0, node_1.generateRandomPipeName)();
17843
17843
  args.push(`--pipe=${pipeName}`);
17844
17844
  } else if (Transport.isSocket(transport)) {
17845
17845
  args.push(`--socket=${transport.port}`);
17846
17846
  }
17847
17847
  args.push(`--clientProcessId=${process.pid.toString()}`);
17848
- if (transport === TransportKind2.ipc || transport === TransportKind2.stdio) {
17848
+ if (transport === TransportKind.ipc || transport === TransportKind.stdio) {
17849
17849
  const serverProcess = cp.spawn(runtime, args, execOptions);
17850
17850
  if (!serverProcess || !serverProcess.pid) {
17851
17851
  return handleChildProcessStartError(serverProcess, `Launching server using runtime ${runtime} failed.`);
17852
17852
  }
17853
17853
  this._serverProcess = serverProcess;
17854
17854
  serverProcess.stderr.on("data", (data) => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));
17855
- if (transport === TransportKind2.ipc) {
17855
+ if (transport === TransportKind.ipc) {
17856
17856
  serverProcess.stdout.on("data", (data) => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));
17857
17857
  return Promise.resolve({ reader: new node_1.IPCMessageReader(serverProcess), writer: new node_1.IPCMessageWriter(serverProcess) });
17858
17858
  } else {
17859
17859
  return Promise.resolve({ reader: new node_1.StreamMessageReader(serverProcess.stdout), writer: new node_1.StreamMessageWriter(serverProcess.stdin) });
17860
17860
  }
17861
- } else if (transport === TransportKind2.pipe) {
17861
+ } else if (transport === TransportKind.pipe) {
17862
17862
  return (0, node_1.createClientPipeTransport)(pipeName).then((transport2) => {
17863
17863
  const process2 = cp.spawn(runtime, args, execOptions);
17864
17864
  if (!process2 || !process2.pid) {
@@ -17887,13 +17887,13 @@ var require_main4 = __commonJS({
17887
17887
  }
17888
17888
  } else {
17889
17889
  let pipeName = void 0;
17890
- return new Promise((resolve, reject) => {
17890
+ return new Promise((resolve2, reject) => {
17891
17891
  const args = (node.args && node.args.slice()) ?? [];
17892
- if (transport === TransportKind2.ipc) {
17892
+ if (transport === TransportKind.ipc) {
17893
17893
  args.push("--node-ipc");
17894
- } else if (transport === TransportKind2.stdio) {
17894
+ } else if (transport === TransportKind.stdio) {
17895
17895
  args.push("--stdio");
17896
- } else if (transport === TransportKind2.pipe) {
17896
+ } else if (transport === TransportKind.pipe) {
17897
17897
  pipeName = (0, node_1.generateRandomPipeName)();
17898
17898
  args.push(`--pipe=${pipeName}`);
17899
17899
  } else if (Transport.isSocket(transport)) {
@@ -17905,18 +17905,18 @@ var require_main4 = __commonJS({
17905
17905
  options.execArgv = options.execArgv || [];
17906
17906
  options.cwd = serverWorkingDir;
17907
17907
  options.silent = true;
17908
- if (transport === TransportKind2.ipc || transport === TransportKind2.stdio) {
17908
+ if (transport === TransportKind.ipc || transport === TransportKind.stdio) {
17909
17909
  const sp = cp.fork(node.module, args || [], options);
17910
17910
  assertStdio(sp);
17911
17911
  this._serverProcess = sp;
17912
17912
  sp.stderr.on("data", (data) => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));
17913
- if (transport === TransportKind2.ipc) {
17913
+ if (transport === TransportKind.ipc) {
17914
17914
  sp.stdout.on("data", (data) => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));
17915
- resolve({ reader: new node_1.IPCMessageReader(this._serverProcess), writer: new node_1.IPCMessageWriter(this._serverProcess) });
17915
+ resolve2({ reader: new node_1.IPCMessageReader(this._serverProcess), writer: new node_1.IPCMessageWriter(this._serverProcess) });
17916
17916
  } else {
17917
- resolve({ reader: new node_1.StreamMessageReader(sp.stdout), writer: new node_1.StreamMessageWriter(sp.stdin) });
17917
+ resolve2({ reader: new node_1.StreamMessageReader(sp.stdout), writer: new node_1.StreamMessageWriter(sp.stdin) });
17918
17918
  }
17919
- } else if (transport === TransportKind2.pipe) {
17919
+ } else if (transport === TransportKind.pipe) {
17920
17920
  (0, node_1.createClientPipeTransport)(pipeName).then((transport2) => {
17921
17921
  const sp = cp.fork(node.module, args || [], options);
17922
17922
  assertStdio(sp);
@@ -17924,7 +17924,7 @@ var require_main4 = __commonJS({
17924
17924
  sp.stderr.on("data", (data) => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));
17925
17925
  sp.stdout.on("data", (data) => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));
17926
17926
  transport2.onConnected().then((protocol) => {
17927
- resolve({ reader: protocol[0], writer: protocol[1] });
17927
+ resolve2({ reader: protocol[0], writer: protocol[1] });
17928
17928
  }, reject);
17929
17929
  }, reject);
17930
17930
  } else if (Transport.isSocket(transport)) {
@@ -17935,7 +17935,7 @@ var require_main4 = __commonJS({
17935
17935
  sp.stderr.on("data", (data) => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));
17936
17936
  sp.stdout.on("data", (data) => this.outputChannel.append(Is.string(data) ? data : data.toString(encoding)));
17937
17937
  transport2.onConnected().then((protocol) => {
17938
- resolve({ reader: protocol[0], writer: protocol[1] });
17938
+ resolve2({ reader: protocol[0], writer: protocol[1] });
17939
17939
  }, reject);
17940
17940
  }, reject);
17941
17941
  }
@@ -17946,19 +17946,19 @@ var require_main4 = __commonJS({
17946
17946
  const args = json.args !== void 0 ? json.args.slice(0) : [];
17947
17947
  let pipeName = void 0;
17948
17948
  const transport = json.transport;
17949
- if (transport === TransportKind2.stdio) {
17949
+ if (transport === TransportKind.stdio) {
17950
17950
  args.push("--stdio");
17951
- } else if (transport === TransportKind2.pipe) {
17951
+ } else if (transport === TransportKind.pipe) {
17952
17952
  pipeName = (0, node_1.generateRandomPipeName)();
17953
17953
  args.push(`--pipe=${pipeName}`);
17954
17954
  } else if (Transport.isSocket(transport)) {
17955
17955
  args.push(`--socket=${transport.port}`);
17956
- } else if (transport === TransportKind2.ipc) {
17956
+ } else if (transport === TransportKind.ipc) {
17957
17957
  throw new Error(`Transport kind ipc is not support for command executable`);
17958
17958
  }
17959
17959
  const options = Object.assign({}, command.options);
17960
17960
  options.cwd = options.cwd || serverWorkingDir;
17961
- if (transport === void 0 || transport === TransportKind2.stdio) {
17961
+ if (transport === void 0 || transport === TransportKind.stdio) {
17962
17962
  const serverProcess = cp.spawn(command.command, args, options);
17963
17963
  if (!serverProcess || !serverProcess.pid) {
17964
17964
  return handleChildProcessStartError(serverProcess, `Launching server using command ${command.command} failed.`);
@@ -17967,7 +17967,7 @@ var require_main4 = __commonJS({
17967
17967
  this._serverProcess = serverProcess;
17968
17968
  this._isDetached = !!options.detached;
17969
17969
  return Promise.resolve({ reader: new node_1.StreamMessageReader(serverProcess.stdout), writer: new node_1.StreamMessageWriter(serverProcess.stdin) });
17970
- } else if (transport === TransportKind2.pipe) {
17970
+ } else if (transport === TransportKind.pipe) {
17971
17971
  return (0, node_1.createClientPipeTransport)(pipeName).then((transport2) => {
17972
17972
  const serverProcess = cp.spawn(command.command, args, options);
17973
17973
  if (!serverProcess || !serverProcess.pid) {
@@ -18012,19 +18012,19 @@ var require_main4 = __commonJS({
18012
18012
  });
18013
18013
  }
18014
18014
  _getRuntimePath(runtime, serverWorkingDirectory) {
18015
- if (path2.isAbsolute(runtime)) {
18015
+ if (path3.isAbsolute(runtime)) {
18016
18016
  return runtime;
18017
18017
  }
18018
18018
  const mainRootPath = this._mainGetRootPath();
18019
18019
  if (mainRootPath !== void 0) {
18020
- const result = path2.join(mainRootPath, runtime);
18021
- if (fs.existsSync(result)) {
18020
+ const result = path3.join(mainRootPath, runtime);
18021
+ if (fs2.existsSync(result)) {
18022
18022
  return result;
18023
18023
  }
18024
18024
  }
18025
18025
  if (serverWorkingDirectory !== void 0) {
18026
- const result = path2.join(serverWorkingDirectory, runtime);
18027
- if (fs.existsSync(result)) {
18026
+ const result = path3.join(serverWorkingDirectory, runtime);
18027
+ if (fs2.existsSync(result)) {
18028
18028
  return result;
18029
18029
  }
18030
18030
  }
@@ -18048,7 +18048,7 @@ var require_main4 = __commonJS({
18048
18048
  }
18049
18049
  if (cwd) {
18050
18050
  return new Promise((s) => {
18051
- fs.lstat(cwd, (err, stats) => {
18051
+ fs2.lstat(cwd, (err, stats) => {
18052
18052
  s(!err && stats.isDirectory() ? cwd : void 0);
18053
18053
  });
18054
18054
  });
@@ -18114,185 +18114,839 @@ __export(extension_exports, {
18114
18114
  deactivate: () => deactivate
18115
18115
  });
18116
18116
  module.exports = __toCommonJS(extension_exports);
18117
- var path = __toESM(require("node:path"));
18117
+ var path2 = __toESM(require("node:path"));
18118
18118
  var import_vscode = require("vscode");
18119
18119
  var import_node = __toESM(require_node3());
18120
- var client;
18121
- function resolveServerLauncher() {
18122
- const config = import_vscode.workspace.getConfiguration("ttsc");
18123
- const explicit = config.get("serverPath", "").trim();
18124
- const bases = collectResolutionBases();
18125
- if (explicit && path.isAbsolute(explicit)) {
18120
+
18121
+ // src/commandEdits.ts
18122
+ function collectWorkspaceEditChanges(value) {
18123
+ if (!value || typeof value !== "object") {
18124
+ return void 0;
18125
+ }
18126
+ const changes = value.changes;
18127
+ if (!changes || typeof changes !== "object" || Array.isArray(changes)) {
18128
+ return void 0;
18129
+ }
18130
+ const out = [];
18131
+ for (const [uri, edits] of Object.entries(changes)) {
18132
+ if (!Array.isArray(edits)) {
18133
+ continue;
18134
+ }
18135
+ for (const edit of edits) {
18136
+ const range = protocolRange(edit);
18137
+ const newText = protocolNewText(edit);
18138
+ if (range && newText !== void 0) {
18139
+ out.push({ newText, range, uri });
18140
+ }
18141
+ }
18142
+ }
18143
+ return out;
18144
+ }
18145
+ function commandArgumentsContainDirtyURI(args, dirtyURIs) {
18146
+ return args.some((value) => valueContainsDirtyURI(value, dirtyURIs));
18147
+ }
18148
+ function workspaceEditChangesTouchDirtyURI(edits, dirtyURIs) {
18149
+ return edits.some((edit) => dirtyURIs.has(edit.uri));
18150
+ }
18151
+ function shouldApplyCommandWorkspaceEdit(command, commandPrefix) {
18152
+ return commandPrefix !== "" && command.startsWith(commandPrefix);
18153
+ }
18154
+ function valueContainsDirtyURI(value, dirtyURIs) {
18155
+ if (typeof value === "string") {
18156
+ return dirtyURIs.has(value);
18157
+ }
18158
+ if (Array.isArray(value)) {
18159
+ return value.some((item) => valueContainsDirtyURI(item, dirtyURIs));
18160
+ }
18161
+ if (value && typeof value === "object") {
18162
+ return Object.values(value).some(
18163
+ (item) => valueContainsDirtyURI(item, dirtyURIs)
18164
+ );
18165
+ }
18166
+ return false;
18167
+ }
18168
+ function protocolRange(value) {
18169
+ const range = value?.range;
18170
+ if (!range || typeof range !== "object") {
18171
+ return void 0;
18172
+ }
18173
+ const start = range.start;
18174
+ const end = range.end;
18175
+ if (!isProtocolPosition(start) || !isProtocolPosition(end)) {
18176
+ return void 0;
18177
+ }
18178
+ if (!isOrderedRange(start, end)) {
18179
+ return void 0;
18180
+ }
18181
+ return { end, start };
18182
+ }
18183
+ function protocolNewText(value) {
18184
+ const newText = value?.newText;
18185
+ return typeof newText === "string" ? newText : void 0;
18186
+ }
18187
+ function isProtocolPosition(value) {
18188
+ return !!value && typeof value === "object" && Number.isInteger(value.line) && Number.isInteger(value.character) && value.line >= 0 && value.character >= 0;
18189
+ }
18190
+ function isOrderedRange(start, end) {
18191
+ return start.line < end.line || start.line === end.line && start.character <= end.character;
18192
+ }
18193
+
18194
+ // src/serverResolution.ts
18195
+ var import_node_crypto = require("node:crypto");
18196
+ var import_node_fs = __toESM(require("node:fs"));
18197
+ var import_node_module = require("node:module");
18198
+ var import_node_path = __toESM(require("node:path"));
18199
+ var PROJECT_CONFIG_PATTERN = /^(?:tsconfig|jsconfig)(?:\..*)?\.json$/;
18200
+ var WRAPPED_COMMAND_IDS = ["ttsc.lint.fixAll", "ttsc.format.document"];
18201
+ function resolveTtscServerLauncher(resolveFrom) {
18202
+ try {
18203
+ const requireFromBase = (0, import_node_module.createRequire)(
18204
+ import_node_path.default.join(resolveFrom, "__ttsc_vscode_resolve__.cjs")
18205
+ );
18206
+ const packageJson = requireFromBase.resolve("ttsc/package.json");
18207
+ const packageRoot = import_node_path.default.dirname(packageJson);
18208
+ const manifest = JSON.parse(import_node_fs.default.readFileSync(packageJson, "utf8"));
18209
+ const bin = typeof manifest.bin?.ttscserver === "string" ? manifest.bin.ttscserver : import_node_path.default.join("lib", "launcher", "ttscserver.js");
18210
+ const launcher = import_node_path.default.resolve(packageRoot, bin);
18211
+ return import_node_fs.default.existsSync(launcher) ? launcher : void 0;
18212
+ } catch {
18213
+ return void 0;
18214
+ }
18215
+ }
18216
+ function findProjectConfig(start, stopAt) {
18217
+ let dir = import_node_path.default.resolve(start);
18218
+ const boundary = stopAt ? import_node_path.default.resolve(stopAt) : void 0;
18219
+ for (; ; ) {
18220
+ const config = projectConfigIn(dir);
18221
+ if (config) {
18222
+ return config;
18223
+ }
18224
+ if (boundary && dir === boundary) {
18225
+ return void 0;
18226
+ }
18227
+ const parent = import_node_path.default.dirname(dir);
18228
+ if (parent === dir) {
18229
+ return void 0;
18230
+ }
18231
+ dir = parent;
18232
+ }
18233
+ }
18234
+ function createResolutionCandidates(input) {
18235
+ const candidates = [];
18236
+ const seen = /* @__PURE__ */ new Set();
18237
+ const push = (candidate) => {
18238
+ const key = `${candidate.resolveFrom}\0${candidate.cwd}`;
18239
+ if (seen.has(key)) return;
18240
+ seen.add(key);
18241
+ candidates.push(candidate);
18242
+ };
18243
+ if (input.activeFile) {
18244
+ const resolveFrom = import_node_path.default.dirname(input.activeFile);
18245
+ const tsconfig = findProjectConfig(resolveFrom, input.activeWorkspaceRoot);
18246
+ push({
18247
+ cwd: tsconfig ? import_node_path.default.dirname(tsconfig) : input.activeWorkspaceRoot ?? resolveFrom,
18248
+ resolveFrom,
18249
+ tsconfig
18250
+ });
18251
+ }
18252
+ for (const root of input.workspaceRoots ?? []) {
18253
+ const tsconfig = findProjectConfig(root, root);
18254
+ push({
18255
+ cwd: tsconfig ? import_node_path.default.dirname(tsconfig) : root,
18256
+ resolveFrom: root,
18257
+ tsconfig
18258
+ });
18259
+ }
18260
+ return candidates;
18261
+ }
18262
+ function createServerLaunchCommand(launcher, candidate, platform = process.platform, env = process.env) {
18263
+ const args = [
18264
+ "--stdio",
18265
+ "--cwd=" + candidate.cwd,
18266
+ "--suppress-execute-command-ids=" + WRAPPED_COMMAND_IDS.join(","),
18267
+ "--execute-command-id-prefix=" + executeCommandIDPrefix(candidate.cwd),
18268
+ ...candidate.tsconfig ? ["--tsconfig=" + candidate.tsconfig] : []
18269
+ ];
18270
+ if (isJavaScriptLauncher(launcher)) {
18271
+ return { command: process.execPath, args: [launcher, ...args] };
18272
+ }
18273
+ if (platform === "win32" && isWindowsCommandLauncher(launcher)) {
18126
18274
  return {
18127
- command: explicit,
18128
- args: ["--stdio"],
18129
- options: serverProcessOptions(bases[0]),
18130
- transport: import_node.TransportKind.stdio
18275
+ command: env.ComSpec || "cmd.exe",
18276
+ args: ["/d", "/s", "/c", quoteWindowsCommand([launcher, ...args])]
18131
18277
  };
18132
18278
  }
18133
- for (const base of bases) {
18134
- try {
18135
- const launcher = require.resolve("ttsc/lib/launcher/ttscserver.js", {
18136
- paths: [base]
18137
- });
18138
- return {
18139
- module: launcher,
18140
- args: ["--stdio"],
18141
- options: serverProcessOptions(base),
18142
- transport: import_node.TransportKind.stdio
18143
- };
18144
- } catch {
18279
+ return { command: launcher, args };
18280
+ }
18281
+ function quoteWindowsCommand(args) {
18282
+ return `"${args.map(quoteWindowsArg).join(" ")}"`;
18283
+ }
18284
+ function createDocumentSelectorPattern(ctor, root) {
18285
+ return new ctor(root, "**/*");
18286
+ }
18287
+ function executeCommandIDPrefix(root) {
18288
+ const key = (0, import_node_crypto.createHash)("sha256").update(rootKey(root)).digest("hex").slice(0, 16);
18289
+ return `ttsc.vscode.${key}.`;
18290
+ }
18291
+ function filterNonOverlappingCandidates(candidates) {
18292
+ const sorted = [...candidates].sort(
18293
+ (left, right) => import_node_path.default.resolve(right.cwd).length - import_node_path.default.resolve(left.cwd).length
18294
+ );
18295
+ const selected = [];
18296
+ for (const candidate of sorted) {
18297
+ if (selected.some(
18298
+ (entry) => isPathInsideRoot(entry.cwd, candidate.cwd, process.platform)
18299
+ )) {
18300
+ continue;
18145
18301
  }
18302
+ selected.push(candidate);
18146
18303
  }
18147
- return void 0;
18304
+ return selected.sort(
18305
+ (left, right) => candidates.indexOf(left) - candidates.indexOf(right)
18306
+ );
18307
+ }
18308
+ function planNonOverlappingClientRoots(roots, preferredRoot, platform = process.platform) {
18309
+ const unique = /* @__PURE__ */ new Map();
18310
+ for (const root of roots) {
18311
+ const key = rootKey(root, platform);
18312
+ if (!unique.has(key)) {
18313
+ unique.set(key, root);
18314
+ }
18315
+ }
18316
+ const preferredKey = preferredRoot ? rootKey(preferredRoot, platform) : void 0;
18317
+ const ordered = [];
18318
+ if (preferredKey && unique.has(preferredKey)) {
18319
+ ordered.push(unique.get(preferredKey));
18320
+ unique.delete(preferredKey);
18321
+ }
18322
+ ordered.push(
18323
+ ...[...unique.values()].sort((left, right) => {
18324
+ const depth = pathDepth(right, platform) - pathDepth(left, platform);
18325
+ return depth || normalizeForPathMatch(left, platform).localeCompare(
18326
+ normalizeForPathMatch(right, platform)
18327
+ );
18328
+ })
18329
+ );
18330
+ const selected = [];
18331
+ for (const root of ordered) {
18332
+ if (selected.some((entry) => rootsOverlap(entry, root, platform))) {
18333
+ continue;
18334
+ }
18335
+ selected.push(root);
18336
+ }
18337
+ return selected;
18338
+ }
18339
+ function selectDeepestRootForPath(file, roots, platform = process.platform) {
18340
+ let selected;
18341
+ for (const root of roots) {
18342
+ if (!isPathInsideRoot(file, root, platform)) {
18343
+ continue;
18344
+ }
18345
+ if (!selected || normalizeForPathMatch(root, platform).length > normalizeForPathMatch(selected, platform).length) {
18346
+ selected = root;
18347
+ }
18348
+ }
18349
+ return selected;
18350
+ }
18351
+ function isPathInsideRoot(file, root, platform = process.platform) {
18352
+ const normalizedFile = normalizeForPathMatch(file, platform);
18353
+ const normalizedRoot = normalizeForPathMatch(root, platform);
18354
+ const sep = platform === "win32" ? import_node_path.default.win32.sep : import_node_path.default.sep;
18355
+ return normalizedFile === normalizedRoot || normalizedFile.startsWith(normalizedRoot + sep);
18356
+ }
18357
+ function rootsOverlap(left, right, platform = process.platform) {
18358
+ return isPathInsideRoot(left, right, platform) || isPathInsideRoot(right, left, platform);
18359
+ }
18360
+ function rootsToStopForTarget(roots, target, platform = process.platform) {
18361
+ return roots.filter((root) => rootsOverlap(root, target, platform));
18362
+ }
18363
+ function rootsToStopForPlan(roots, plannedRoots, platform = process.platform) {
18364
+ const plannedKeys = new Set(
18365
+ plannedRoots.map((root) => rootKey(root, platform))
18366
+ );
18367
+ return roots.filter((root) => !plannedKeys.has(rootKey(root, platform)));
18368
+ }
18369
+ function rootsInsideRemovedWorkspace(roots, removedRoot, platform = process.platform) {
18370
+ return roots.filter((root) => isPathInsideRoot(root, removedRoot, platform));
18371
+ }
18372
+ function rootKey(root, platform = process.platform) {
18373
+ return normalizeForPathMatch(root, platform);
18374
+ }
18375
+ function normalizeForPathMatch(value, platform) {
18376
+ const pathApi = platform === "win32" ? import_node_path.default.win32 : import_node_path.default;
18377
+ const normalized = pathApi.resolve(value);
18378
+ return platform === "win32" ? normalized.toLowerCase() : normalized;
18148
18379
  }
18149
- function serverProcessOptions(base) {
18150
- const tsgo = base ? resolveTsgoBinary(base) : void 0;
18151
- if (!base && !tsgo) {
18380
+ function pathDepth(value, platform) {
18381
+ return normalizeForPathMatch(value, platform).split(platform === "win32" ? import_node_path.default.win32.sep : import_node_path.default.sep).filter(Boolean).length;
18382
+ }
18383
+ function projectConfigIn(dir) {
18384
+ try {
18385
+ const match = import_node_fs.default.readdirSync(dir).filter((name) => PROJECT_CONFIG_PATTERN.test(name)).sort(compareProjectConfigNames)[0];
18386
+ return match ? import_node_path.default.join(dir, match) : void 0;
18387
+ } catch {
18152
18388
  return void 0;
18153
18389
  }
18154
- return {
18155
- cwd: base,
18156
- env: tsgo ? {
18157
- ...process.env,
18158
- TTSC_TSGO_BINARY: tsgo
18159
- } : process.env
18390
+ }
18391
+ function compareProjectConfigNames(left, right) {
18392
+ const priority = (name) => {
18393
+ if (name === "tsconfig.json") return 0;
18394
+ if (/^tsconfig\..*\.json$/.test(name)) return 1;
18395
+ if (name === "jsconfig.json") return 2;
18396
+ return 3;
18160
18397
  };
18398
+ return priority(left) - priority(right) || left.localeCompare(right);
18399
+ }
18400
+ function isJavaScriptLauncher(launcher) {
18401
+ return [".js", ".cjs", ".mjs"].includes(import_node_path.default.extname(launcher));
18402
+ }
18403
+ function isWindowsCommandLauncher(launcher) {
18404
+ return [".cmd", ".bat"].includes(import_node_path.default.extname(launcher).toLowerCase());
18405
+ }
18406
+ function quoteWindowsArg(arg) {
18407
+ return `"${String(arg).replace(/"/g, '\\"').replace(/%/g, "%%")}"`;
18161
18408
  }
18162
18409
  function resolveTsgoBinary(base) {
18163
18410
  try {
18164
- const packageJson = require.resolve(
18165
- "@typescript/native-preview/package.json",
18166
- { paths: [base] }
18411
+ const requireFromBase = (0, import_node_module.createRequire)(
18412
+ import_node_path.default.join(base, "__ttsc_vscode_resolve__.cjs")
18413
+ );
18414
+ const packageJson = requireFromBase.resolve(
18415
+ "@typescript/native-preview/package.json"
18416
+ );
18417
+ const packageRoot = import_node_path.default.dirname(packageJson);
18418
+ const requireFromTsgo = (0, import_node_module.createRequire)(
18419
+ import_node_path.default.join(packageRoot, "__ttsc_vscode_resolve__.cjs")
18167
18420
  );
18168
- const packageRoot = path.dirname(packageJson);
18169
18421
  const platformPackage = `@typescript/native-preview-${process.platform}-${process.arch}`;
18170
- const platformPackageJson = require.resolve(
18171
- `${platformPackage}/package.json`,
18172
- { paths: [packageRoot] }
18422
+ const platformPackageJson = requireFromTsgo.resolve(
18423
+ `${platformPackage}/package.json`
18173
18424
  );
18174
- return path.join(
18175
- path.dirname(platformPackageJson),
18425
+ const binary = import_node_path.default.join(
18426
+ import_node_path.default.dirname(platformPackageJson),
18176
18427
  "lib",
18177
18428
  process.platform === "win32" ? "tsgo.exe" : "tsgo"
18178
18429
  );
18430
+ return import_node_fs.default.existsSync(binary) ? binary : void 0;
18179
18431
  } catch {
18180
18432
  return void 0;
18181
18433
  }
18182
18434
  }
18183
- function collectResolutionBases() {
18184
- const bases = [];
18185
- const active = import_vscode.window.activeTextEditor?.document.uri;
18186
- if (active?.scheme === "file") {
18187
- bases.push(path.dirname(active.fsPath));
18435
+ function serverProcessOptions(cwd) {
18436
+ if (!cwd) {
18437
+ return void 0;
18188
18438
  }
18189
- for (const folder of import_vscode.workspace.workspaceFolders ?? []) {
18190
- if (folder.uri.scheme === "file") {
18191
- bases.push(folder.uri.fsPath);
18439
+ const tsgo = resolveTsgoBinary(cwd);
18440
+ return {
18441
+ cwd,
18442
+ env: tsgo ? {
18443
+ ...process.env,
18444
+ TTSC_TSGO_BINARY: tsgo
18445
+ } : process.env
18446
+ };
18447
+ }
18448
+
18449
+ // src/extension.ts
18450
+ var clients = /* @__PURE__ */ new Map();
18451
+ var reconcileQueue = Promise.resolve();
18452
+ var sharedTraceChannel;
18453
+ var deactivating = false;
18454
+ var warnedRelativeServerPaths = /* @__PURE__ */ new Set();
18455
+ function resolveServerLaunchSpecs() {
18456
+ const candidates = filterNonOverlappingCandidates(
18457
+ collectResolutionCandidates()
18458
+ );
18459
+ return createServerLaunchSpecs(candidates);
18460
+ }
18461
+ function createServerLaunchSpecs(candidates) {
18462
+ const specs = [];
18463
+ const seen = /* @__PURE__ */ new Set();
18464
+ for (const candidate of candidates) {
18465
+ const key = rootKey(candidate.cwd);
18466
+ if (seen.has(key)) {
18467
+ continue;
18468
+ }
18469
+ const config = import_vscode.workspace.getConfiguration("ttsc", import_vscode.Uri.file(candidate.cwd));
18470
+ const explicit = config.get("serverPath", "").trim();
18471
+ const launcher = resolveConfiguredServerPath(explicit, candidate.cwd) ?? resolveTtscServerLauncher(candidate.resolveFrom);
18472
+ if (!launcher) {
18473
+ continue;
18192
18474
  }
18475
+ seen.add(key);
18476
+ specs.push({
18477
+ cwd: candidate.cwd,
18478
+ id: key,
18479
+ name: `ttsc (${path2.basename(candidate.cwd)})`,
18480
+ serverOptions: createServerOptions(launcher, candidate),
18481
+ workspaceFolder: workspaceFolderFor(candidate.cwd, specs.length)
18482
+ });
18483
+ }
18484
+ return specs;
18485
+ }
18486
+ function resolveConfiguredServerPath(configuredPath, cwd) {
18487
+ if (!configuredPath) {
18488
+ return void 0;
18489
+ }
18490
+ if (path2.isAbsolute(configuredPath)) {
18491
+ return configuredPath;
18492
+ }
18493
+ const key = `${rootKey(cwd)}\0${configuredPath}`;
18494
+ if (!warnedRelativeServerPaths.has(key)) {
18495
+ warnedRelativeServerPaths.add(key);
18496
+ import_vscode.window.showWarningMessage(
18497
+ `ttsc.serverPath must be an absolute path; ignoring ${configuredPath}.`
18498
+ );
18499
+ }
18500
+ return void 0;
18501
+ }
18502
+ function resolveServerLaunchSpecForUri(uri) {
18503
+ if (uri.scheme !== "file") return void 0;
18504
+ const folder = import_vscode.workspace.getWorkspaceFolder(uri);
18505
+ const candidates = createResolutionCandidates({
18506
+ activeFile: uri.fsPath,
18507
+ activeWorkspaceRoot: folder?.uri.scheme === "file" ? folder.uri.fsPath : void 0
18508
+ });
18509
+ return createServerLaunchSpecs(candidates)[0];
18510
+ }
18511
+ function createServerOptions(launcher, candidate) {
18512
+ const launch = createServerLaunchCommand(launcher, candidate);
18513
+ return {
18514
+ command: launch.command,
18515
+ args: launch.args,
18516
+ options: serverProcessOptions(candidate.cwd)
18517
+ };
18518
+ }
18519
+ function workspaceFolderFor(root, index) {
18520
+ const folder = import_vscode.workspace.workspaceFolders?.find(
18521
+ (candidate) => candidate.uri.scheme === "file" && path2.resolve(candidate.uri.fsPath) === path2.resolve(root)
18522
+ );
18523
+ if (folder) {
18524
+ return folder;
18193
18525
  }
18194
- return bases;
18526
+ return {
18527
+ index,
18528
+ name: path2.basename(root),
18529
+ uri: import_vscode.Uri.file(root)
18530
+ };
18195
18531
  }
18196
- function buildClientOptions(traceChannel) {
18532
+ function collectResolutionCandidates() {
18533
+ const active = import_vscode.window.activeTextEditor?.document.uri;
18534
+ const activeFolder = active?.scheme === "file" ? import_vscode.workspace.getWorkspaceFolder(active) : void 0;
18535
+ const activeWorkspaceRoot = activeFolder?.uri.scheme === "file" ? activeFolder.uri.fsPath : void 0;
18536
+ const workspaceRoots = (import_vscode.workspace.workspaceFolders ?? []).filter((folder) => folder.uri.scheme === "file").map((folder) => folder.uri.fsPath);
18537
+ return createResolutionCandidates({
18538
+ activeFile: active?.scheme === "file" ? active.fsPath : void 0,
18539
+ activeWorkspaceRoot,
18540
+ workspaceRoots
18541
+ });
18542
+ }
18543
+ function buildClientOptions(traceChannel, spec) {
18544
+ const pattern = createDocumentSelectorPattern(
18545
+ import_vscode.RelativePattern,
18546
+ spec.cwd
18547
+ );
18548
+ const commandPrefix = executeCommandIDPrefix(spec.cwd);
18197
18549
  return {
18198
18550
  documentSelector: [
18199
- { scheme: "file", language: "typescript" },
18200
- { scheme: "file", language: "typescriptreact" },
18201
- { scheme: "file", language: "javascript" },
18202
- { scheme: "file", language: "javascriptreact" },
18203
- { scheme: "untitled", language: "typescript" },
18204
- { scheme: "untitled", language: "typescriptreact" }
18551
+ { scheme: "file", language: "typescript", pattern },
18552
+ { scheme: "file", language: "typescriptreact", pattern },
18553
+ { scheme: "file", language: "javascript", pattern },
18554
+ { scheme: "file", language: "javascriptreact", pattern }
18205
18555
  ],
18206
18556
  synchronize: {
18207
18557
  fileEvents: import_vscode.workspace.createFileSystemWatcher(
18208
- "**/{tsconfig,jsconfig}*.json"
18558
+ new import_vscode.RelativePattern(spec.cwd, "**/{tsconfig,jsconfig}*.json")
18209
18559
  ),
18210
18560
  configurationSection: "ttsc"
18211
18561
  },
18562
+ middleware: {
18563
+ executeCommand: async (command, args, next) => {
18564
+ const shouldApplyEdit = shouldApplyCommandWorkspaceEdit(
18565
+ command,
18566
+ commandPrefix
18567
+ );
18568
+ if (shouldApplyEdit && commandArgumentsContainDirtyDocument(args)) {
18569
+ showDiskBackedCommandWarning();
18570
+ return null;
18571
+ }
18572
+ const result = await next(command, args);
18573
+ if (shouldApplyEdit) {
18574
+ await applyCommandWorkspaceEdit(command, result, args);
18575
+ }
18576
+ return result;
18577
+ }
18578
+ },
18212
18579
  outputChannelName: "ttsc",
18213
- traceOutputChannel: traceChannel
18580
+ traceOutputChannel: traceChannel,
18581
+ workspaceFolder: spec.workspaceFolder
18214
18582
  };
18215
18583
  }
18216
- async function executeServerCommand(command, uri) {
18217
- if (!client) {
18218
- import_vscode.window.showWarningMessage("ttsc language server is not running yet.");
18584
+ async function executeServerCommand(command, uriArg) {
18585
+ const target = resolveCommandTarget(uriArg);
18586
+ if (!target) return;
18587
+ const document = import_vscode.workspace.textDocuments.find(
18588
+ (candidate) => candidate.uri.toString() === target.toString()
18589
+ );
18590
+ if (document?.isDirty) {
18591
+ showDiskBackedCommandWarning();
18592
+ return;
18593
+ }
18594
+ if (!clientEntryForUri(target) && sharedTraceChannel) {
18595
+ await ensureClientForUri(target, sharedTraceChannel);
18596
+ }
18597
+ const entry = clientEntryForUri(target);
18598
+ if (!entry) {
18599
+ import_vscode.window.showWarningMessage(
18600
+ "ttsc language server is not running for this file."
18601
+ );
18219
18602
  return;
18220
18603
  }
18221
18604
  try {
18222
- const result = await client.sendRequest("workspace/executeCommand", {
18605
+ await entry.ready;
18606
+ const result = await entry.client.sendRequest("workspace/executeCommand", {
18223
18607
  command,
18224
- arguments: [uri]
18608
+ arguments: [target.toString()]
18225
18609
  });
18226
18610
  if (!result || typeof result !== "object") {
18227
18611
  return;
18228
18612
  }
18229
18613
  const protoEdit = result;
18230
- const edit = await client.protocol2CodeConverter.asWorkspaceEdit(protoEdit);
18614
+ const edit = await entry.client.protocol2CodeConverter.asWorkspaceEdit(protoEdit);
18231
18615
  if (edit) {
18232
- await import_vscode.workspace.applyEdit(edit);
18616
+ if (hasDirtyDocument(target, edit)) {
18617
+ showDiskBackedCommandWarning();
18618
+ return;
18619
+ }
18620
+ const applied = await import_vscode.workspace.applyEdit(edit);
18621
+ if (!applied) {
18622
+ import_vscode.window.showWarningMessage(
18623
+ `ttsc command ${command} could not apply the returned edits.`
18624
+ );
18625
+ }
18233
18626
  }
18234
18627
  } catch (error) {
18235
18628
  import_vscode.window.showErrorMessage(`ttsc command ${command} failed: ${error}`);
18236
18629
  }
18237
18630
  }
18238
- function activeUri() {
18239
- return import_vscode.window.activeTextEditor?.document.uri.toString();
18631
+ function hasDirtyDocument(target, edit) {
18632
+ const touched = /* @__PURE__ */ new Set([target.toString()]);
18633
+ for (const [uri] of edit?.entries() ?? []) {
18634
+ touched.add(uri.toString());
18635
+ }
18636
+ return import_vscode.workspace.textDocuments.some(
18637
+ (document) => document.isDirty && touched.has(document.uri.toString())
18638
+ );
18639
+ }
18640
+ async function applyCommandWorkspaceEdit(command, result, args) {
18641
+ const changes = collectWorkspaceEditChanges(result);
18642
+ if (!changes) {
18643
+ return;
18644
+ }
18645
+ if (commandArgumentsContainDirtyDocument(args) || workspaceEditChangesTouchDirtyURI(changes, dirtyDocumentURIs())) {
18646
+ showDiskBackedCommandWarning();
18647
+ return;
18648
+ }
18649
+ const edit = workspaceEditFromChanges(changes);
18650
+ const applied = await import_vscode.workspace.applyEdit(edit);
18651
+ if (!applied) {
18652
+ import_vscode.window.showWarningMessage(
18653
+ `ttsc command ${command} could not apply the returned edits.`
18654
+ );
18655
+ }
18656
+ }
18657
+ function workspaceEditFromChanges(changes) {
18658
+ const edit = new import_vscode.WorkspaceEdit();
18659
+ for (const textEdit of changes) {
18660
+ edit.replace(
18661
+ import_vscode.Uri.parse(textEdit.uri),
18662
+ new import_vscode.Range(
18663
+ textEdit.range.start.line,
18664
+ textEdit.range.start.character,
18665
+ textEdit.range.end.line,
18666
+ textEdit.range.end.character
18667
+ ),
18668
+ textEdit.newText
18669
+ );
18670
+ }
18671
+ return edit;
18672
+ }
18673
+ function commandArgumentsContainDirtyDocument(args) {
18674
+ return commandArgumentsContainDirtyURI(args, dirtyDocumentURIs());
18675
+ }
18676
+ function dirtyDocumentURIs() {
18677
+ return new Set(
18678
+ import_vscode.workspace.textDocuments.filter((document) => document.isDirty).map((document) => document.uri.toString())
18679
+ );
18680
+ }
18681
+ function showDiskBackedCommandWarning() {
18682
+ import_vscode.window.showWarningMessage(
18683
+ "ttsc plugin fixes and formatting use the saved project state. Save the file before running this command."
18684
+ );
18685
+ }
18686
+ function resolveCommandTarget(uriArg) {
18687
+ if (uriArg instanceof import_vscode.Uri) {
18688
+ return uriArg;
18689
+ }
18690
+ if (typeof uriArg === "string") {
18691
+ return path2.isAbsolute(uriArg) ? import_vscode.Uri.file(uriArg) : import_vscode.Uri.parse(uriArg);
18692
+ }
18693
+ return import_vscode.window.activeTextEditor?.document.uri;
18694
+ }
18695
+ function clientEntryForUri(uri) {
18696
+ if (uri.scheme !== "file") return void 0;
18697
+ const root = selectDeepestRootForPath(
18698
+ uri.fsPath,
18699
+ [...clients.values()].map((entry) => entry.root)
18700
+ );
18701
+ return root ? clients.get(rootKey(root)) : void 0;
18702
+ }
18703
+ async function ensureClientForUri(uri, traceChannel) {
18704
+ await enqueueClientReconciliation(async () => {
18705
+ const spec = resolveServerLaunchSpecForUri(uri);
18706
+ if (!spec || clients.has(spec.id)) return;
18707
+ await stopClientRoots(rootsToStopForTarget(clientRoots(), spec.cwd));
18708
+ await startClient(spec, traceChannel);
18709
+ });
18710
+ }
18711
+ async function reconcileClientsForDocuments(documents, traceChannel, fallbackSpecs = [], preferredUri) {
18712
+ const active = preferredUri && preferredUri.scheme === "file" ? { languageId: "", uri: preferredUri } : import_vscode.window.activeTextEditor?.document;
18713
+ const activeUri = active && (active.languageId === "" || isSupportedDocument(active)) ? active.uri : void 0;
18714
+ const orderedDocuments = documents.filter(isSupportedDocument).filter((document) => document.uri.toString() !== activeUri?.toString()).sort((left, right) => left.uri.fsPath.localeCompare(right.uri.fsPath));
18715
+ const specs = /* @__PURE__ */ new Map();
18716
+ const pushSpec = (spec) => {
18717
+ if (spec && !specs.has(spec.id)) {
18718
+ specs.set(spec.id, spec);
18719
+ }
18720
+ };
18721
+ if (activeUri) {
18722
+ pushSpec(resolveServerLaunchSpecForUri(activeUri));
18723
+ }
18724
+ for (const document of orderedDocuments) {
18725
+ pushSpec(resolveServerLaunchSpecForUri(document.uri));
18726
+ }
18727
+ for (const spec of fallbackSpecs) {
18728
+ pushSpec(spec);
18729
+ }
18730
+ const plannedRoots = planNonOverlappingClientRoots(
18731
+ [...specs.values()].map((spec) => spec.cwd),
18732
+ activeUri ? resolveServerLaunchSpecForUri(activeUri)?.cwd : void 0
18733
+ );
18734
+ await stopClientRoots(rootsToStopForPlan(clientRoots(), plannedRoots));
18735
+ for (const root of plannedRoots) {
18736
+ const spec = specs.get(rootKey(root));
18737
+ if (spec && !clients.has(spec.id)) {
18738
+ await startClient(spec, traceChannel);
18739
+ }
18740
+ }
18741
+ }
18742
+ async function enqueueClientReconciliation(task) {
18743
+ const guarded = async () => {
18744
+ if (deactivating) {
18745
+ return;
18746
+ }
18747
+ await task();
18748
+ };
18749
+ const run = reconcileQueue.then(guarded, guarded);
18750
+ const handled = run.catch((error) => {
18751
+ import_vscode.window.showErrorMessage(`ttsc: language server planning failed \u2014 ${error}`);
18752
+ });
18753
+ reconcileQueue = handled;
18754
+ await handled;
18755
+ }
18756
+ function documentsOutsideRoots(documents, roots) {
18757
+ if (roots.length === 0) {
18758
+ return [...documents];
18759
+ }
18760
+ return documents.filter(
18761
+ (document) => document.uri.scheme !== "file" || !roots.some((root) => isPathInsideRoot(document.uri.fsPath, root))
18762
+ );
18763
+ }
18764
+ function clientRoots() {
18765
+ return [...clients.values()].map((entry) => entry.root);
18766
+ }
18767
+ async function stopClientRoots(roots) {
18768
+ const results = await Promise.allSettled(
18769
+ roots.map((root) => stopClientRoot(root))
18770
+ );
18771
+ for (const result of results) {
18772
+ if (result.status === "rejected") {
18773
+ sharedTraceChannel?.appendLine(
18774
+ `ttsc: failed to stop language server: ${result.reason}`
18775
+ );
18776
+ }
18777
+ }
18778
+ }
18779
+ async function stopClientRoot(root) {
18780
+ const key = rootKey(root);
18781
+ const entry = clients.get(key);
18782
+ if (!entry) {
18783
+ return;
18784
+ }
18785
+ clients.delete(key);
18786
+ await entry.client.stop();
18787
+ }
18788
+ function isSupportedDocument(document) {
18789
+ return document.uri.scheme === "file" && ["typescript", "typescriptreact", "javascript", "javascriptreact"].includes(
18790
+ document.languageId
18791
+ );
18792
+ }
18793
+ async function startClient(spec, traceChannel) {
18794
+ const client = new import_node.LanguageClient(
18795
+ "ttsc",
18796
+ spec.name,
18797
+ spec.serverOptions,
18798
+ buildClientOptions(traceChannel, spec)
18799
+ );
18800
+ const ready = client.start().catch((error) => {
18801
+ if (clients.get(spec.id)?.client === client) {
18802
+ clients.delete(spec.id);
18803
+ }
18804
+ import_vscode.window.showErrorMessage(
18805
+ `ttsc: failed to start language server for ${spec.cwd} \u2014 ${error}`
18806
+ );
18807
+ throw error;
18808
+ });
18809
+ clients.set(spec.id, { client, ready, root: spec.cwd });
18810
+ try {
18811
+ await ready;
18812
+ } catch (error) {
18813
+ }
18240
18814
  }
18241
18815
  async function activate(context) {
18242
- const serverOptions = resolveServerLauncher();
18243
- if (!serverOptions) {
18816
+ deactivating = false;
18817
+ const specs = resolveServerLaunchSpecs();
18818
+ if (specs.length === 0) {
18244
18819
  import_vscode.window.showErrorMessage(
18245
- "ttsc: could not resolve ttscserver from any workspace folder. Set ttsc.serverPath to an absolute path."
18820
+ "ttsc: could not resolve ttscserver from the active file or any workspace folder. Set ttsc.serverPath to an absolute path."
18246
18821
  );
18247
- return;
18248
18822
  }
18249
18823
  const traceChannel = import_vscode.window.createOutputChannel("ttsc (trace)");
18824
+ sharedTraceChannel = traceChannel;
18250
18825
  context.subscriptions.push(traceChannel);
18251
- client = new import_node.LanguageClient(
18252
- "ttsc",
18253
- "ttsc",
18254
- serverOptions,
18255
- buildClientOptions(traceChannel)
18256
- );
18257
18826
  context.subscriptions.push(
18258
- import_vscode.commands.registerCommand("ttsc.lint.fixAll", async () => {
18259
- const uri = activeUri();
18260
- if (uri) await executeServerCommand("ttsc.lint.fixAll", uri);
18827
+ import_vscode.commands.registerCommand(
18828
+ "ttsc.lint.fixAll",
18829
+ (uri) => executeServerCommand("ttsc.lint.fixAll", uri)
18830
+ ),
18831
+ import_vscode.commands.registerCommand(
18832
+ "ttsc.format.document",
18833
+ (uri) => executeServerCommand("ttsc.format.document", uri)
18834
+ ),
18835
+ import_vscode.commands.registerCommand("ttsc.server.restart", async () => {
18836
+ await enqueueClientReconciliation(async () => {
18837
+ const active = import_vscode.window.activeTextEditor?.document;
18838
+ const activeUri = active && isSupportedDocument(active) ? active.uri : void 0;
18839
+ await stopClientRoots(clientRoots());
18840
+ await reconcileClientsForDocuments(
18841
+ import_vscode.workspace.textDocuments,
18842
+ traceChannel,
18843
+ resolveServerLaunchSpecs(),
18844
+ activeUri
18845
+ );
18846
+ if (clients.size === 0) {
18847
+ import_vscode.window.showWarningMessage(
18848
+ "ttsc: language server is not running for any open file."
18849
+ );
18850
+ } else {
18851
+ import_vscode.window.showInformationMessage("ttsc: language server restarted.");
18852
+ }
18853
+ });
18854
+ }),
18855
+ import_vscode.workspace.onDidOpenTextDocument((document) => {
18856
+ if (!isSupportedDocument(document)) return;
18857
+ void enqueueClientReconciliation(
18858
+ () => reconcileClientsForDocuments(
18859
+ import_vscode.workspace.textDocuments,
18860
+ traceChannel,
18861
+ [],
18862
+ document.uri
18863
+ )
18864
+ );
18261
18865
  }),
18262
- import_vscode.commands.registerCommand("ttsc.format.document", async () => {
18263
- const uri = activeUri();
18264
- if (uri) await executeServerCommand("ttsc.format.document", uri);
18866
+ import_vscode.workspace.onDidCloseTextDocument((document) => {
18867
+ if (!isSupportedDocument(document)) return;
18868
+ void enqueueClientReconciliation(
18869
+ () => reconcileClientsForDocuments(import_vscode.workspace.textDocuments, traceChannel)
18870
+ );
18265
18871
  }),
18266
- import_vscode.commands.registerCommand("ttsc.server.restart", async () => {
18267
- if (!client) {
18268
- import_vscode.window.showWarningMessage("ttsc: language server is not running.");
18872
+ import_vscode.window.onDidChangeActiveTextEditor((editor) => {
18873
+ const document = editor?.document;
18874
+ void enqueueClientReconciliation(
18875
+ () => reconcileClientsForDocuments(
18876
+ import_vscode.workspace.textDocuments,
18877
+ traceChannel,
18878
+ [],
18879
+ document && isSupportedDocument(document) ? document.uri : void 0
18880
+ )
18881
+ );
18882
+ }),
18883
+ import_vscode.workspace.onDidChangeWorkspaceFolders((event) => {
18884
+ void enqueueClientReconciliation(async () => {
18885
+ const removedFolders = event.removed.filter((folder) => folder.uri.scheme === "file").map((folder) => folder.uri.fsPath);
18886
+ const removedRoots = [];
18887
+ for (const folder of event.removed) {
18888
+ if (folder.uri.scheme !== "file") continue;
18889
+ removedRoots.push(
18890
+ ...rootsInsideRemovedWorkspace(clientRoots(), folder.uri.fsPath)
18891
+ );
18892
+ }
18893
+ await stopClientRoots(removedRoots);
18894
+ const addedRoots = event.added.filter((folder) => folder.uri.scheme === "file").map((folder) => folder.uri.fsPath);
18895
+ const addedSpecs = createServerLaunchSpecs(
18896
+ createResolutionCandidates({ workspaceRoots: addedRoots })
18897
+ );
18898
+ await reconcileClientsForDocuments(
18899
+ documentsOutsideRoots(import_vscode.workspace.textDocuments, removedFolders),
18900
+ traceChannel,
18901
+ addedSpecs
18902
+ );
18903
+ });
18904
+ }),
18905
+ import_vscode.workspace.onDidChangeConfiguration((event) => {
18906
+ if (!event.affectsConfiguration("ttsc.serverPath")) {
18269
18907
  return;
18270
18908
  }
18271
- try {
18272
- await client.restart();
18273
- import_vscode.window.showInformationMessage("ttsc: language server restarted.");
18274
- } catch (error) {
18275
- import_vscode.window.showErrorMessage(`ttsc: restart failed \u2014 ${error}`);
18276
- }
18909
+ void enqueueClientReconciliation(async () => {
18910
+ const active = import_vscode.window.activeTextEditor?.document;
18911
+ const activeUri = active && isSupportedDocument(active) ? active.uri : void 0;
18912
+ await stopClientRoots(clientRoots());
18913
+ await reconcileClientsForDocuments(
18914
+ import_vscode.workspace.textDocuments,
18915
+ traceChannel,
18916
+ resolveServerLaunchSpecs(),
18917
+ activeUri
18918
+ );
18919
+ });
18277
18920
  })
18278
18921
  );
18279
- try {
18280
- await client.start();
18281
- } catch (error) {
18282
- import_vscode.window.showErrorMessage(`ttsc: failed to start language server \u2014 ${error}`);
18283
- }
18922
+ await enqueueClientReconciliation(
18923
+ () => reconcileClientsForDocuments(import_vscode.workspace.textDocuments, traceChannel, specs)
18924
+ );
18284
18925
  }
18285
18926
  async function deactivate() {
18286
- if (!client) return;
18287
- try {
18288
- await client.stop();
18289
- } finally {
18290
- client = void 0;
18291
- }
18927
+ deactivating = true;
18928
+ const teardown = reconcileQueue.then(async () => {
18929
+ const stopping = [...clients.values()].map(
18930
+ (entry) => entry.client.stop()
18931
+ );
18932
+ clients.clear();
18933
+ const results = await Promise.allSettled(stopping);
18934
+ for (const result of results) {
18935
+ if (result.status === "rejected") {
18936
+ sharedTraceChannel?.appendLine(
18937
+ `ttsc: failed to stop language server during deactivate: ${result.reason}`
18938
+ );
18939
+ }
18940
+ }
18941
+ }).finally(() => {
18942
+ sharedTraceChannel = void 0;
18943
+ });
18944
+ reconcileQueue = teardown.catch(() => {
18945
+ });
18946
+ await teardown;
18292
18947
  }
18293
18948
  // Annotate the CommonJS export names for ESM import in node:
18294
18949
  0 && (module.exports = {
18295
18950
  activate,
18296
18951
  deactivate
18297
18952
  });
18298
- //# sourceMappingURL=extension.js.map