@rohal12/spindle-lsp 0.15.18 → 0.15.19

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.18";
58
+ VERSION = false ? pkg.version : "0.15.19";
59
59
  }
60
60
  });
61
61
 
@@ -35166,15 +35166,17 @@ function parentDiagnostics(passage, token, ancestors, workspace) {
35166
35166
  return [makeDiag(range2, DiagnosticCode.InvalidChildren, `Invalid: {${token.name}} can only be inside {${parentList}}`)];
35167
35167
  }
35168
35168
  function childDiagnostics(passage, node, token, workspace) {
35169
- const constraints = workspace.getEffectiveMacro(token.name)?.children;
35169
+ const macro = workspace.getEffectiveMacro(token.name);
35170
+ const constraints = macro?.children;
35170
35171
  if (!constraints || constraints.length === 0 || !node.body?.close) return [];
35171
35172
  const direct = [...node.body.children];
35172
35173
  for (const branch of node.body.branches) direct.push({ token: branch.tag, start: branch.tag.start, end: branch.tag.end }, ...branch.children);
35174
+ const consumesOptions = macro?.source === "builtin" && ["listbox", "cycle"].includes(token.name.toLowerCase());
35173
35175
  const counts = /* @__PURE__ */ Object.create(null);
35174
35176
  for (const child of direct) {
35175
35177
  if (child.token.type !== "macro" || child.token.isClose) continue;
35176
35178
  const key = child.token.name.toLowerCase();
35177
- if (workspace.getEffectiveMacro(key)) counts[key] = (counts[key] ?? 0) + 1;
35179
+ if (consumesOptions && key === "option" || workspace.getEffectiveMacro(key)) counts[key] = (counts[key] ?? 0) + 1;
35178
35180
  }
35179
35181
  const diagnostics = [];
35180
35182
  const range2 = passage.range(token.start, token.end);