@rohal12/spindle-lsp 0.15.8 → 0.15.9

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.8";
58
+ VERSION = false ? pkg.version : "0.15.9";
59
59
  }
60
60
  });
61
61
 
@@ -31645,6 +31645,10 @@ var init_macro_registry2 = __esm({
31645
31645
  getMacro(name) {
31646
31646
  return this.resolve(name.toLowerCase());
31647
31647
  }
31648
+ /** A project's explicit schema takes precedence over runtime signature metadata. */
31649
+ hasConfiguredParameters(name) {
31650
+ return this.configEntries.get(name.toLowerCase())?.parameters !== void 0;
31651
+ }
31648
31652
  /** Check if a macro is a block (container) macro. */
31649
31653
  isBlock(name) {
31650
31654
  return this.getMacro(name)?.block ?? false;
@@ -32653,11 +32657,7 @@ var init_macro_supplements = __esm({
32653
32657
  },
32654
32658
  computed: {
32655
32659
  name: "computed",
32656
- description: "Evaluates an expression and outputs the result.\n\nUsage: `{computed expression}`",
32657
- parameters: ["...text"],
32658
- parameterDocs: [
32659
- { name: "expression", documentation: "Expression whose result is output." }
32660
- ]
32660
+ description: "Assigns an expression's value to a variable and recomputes it when its dependencies change. The target must be a story ($), temporary (_) or local (@) variable. This macro produces no output; display the variable to show its value.\n\nUsage: `{computed _total = 1 + 2}Value: {_total}`"
32661
32661
  },
32662
32662
  print: {
32663
32663
  name: "print",
@@ -32670,7 +32670,7 @@ var init_macro_supplements = __esm({
32670
32670
  do: {
32671
32671
  name: "do",
32672
32672
  container: true,
32673
- description: "Displays its contents. Can be updated dynamically.\n\nUsage:\n\n```\n{do}\n ...\n{/do}\n```",
32673
+ description: "Executes JavaScript statements in its body. The body is code and produces no markup output.\n\nUsage:\n\n```\n{do}\n _total = 1 + 2;\n{/do}\nValue: {_total}\n```",
32674
32674
  parameters: []
32675
32675
  },
32676
32676
  link: {
@@ -32810,7 +32810,7 @@ var init_macro_supplements = __esm({
32810
32810
  },
32811
32811
  passage: {
32812
32812
  name: "passage",
32813
- description: "Outputs the name of the current passage.\n\nUsage: `{passage}`",
32813
+ description: "Renders the current passage's contents in a layout. Put this slot in StoryInterface; placing it in the current passage itself recursively renders that passage. To display the passage's name, use `{print currentPassage().name}`.\n\nUsage in StoryInterface: `<main>{passage}</main>`",
32814
32814
  parameters: []
32815
32815
  },
32816
32816
  textbox: {
@@ -34457,6 +34457,7 @@ function parentDiagnostics(passage, token, ancestors, workspace) {
34457
34457
  const name = token.name.toLowerCase();
34458
34458
  const parents = workspace.macros.getMacro(name)?.parents;
34459
34459
  if (!parents || parents.length === 0 || BRANCH_MACROS2.has(name)) return [];
34460
+ if (workspace.macros.getAllMacros().some((macro) => macro.source === "user" && macro.name.toLowerCase() !== "listbox" && macro.subMacros.some((sub) => sub.toLowerCase() === name))) return [];
34460
34461
  const allowed = new Set(parents.map((parent) => parent.toLowerCase()));
34461
34462
  const parentList = parents.join(", ");
34462
34463
  const range2 = passage.range(token.start, token.end);
@@ -80046,10 +80047,11 @@ function getSignatureHelp(uri, position, workspace) {
80046
80047
  const typing = argumentsBeingTyped(argsBefore);
80047
80048
  const argument = typing.length - 1;
80048
80049
  const macroInfo = workspace.macros.getMacro(macroName);
80049
- if (macroInfo && macroInfo.parameters && macroInfo.parameters.length > 0) {
80050
+ const schema = macroInfo?.parameterDefs?.length && !workspace.macros.hasConfiguredParameters(macroName) ? void 0 : macroInfo?.parameters;
80051
+ if (macroInfo && schema && schema.length > 0) {
80050
80052
  const described = describeSignatures(
80051
80053
  macroName,
80052
- macroInfo.parameters,
80054
+ schema,
80053
80055
  macroInfo.description ?? void 0,
80054
80056
  macroInfo.parameterDocs
80055
80057
  );
@@ -80064,10 +80066,10 @@ function getSignatureHelp(uri, position, workspace) {
80064
80066
  }
80065
80067
  }
80066
80068
  if (macroInfo) {
80067
- const definitions = macroInfo.parameters === void 0 ? macroInfo.parameterDefs : void 0;
80069
+ const definitions = schema === void 0 ? macroInfo.parameterDefs : void 0;
80068
80070
  if (!definitions?.length) return null;
80069
80071
  const parameters = definitions.map((parameter) => ({
80070
- label: parameter.required ? parameter.name : `[${parameter.name}]`,
80072
+ label: parameter.required || parameter.type === "separator" ? parameter.name : `[${parameter.name}]`,
80071
80073
  documentation: [parameter.description, `Type: ${parameter.type}`].filter(Boolean).join("\n\n")
80072
80074
  }));
80073
80075
  const positional = definitions.every((p) => p.type === "string" || p.type === "number") && argument < parameters.length;