@rohal12/spindle-lsp 0.15.48 → 0.15.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js CHANGED
@@ -55,7 +55,7 @@ var VERSION;
55
55
  var init_version = __esm({
56
56
  "src/version.ts"() {
57
57
  "use strict";
58
- VERSION = false ? pkg.version : "0.15.48";
58
+ VERSION = false ? pkg.version : "0.15.50";
59
59
  }
60
60
  });
61
61
 
@@ -35952,13 +35952,21 @@ function readText2(text3) {
35952
35952
  }
35953
35953
  return new DocumentMarkup(TEXT_URI, text3, passages, TEXT_CONTEXT);
35954
35954
  }
35955
+ function bracketLinksByTarget(passage) {
35956
+ let index = bracketLinks.get(passage);
35957
+ if (!index) {
35958
+ index = new Map(passage.tokens.flatMap((token) => token.type === "link" ? [[token.targetStart, token]] : []));
35959
+ bracketLinks.set(passage, index);
35960
+ }
35961
+ return index;
35962
+ }
35955
35963
  function findLinkRuntimeMismatches(text3) {
35956
35964
  if (!(typeof text3 === "string" ? text3 : text3.text).includes("[[")) return [];
35957
35965
  const found = [];
35958
35966
  for (const ref2 of documentPassageRefs(markupOfText(text3))) {
35959
35967
  if (ref2.form !== "bracket") continue;
35960
- const link = ref2.passage.tokens.find((token) => token.type === "link" && token.targetStart === ref2.start);
35961
- if (link?.type !== "link") continue;
35968
+ const link = bracketLinksByTarget(ref2.passage).get(ref2.start);
35969
+ if (!link) continue;
35962
35970
  const runtime = bracketLinkMismatch(link.display, link.target);
35963
35971
  if (!runtime) continue;
35964
35972
  found.push({ range: ref2.passage.range(link.start, link.end), display: link.display, target: link.target, runtime });
@@ -35984,7 +35992,7 @@ function findLiteralLinkInterpolations(text3) {
35984
35992
  }
35985
35993
  return found;
35986
35994
  }
35987
- var TEXT_URI, TEXT_CONTEXT, lastMarkup;
35995
+ var TEXT_URI, TEXT_CONTEXT, lastMarkup, bracketLinks;
35988
35996
  var init_link_parser = __esm({
35989
35997
  "src/core/parsing/link-parser.ts"() {
35990
35998
  "use strict";
@@ -35995,6 +36003,7 @@ var init_link_parser = __esm({
35995
36003
  init_passage_refs();
35996
36004
  TEXT_URI = "memory:///text.tw";
35997
36005
  TEXT_CONTEXT = { macros: builtinMacros, isBlock: isBlockMacro };
36006
+ bracketLinks = /* @__PURE__ */ new WeakMap();
35998
36007
  }
35999
36008
  });
36000
36009
 
@@ -36019,35 +36028,38 @@ function computeDiagnostics(uri, workspace, options) {
36019
36028
  const diagnostics = [...tweeDiagnostics(doc)];
36020
36029
  if (doc.passages.length === 0) return diagnostics;
36021
36030
  const attempt = (check2) => {
36031
+ let batch;
36022
36032
  try {
36023
- check2();
36033
+ batch = check2();
36024
36034
  } catch {
36035
+ return;
36025
36036
  }
36037
+ for (const diagnostic of batch) diagnostics.push(diagnostic);
36026
36038
  };
36027
36039
  const story = storyReport(workspace);
36028
- diagnostics.push(...story.metadata.get(doc) ?? []);
36040
+ for (const diagnostic of story.metadata.get(doc) ?? []) diagnostics.push(diagnostic);
36029
36041
  const effective = new Set(workspace.passages.getEffectivePassages());
36030
36042
  let passageNames;
36031
36043
  const getPassageNames = () => passageNames ??= [...effective].filter(isRuntimePassage).map((passage) => passage.name);
36032
36044
  for (const passage of doc.passages) {
36033
36045
  if (!effective.has(passage.passage)) continue;
36034
- attempt(() => diagnostics.push(...markupDiagnostics(passage, story, workspace)));
36035
- attempt(() => diagnostics.push(...variableDiagnostics(passage, story)));
36036
- attempt(() => diagnostics.push(...structureDiagnostics(passage, workspace)));
36037
- attempt(() => diagnostics.push(...argumentDiagnostics(passage, workspace, getPassageNames)));
36038
- attempt(() => diagnostics.push(...widgetDiagnostics(passage, story, workspace)));
36039
- }
36040
- attempt(() => diagnostics.push(...versionDiagnostics(uri, doc, workspace)));
36041
- attempt(() => diagnostics.push(...storyVariablesDiagnostics(uri, doc, story, workspace)));
36042
- attempt(() => diagnostics.push(...arrayMemberDiagnostics(uri, workspace)));
36043
- attempt(() => diagnostics.push(...linkDiagnostics(doc).filter((diagnostic) => {
36046
+ attempt(() => markupDiagnostics(passage, story, workspace));
36047
+ attempt(() => variableDiagnostics(passage, story));
36048
+ attempt(() => structureDiagnostics(passage, story, workspace));
36049
+ attempt(() => argumentDiagnostics(passage, workspace, getPassageNames));
36050
+ attempt(() => widgetDiagnostics(passage, story, workspace));
36051
+ }
36052
+ attempt(() => versionDiagnostics(uri, doc, workspace));
36053
+ attempt(() => storyVariablesDiagnostics(uri, doc, story, workspace));
36054
+ attempt(() => arrayMemberDiagnostics(uri, workspace));
36055
+ attempt(() => linkDiagnostics(doc).filter((diagnostic) => {
36044
36056
  const passage = doc.passageAt(diagnostic.range.start);
36045
36057
  return passage !== void 0 && effective.has(passage.passage);
36046
- })));
36047
- attempt(() => diagnostics.push(...unusedWidgetDiagnostics(doc, story)));
36058
+ }));
36059
+ attempt(() => unusedWidgetDiagnostics(doc, story));
36048
36060
  if (options?.maxLineLength) {
36049
36061
  const maxLength = options.maxLineLength;
36050
- attempt(() => diagnostics.push(...lineLengthDiagnostics(doc, maxLength)));
36062
+ attempt(() => lineLengthDiagnostics(doc, maxLength));
36051
36063
  }
36052
36064
  return diagnostics.sort((a, b) => a.range.start.line - b.range.start.line || a.range.start.character - b.range.start.character);
36053
36065
  }
@@ -36136,6 +36148,7 @@ function buildReport(documents, workspace) {
36136
36148
  metadata: storyDataDiagnostics(documents, workspace),
36137
36149
  passages,
36138
36150
  macros,
36151
+ toolingChildren: new Set(workspace.macros.getAllMacros().filter((macro) => macro.source === "user").flatMap((macro) => macro.subMacros.map((name) => name.toLowerCase()))),
36139
36152
  markup,
36140
36153
  widgets,
36141
36154
  widgetList,
@@ -36308,15 +36321,15 @@ function versionDiagnostics(uri, doc, workspace) {
36308
36321
  const first = doc.passages[0].passage;
36309
36322
  return [makeDiag({ start: first.range.start, end: first.headerEnd.end }, DiagnosticCode.UnsupportedSpindleVersion, unsupportedVersionMessage(target))];
36310
36323
  }
36311
- function structureDiagnostics(passage, workspace) {
36324
+ function structureDiagnostics(passage, story, workspace) {
36312
36325
  const diagnostics = [];
36313
36326
  if (!passage.isMarkup) return diagnostics;
36314
36327
  const visit2 = (nodes, ancestors) => {
36315
36328
  for (const node2 of nodes) {
36316
36329
  const token = node2.token;
36317
36330
  if (token.type === "macro" && !token.isClose) {
36318
- diagnostics.push(...parentDiagnostics(passage, token, ancestors, workspace));
36319
- diagnostics.push(...childDiagnostics(passage, node2, token, workspace));
36331
+ diagnostics.push(...parentDiagnostics(passage, token, ancestors, story, workspace));
36332
+ for (const diagnostic of childDiagnostics(passage, node2, token, workspace)) diagnostics.push(diagnostic);
36320
36333
  diagnostics.push(...loopDiagnostics(passage, token, ancestors, workspace));
36321
36334
  }
36322
36335
  if (!node2.body) continue;
@@ -36336,11 +36349,11 @@ function structureDiagnostics(passage, workspace) {
36336
36349
  }
36337
36350
  return diagnostics;
36338
36351
  }
36339
- function parentDiagnostics(passage, token, ancestors, workspace) {
36352
+ function parentDiagnostics(passage, token, ancestors, story, workspace) {
36340
36353
  const name = token.name.toLowerCase();
36341
36354
  const parents = workspace.getEffectiveMacro(name)?.parents;
36342
36355
  if (!parents || parents.length === 0 || BRANCH_MACROS2.has(name)) return [];
36343
- if (workspace.macros.getAllMacros().some((macro) => macro.source === "user" && macro.subMacros.some((sub) => sub.toLowerCase() === name))) return [];
36356
+ if (story.toolingChildren.has(name)) return [];
36344
36357
  const allowed = new Set(parents.map((parent) => parent.toLowerCase()));
36345
36358
  const parentList = parents.join(", ");
36346
36359
  const range2 = passage.range(token.start, token.end);
@@ -80468,10 +80481,11 @@ var require_connection = __commonJS({
80468
80481
  } finally {
80469
80482
  if (result2 instanceof Promise) {
80470
80483
  result2.then(() => {
80471
- inFlight--;
80472
- triggerMessageQueue();
80473
80484
  }).catch((error62) => {
80474
80485
  logger.error(`Processing message queue failed: ${error62.toString()}`);
80486
+ }).finally(() => {
80487
+ inFlight--;
80488
+ triggerMessageQueue();
80475
80489
  });
80476
80490
  } else {
80477
80491
  inFlight--;
@@ -81676,7 +81690,7 @@ var init_main = __esm({
81676
81690
  ColorPresentation2.create = create;
81677
81691
  function is2(value) {
81678
81692
  const candidate = value;
81679
- return Is2.objectLiteral(candidate) && Is2.string(candidate.label) && (Is2.undefined(candidate.textEdit) || TextEdit.is(candidate)) && (Is2.undefined(candidate.additionalTextEdits) || Is2.typedArray(candidate.additionalTextEdits, TextEdit.is));
81693
+ return Is2.objectLiteral(candidate) && Is2.string(candidate.label) && (Is2.undefined(candidate.textEdit) || TextEdit.is(candidate.textEdit)) && (Is2.undefined(candidate.additionalTextEdits) || Is2.typedArray(candidate.additionalTextEdits, TextEdit.is));
81680
81694
  }
81681
81695
  ColorPresentation2.is = is2;
81682
81696
  })(ColorPresentation || (ColorPresentation = {}));
@@ -81708,7 +81722,7 @@ var init_main = __esm({
81708
81722
  FoldingRange2.create = create;
81709
81723
  function is2(value) {
81710
81724
  const candidate = value;
81711
- return Is2.objectLiteral(candidate) && Is2.uinteger(candidate.startLine) && Is2.uinteger(candidate.startLine) && (Is2.undefined(candidate.startCharacter) || Is2.uinteger(candidate.startCharacter)) && (Is2.undefined(candidate.endCharacter) || Is2.uinteger(candidate.endCharacter)) && (Is2.undefined(candidate.kind) || Is2.string(candidate.kind));
81725
+ return Is2.objectLiteral(candidate) && Is2.uinteger(candidate.startLine) && Is2.uinteger(candidate.endLine) && (Is2.undefined(candidate.startCharacter) || Is2.uinteger(candidate.startCharacter)) && (Is2.undefined(candidate.endCharacter) || Is2.uinteger(candidate.endCharacter)) && (Is2.undefined(candidate.kind) || Is2.string(candidate.kind));
81712
81726
  }
81713
81727
  FoldingRange2.is = is2;
81714
81728
  })(FoldingRange || (FoldingRange = {}));
@@ -84767,98 +84781,6 @@ var require_api2 = __commonJS({
84767
84781
  }
84768
84782
  });
84769
84783
 
84770
- // node_modules/vscode-languageserver/lib/common/utils/uuid.js
84771
- var require_uuid = __commonJS({
84772
- "node_modules/vscode-languageserver/lib/common/utils/uuid.js"(exports) {
84773
- "use strict";
84774
- Object.defineProperty(exports, "__esModule", { value: true });
84775
- exports.empty = void 0;
84776
- exports.v4 = v4;
84777
- exports.isUUID = isUUID;
84778
- exports.parse = parse6;
84779
- exports.generateUuid = generateUuid;
84780
- var ValueUUID = class {
84781
- _value;
84782
- constructor(_value) {
84783
- this._value = _value;
84784
- }
84785
- asHex() {
84786
- return this._value;
84787
- }
84788
- equals(other) {
84789
- return this.asHex() === other.asHex();
84790
- }
84791
- };
84792
- var V4UUID = class _V4UUID extends ValueUUID {
84793
- static _chars = ["0", "1", "2", "3", "4", "5", "6", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
84794
- static _timeHighBits = ["8", "9", "a", "b"];
84795
- static _oneOf(array2) {
84796
- return array2[Math.floor(array2.length * Math.random())];
84797
- }
84798
- static _randomHex() {
84799
- return _V4UUID._oneOf(_V4UUID._chars);
84800
- }
84801
- constructor() {
84802
- super([
84803
- _V4UUID._randomHex(),
84804
- _V4UUID._randomHex(),
84805
- _V4UUID._randomHex(),
84806
- _V4UUID._randomHex(),
84807
- _V4UUID._randomHex(),
84808
- _V4UUID._randomHex(),
84809
- _V4UUID._randomHex(),
84810
- _V4UUID._randomHex(),
84811
- "-",
84812
- _V4UUID._randomHex(),
84813
- _V4UUID._randomHex(),
84814
- _V4UUID._randomHex(),
84815
- _V4UUID._randomHex(),
84816
- "-",
84817
- "4",
84818
- _V4UUID._randomHex(),
84819
- _V4UUID._randomHex(),
84820
- _V4UUID._randomHex(),
84821
- "-",
84822
- _V4UUID._oneOf(_V4UUID._timeHighBits),
84823
- _V4UUID._randomHex(),
84824
- _V4UUID._randomHex(),
84825
- _V4UUID._randomHex(),
84826
- "-",
84827
- _V4UUID._randomHex(),
84828
- _V4UUID._randomHex(),
84829
- _V4UUID._randomHex(),
84830
- _V4UUID._randomHex(),
84831
- _V4UUID._randomHex(),
84832
- _V4UUID._randomHex(),
84833
- _V4UUID._randomHex(),
84834
- _V4UUID._randomHex(),
84835
- _V4UUID._randomHex(),
84836
- _V4UUID._randomHex(),
84837
- _V4UUID._randomHex(),
84838
- _V4UUID._randomHex()
84839
- ].join(""));
84840
- }
84841
- };
84842
- exports.empty = new ValueUUID("00000000-0000-0000-0000-000000000000");
84843
- function v4() {
84844
- return new V4UUID();
84845
- }
84846
- var _UUIDPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
84847
- function isUUID(value) {
84848
- return _UUIDPattern.test(value);
84849
- }
84850
- function parse6(value) {
84851
- if (!isUUID(value)) {
84852
- throw new Error("invalid uuid");
84853
- }
84854
- return new ValueUUID(value);
84855
- }
84856
- function generateUuid() {
84857
- return v4().asHex();
84858
- }
84859
- }
84860
- });
84861
-
84862
84784
  // node_modules/vscode-languageserver/lib/common/progress.js
84863
84785
  var require_progress = __commonJS({
84864
84786
  "node_modules/vscode-languageserver/lib/common/progress.js"(exports) {
@@ -84868,7 +84790,6 @@ var require_progress = __commonJS({
84868
84790
  exports.attachWorkDone = attachWorkDone;
84869
84791
  exports.attachPartialResult = attachPartialResult;
84870
84792
  var vscode_languageserver_protocol_1 = require_api2();
84871
- var uuid_1 = require_uuid();
84872
84793
  var WorkDoneProgressReporter;
84873
84794
  (function(WorkDoneProgressReporter2) {
84874
84795
  function isNullInstance(reporter) {
@@ -84995,7 +84916,7 @@ var require_progress = __commonJS({
84995
84916
  }
84996
84917
  createWorkDoneProgress() {
84997
84918
  if (this._progressSupported) {
84998
- const token = (0, uuid_1.generateUuid)();
84919
+ const token = (0, vscode_languageserver_protocol_1.RAL)().crypto.randomUUID();
84999
84920
  return this.connection.sendRequest(vscode_languageserver_protocol_1.WorkDoneProgressCreateRequest.type, { token }).then(() => {
85000
84921
  const result2 = new WorkDoneProgressServerReporterImpl(this.connection, token);
85001
84922
  return result2;
@@ -86054,6 +85975,11 @@ var require_notebook = __commonJS({
86054
85975
  }
86055
85976
  }
86056
85977
  }
85978
+ const removed = [];
85979
+ for (const close of closed) {
85980
+ removed.push(this.getNotebookCell(close));
85981
+ this.notebookCellMap.delete(close);
85982
+ }
86057
85983
  this.updateCellMap(notebookDocument);
86058
85984
  const changeEvent = { notebookDocument };
86059
85985
  if (metadataChanged) {
@@ -86063,10 +85989,6 @@ var require_notebook = __commonJS({
86063
85989
  for (const open2 of opened) {
86064
85990
  added.push(this.getNotebookCell(open2));
86065
85991
  }
86066
- const removed = [];
86067
- for (const close of closed) {
86068
- removed.push(this.getNotebookCell(close));
86069
- }
86070
85992
  const textContent = [];
86071
85993
  for (const change2 of text3) {
86072
85994
  textContent.push(this.getNotebookCell(change2));
@@ -86244,7 +86166,6 @@ var require_server = __commonJS({
86244
86166
  exports.createConnection = createConnection2;
86245
86167
  var vscode_languageserver_protocol_1 = require_api2();
86246
86168
  var Is3 = __importStar(require_is());
86247
- var UUID = __importStar(require_uuid());
86248
86169
  var progress_1 = require_progress();
86249
86170
  var configuration_1 = require_configuration();
86250
86171
  var workspaceFolder_1 = require_workspaceFolder();
@@ -86388,7 +86309,7 @@ var require_server = __commonJS({
86388
86309
  if (this._registered.has(method)) {
86389
86310
  throw new Error(`${method} is already added to this registration`);
86390
86311
  }
86391
- const id = UUID.generateUuid();
86312
+ const id = (0, vscode_languageserver_protocol_1.RAL)().crypto.randomUUID();
86392
86313
  this._registrations.push({
86393
86314
  id,
86394
86315
  method,
@@ -86482,7 +86403,7 @@ var require_server = __commonJS({
86482
86403
  }
86483
86404
  registerSingle1(unregistration, type, registerOptions) {
86484
86405
  const method = Is3.string(type) ? type : type.method;
86485
- const id = UUID.generateUuid();
86406
+ const id = (0, vscode_languageserver_protocol_1.RAL)().crypto.randomUUID();
86486
86407
  const params = {
86487
86408
  registrations: [{ id, method, registerOptions: registerOptions || {} }]
86488
86409
  };
@@ -86499,7 +86420,7 @@ var require_server = __commonJS({
86499
86420
  }
86500
86421
  registerSingle2(type, registerOptions) {
86501
86422
  const method = Is3.string(type) ? type : type.method;
86502
- const id = UUID.generateUuid();
86423
+ const id = (0, vscode_languageserver_protocol_1.RAL)().crypto.randomUUID();
86503
86424
  const params = {
86504
86425
  registrations: [{ id, method, registerOptions: registerOptions || {} }]
86505
86426
  };
@@ -87129,7 +87050,6 @@ var require_files = __commonJS({
87129
87050
  });
87130
87051
  }
87131
87052
  function resolveGlobalNodePath(tracer) {
87132
- let npmCommand = "npm";
87133
87053
  const env = /* @__PURE__ */ Object.create(null);
87134
87054
  Object.keys(process.env).forEach((key) => env[key] = process.env[key]);
87135
87055
  env["NO_UPDATE_NOTIFIER"] = "true";
@@ -87138,14 +87058,13 @@ var require_files = __commonJS({
87138
87058
  env
87139
87059
  };
87140
87060
  if (isWindows()) {
87141
- npmCommand = "npm.cmd";
87142
87061
  options.shell = true;
87143
87062
  }
87144
87063
  const handler = () => {
87145
87064
  };
87146
87065
  try {
87147
87066
  process.on("SIGPIPE", handler);
87148
- const stdout = (0, child_process_1.spawnSync)(npmCommand, ["config", "get", "prefix"], options).stdout;
87067
+ const stdout = (isWindows() ? (0, child_process_1.spawnSync)("npm.cmd config get prefix", options) : (0, child_process_1.spawnSync)("npm", ["config", "get", "prefix"], options)).stdout;
87149
87068
  if (!stdout) {
87150
87069
  if (tracer) {
87151
87070
  tracer(`'npm config get prefix' didn't return a value.`);
@@ -87171,19 +87090,17 @@ var require_files = __commonJS({
87171
87090
  }
87172
87091
  }
87173
87092
  function resolveGlobalYarnPath(tracer) {
87174
- let yarnCommand = "yarn";
87175
87093
  const options = {
87176
87094
  encoding: "utf8"
87177
87095
  };
87178
87096
  if (isWindows()) {
87179
- yarnCommand = "yarn.cmd";
87180
87097
  options.shell = true;
87181
87098
  }
87182
87099
  const handler = () => {
87183
87100
  };
87184
87101
  try {
87185
87102
  process.on("SIGPIPE", handler);
87186
- const results = (0, child_process_1.spawnSync)(yarnCommand, ["global", "dir", "--json"], options);
87103
+ const results = isWindows() ? (0, child_process_1.spawnSync)("yarn.cmd global dir --json", options) : (0, child_process_1.spawnSync)("yarn", ["global", "dir", "--json"], options);
87187
87104
  const stdout = results.stdout;
87188
87105
  if (!stdout) {
87189
87106
  if (tracer) {
@@ -87262,6 +87179,7 @@ var require_ril = __commonJS({
87262
87179
  "use strict";
87263
87180
  Object.defineProperty(exports, "__esModule", { value: true });
87264
87181
  var util_1 = __require("util");
87182
+ var crypto_1 = __require("crypto");
87265
87183
  var api_1 = require_api();
87266
87184
  var MessageBuffer = class _MessageBuffer extends api_1.AbstractMessageBuffer {
87267
87185
  static emptyBuffer = Buffer.allocUnsafe(0);
@@ -87285,7 +87203,7 @@ var require_ril = __commonJS({
87285
87203
  if (length === void 0) {
87286
87204
  return buffer instanceof Buffer ? buffer : Buffer.from(buffer);
87287
87205
  } else {
87288
- return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer, 0, length);
87206
+ return buffer instanceof Buffer ? buffer.slice(0, length) : Buffer.from(buffer.subarray(0, length));
87289
87207
  }
87290
87208
  }
87291
87209
  allocNative(length) {
@@ -87352,6 +87270,9 @@ var require_ril = __commonJS({
87352
87270
  }
87353
87271
  };
87354
87272
  var _ril = Object.freeze({
87273
+ crypto: Object.freeze({
87274
+ randomUUID: () => (0, crypto_1.randomUUID)()
87275
+ }),
87355
87276
  messageBuffer: Object.freeze({
87356
87277
  create: (encoding) => new MessageBuffer(encoding)
87357
87278
  }),
@@ -87502,7 +87423,7 @@ var require_main = __commonJS({
87502
87423
  this.errorCount = 0;
87503
87424
  const eventEmitter = this.process;
87504
87425
  eventEmitter.on("error", (error62) => this.fireError(error62));
87505
- eventEmitter.on("close", () => this.fireClose);
87426
+ eventEmitter.on("close", () => this.fireClose());
87506
87427
  }
87507
87428
  write(msg) {
87508
87429
  try {
@@ -87535,7 +87456,7 @@ var require_main = __commonJS({
87535
87456
  constructor(port) {
87536
87457
  super();
87537
87458
  this.onData = new api_1.Emitter();
87538
- port.on("close", () => this.fireClose);
87459
+ port.on("close", () => this.fireClose());
87539
87460
  port.on("error", (error62) => this.fireError(error62));
87540
87461
  port.on("message", (message) => {
87541
87462
  this.onData.fire(message);
@@ -87644,6 +87565,9 @@ var require_main = __commonJS({
87644
87565
  resolve8({
87645
87566
  onConnected: () => {
87646
87567
  return connected;
87568
+ },
87569
+ close: () => {
87570
+ server.close();
87647
87571
  }
87648
87572
  });
87649
87573
  });
@@ -87682,6 +87606,9 @@ var require_main = __commonJS({
87682
87606
  port: () => boundPort,
87683
87607
  onConnected: () => {
87684
87608
  return connected;
87609
+ },
87610
+ close: () => {
87611
+ server.close();
87685
87612
  }
87686
87613
  });
87687
87614
  });
@@ -90171,9 +90098,12 @@ function addMacroToConfig(uri, macroName, workspace, options) {
90171
90098
  return null;
90172
90099
  }
90173
90100
  }
90174
- const edit = configPath.toLowerCase().endsWith(".json") ? addMacroToJsonConfig(text3, macroName) : addMacroToYamlConfig(text3, macroName);
90175
- if (!edit) return null;
90176
- return { ...action, edits: [{ uri: configUri, ...edit }] };
90101
+ try {
90102
+ const edit = configPath.toLowerCase().endsWith(".json") ? addMacroToJsonConfig(text3, macroName) : addMacroToYamlConfig(text3, macroName);
90103
+ return edit ? { ...action, edits: [{ uri: configUri, ...edit }] } : null;
90104
+ } catch {
90105
+ return null;
90106
+ }
90177
90107
  }
90178
90108
  function resolveConfigRoot(uri, workspaceRoot) {
90179
90109
  if (workspaceRoot) {