@rohal12/spindle-lsp 0.15.42 → 0.15.43
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 +25 -9
- package/dist/bin.js.map +2 -2
- package/package.json +1 -1
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.
|
|
58
|
+
VERSION = false ? pkg.version : "0.15.43";
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
|
|
@@ -88740,6 +88740,13 @@ function passageMacroHeads(passage) {
|
|
|
88740
88740
|
function documentMacroHeads(doc) {
|
|
88741
88741
|
return doc.passages.flatMap((passage) => passage.isMarkup ? [...passageMacroHeads(passage)] : []);
|
|
88742
88742
|
}
|
|
88743
|
+
function* workspaceMacroHeads(workspace) {
|
|
88744
|
+
for (const uri of workspace.documents.getUris()) {
|
|
88745
|
+
const doc = workspace.markup.get(uri);
|
|
88746
|
+
if (!doc) continue;
|
|
88747
|
+
for (const head of documentMacroHeads(doc)) yield { uri, head };
|
|
88748
|
+
}
|
|
88749
|
+
}
|
|
88743
88750
|
function macroHeadAt(doc, position) {
|
|
88744
88751
|
const passage = doc.passageAt(position);
|
|
88745
88752
|
if (!passage?.isMarkup) return void 0;
|
|
@@ -89248,13 +89255,9 @@ function computeRename(uri, position, newName, workspace) {
|
|
|
89248
89255
|
if (workspace.passages.getPassage(newName)) {
|
|
89249
89256
|
throw new RenameError(`Cannot rename to ${JSON.stringify(newName)}: a passage with that name already exists.`).at(uri, symbol2.range);
|
|
89250
89257
|
}
|
|
89251
|
-
for (const documentUri of workspace
|
|
89252
|
-
|
|
89253
|
-
|
|
89254
|
-
for (const head of documentMacroHeads(doc)) {
|
|
89255
|
-
if (!head.closing && workspace.getEffectiveMacro(head.name) && workspace.macros.hasUnsafeConfiguredPassages(head.name)) {
|
|
89256
|
-
throw new RenameError(`Cannot rename: {${head.name}} has configured passage parameters whose positions are ambiguous, repeated or conflict with its runtime signature.`).at(documentUri, head.range);
|
|
89257
|
-
}
|
|
89258
|
+
for (const { uri: documentUri, head } of workspaceMacroHeads(workspace)) {
|
|
89259
|
+
if (!head.closing && workspace.getEffectiveMacro(head.name) && workspace.macros.hasUnsafeConfiguredPassages(head.name)) {
|
|
89260
|
+
throw new RenameError(`Cannot rename: {${head.name}} has configured passage parameters whose positions are ambiguous, repeated or conflict with its runtime signature.`).at(documentUri, head.range);
|
|
89258
89261
|
}
|
|
89259
89262
|
}
|
|
89260
89263
|
const refEdits = [];
|
|
@@ -89632,6 +89635,18 @@ function computeCodeLenses(uri, workspace) {
|
|
|
89632
89635
|
}
|
|
89633
89636
|
const variableCounts = variableLines.size > 0 ? workspace.variables.getUsageCounts() : /* @__PURE__ */ new Map();
|
|
89634
89637
|
const widgetLines = new Map(workspace.widgets.getAllWidgets().filter((w) => w.uri === uri).map((w) => [w.range.start.line, w.name]));
|
|
89638
|
+
const widgetCounts = /* @__PURE__ */ new Map();
|
|
89639
|
+
for (const name of widgetLines.values()) {
|
|
89640
|
+
if (!workspace.getEffectiveMacro(name)) widgetCounts.set(name.toLowerCase(), 0);
|
|
89641
|
+
}
|
|
89642
|
+
if (widgetCounts.size > 0) {
|
|
89643
|
+
for (const { head } of workspaceMacroHeads(workspace)) {
|
|
89644
|
+
if (!head.invocation || head.closing) continue;
|
|
89645
|
+
const name = head.name.toLowerCase();
|
|
89646
|
+
const count = widgetCounts.get(name);
|
|
89647
|
+
if (count !== void 0) widgetCounts.set(name, count + 1);
|
|
89648
|
+
}
|
|
89649
|
+
}
|
|
89635
89650
|
for (let lineNum = 0; lineNum < lines.length; lineNum++) {
|
|
89636
89651
|
const line = lines[lineNum];
|
|
89637
89652
|
const header = parsePassageHeader(line, lineNum);
|
|
@@ -89644,7 +89659,7 @@ function computeCodeLenses(uri, workspace) {
|
|
|
89644
89659
|
}
|
|
89645
89660
|
const widgetName2 = widgetLines.get(lineNum);
|
|
89646
89661
|
if (widgetName2 !== void 0) {
|
|
89647
|
-
const usageCount =
|
|
89662
|
+
const usageCount = widgetCounts.get(widgetName2.toLowerCase()) ?? 0;
|
|
89648
89663
|
addLens(lineNum, `${usageCount} usage${usageCount !== 1 ? "s" : ""}`);
|
|
89649
89664
|
}
|
|
89650
89665
|
const varName = variableLines.get(lineNum);
|
|
@@ -89667,6 +89682,7 @@ var init_code_lens = __esm({
|
|
|
89667
89682
|
"use strict";
|
|
89668
89683
|
init_text();
|
|
89669
89684
|
init_passage_parser();
|
|
89685
|
+
init_macro_heads();
|
|
89670
89686
|
init_references();
|
|
89671
89687
|
codeLensPlugin = {
|
|
89672
89688
|
id: "code-lens",
|