@rohal12/spindle-lsp 0.15.23 → 0.15.25

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.25";
59
59
  }
60
60
  });
61
61
 
@@ -75165,6 +75165,15 @@ var init_mcp = __esm({
75165
75165
  this._promptHandlersInitialized = false;
75166
75166
  this.server = new Server(serverInfo, options);
75167
75167
  this._maxToolInputElements = resolveMaxToolInputElements(options?.maxToolInputElements);
75168
+ if (options?.capabilities?.tools) {
75169
+ this.setToolRequestHandlers();
75170
+ }
75171
+ if (options?.capabilities?.resources) {
75172
+ this.setResourceRequestHandlers();
75173
+ }
75174
+ if (options?.capabilities?.prompts) {
75175
+ this.setPromptRequestHandlers();
75176
+ }
75168
75177
  }
75169
75178
  /**
75170
75179
  * Access experimental features.
@@ -86533,6 +86542,13 @@ var init_main2 = __esm({
86533
86542
  const startOffset = this.offsetAt(range2.start);
86534
86543
  const endOffset = this.offsetAt(range2.end);
86535
86544
  this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length);
86545
+ const insertedEndOffset = startOffset + change.text.length;
86546
+ const crlfAtStart = this._content.charCodeAt(startOffset - 1) === 13 && this._content.charCodeAt(startOffset) === 10;
86547
+ const crlfAtEnd = this._content.charCodeAt(insertedEndOffset - 1) === 13 && this._content.charCodeAt(insertedEndOffset) === 10;
86548
+ if (crlfAtStart || crlfAtEnd) {
86549
+ this._lineOffsets = void 0;
86550
+ continue;
86551
+ }
86536
86552
  const startLine = Math.max(range2.start.line, 0);
86537
86553
  const endLine = Math.max(range2.end.line, 0);
86538
86554
  let lineOffsets = this._lineOffsets;
@@ -88149,7 +88165,7 @@ function computeCodeLenses(uri, workspace) {
88149
88165
  command: { title }
88150
88166
  });
88151
88167
  };
88152
- const storyVarsPassage = workspace.passages.getStoryVariables();
88168
+ 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
88169
  const widgetLines = new Map(workspace.widgets.getAllWidgets().filter((w) => w.uri === uri).map((w) => [w.range.start.line, w.name]));
88154
88170
  for (let lineNum = 0; lineNum < lines.length; lineNum++) {
88155
88171
  const line = lines[lineNum];
@@ -88166,13 +88182,10 @@ function computeCodeLenses(uri, workspace) {
88166
88182
  const usageCount = findWidgetReferences(widgetName2, workspace, false, false).length;
88167
88183
  addLens(lineNum, `${usageCount} usage${usageCount !== 1 ? "s" : ""}`);
88168
88184
  }
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
- }
88185
+ const varName = variableLines.get(lineNum);
88186
+ if (varName !== void 0) {
88187
+ const usageCount = findVariableReferences(varName, workspace, false).length;
88188
+ addLens(lineNum, `${usageCount} usage${usageCount !== 1 ? "s" : ""}`);
88176
88189
  }
88177
88190
  }
88178
88191
  return lenses;