@rohal12/spindle-lsp 0.15.23 → 0.15.24

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.23";
58
+ VERSION = false ? pkg.version : "0.15.24";
59
59
  }
60
60
  });
61
61
 
@@ -88149,7 +88149,7 @@ function computeCodeLenses(uri, workspace) {
88149
88149
  command: { title }
88150
88150
  });
88151
88151
  };
88152
- const storyVarsPassage = workspace.passages.getStoryVariables();
88152
+ const variableLines = new Map([...workspace.variables.getDeclared().keys()].flatMap((name) => workspace.variables.getDeclarations(name, "$").filter((declaration) => declaration.uri === uri).map((declaration) => [declaration.range.start.line, name])));
88153
88153
  const widgetLines = new Map(workspace.widgets.getAllWidgets().filter((w) => w.uri === uri).map((w) => [w.range.start.line, w.name]));
88154
88154
  for (let lineNum = 0; lineNum < lines.length; lineNum++) {
88155
88155
  const line = lines[lineNum];
@@ -88166,13 +88166,10 @@ function computeCodeLenses(uri, workspace) {
88166
88166
  const usageCount = findWidgetReferences(widgetName2, workspace, false, false).length;
88167
88167
  addLens(lineNum, `${usageCount} usage${usageCount !== 1 ? "s" : ""}`);
88168
88168
  }
88169
- if (storyVarsPassage && storyVarsPassage.uri === uri && lineNum > storyVarsPassage.range.start.line && lineNum <= storyVarsPassage.range.end.line) {
88170
- const varDeclMatch = line.match(/^\$(\w+)\s*=/);
88171
- if (varDeclMatch) {
88172
- const varName = varDeclMatch[1];
88173
- const usageCount = findVariableReferences(varName, workspace, false).length;
88174
- addLens(lineNum, `${usageCount} usage${usageCount !== 1 ? "s" : ""}`);
88175
- }
88169
+ const varName = variableLines.get(lineNum);
88170
+ if (varName !== void 0) {
88171
+ const usageCount = findVariableReferences(varName, workspace, false).length;
88172
+ addLens(lineNum, `${usageCount} usage${usageCount !== 1 ? "s" : ""}`);
88176
88173
  }
88177
88174
  }
88178
88175
  return lenses;