@mrclrchtr/supi-code-intelligence 10.0.0 → 11.0.0
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/README.md +77 -21
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/LICENSE +21 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/README.md +743 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/index.js +17 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/constants.js +184 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/parse.js +1425 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/picomatch.js +361 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/scan.js +403 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/utils.js +72 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/package.json +83 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/posix.js +3 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +4 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +11 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/file-associations.ts +190 -0
- package/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +22 -0
- package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/README.md +88 -2
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/LICENSE +21 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/README.md +743 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/index.js +17 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/constants.js +184 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/parse.js +1425 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/picomatch.js +361 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/scan.js +403 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/utils.js +72 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/package.json +83 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/posix.js +3 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +4 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +11 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/file-associations.ts +190 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +22 -0
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/package.json +3 -3
- package/node_modules/@mrclrchtr/supi-lsp/src/api.ts +1 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostic-host.ts +3 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-diagnostics.ts +6 -4
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-request-enrollment.ts +66 -22
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client-semantic-input-barrier.ts +37 -5
- package/node_modules/@mrclrchtr/supi-lsp/src/client/client.ts +136 -43
- package/node_modules/@mrclrchtr/supi-lsp/src/manager/manager.ts +261 -22
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/refactor-planning.ts +13 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-edit-discovery.ts +151 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-edit-normalizer.ts +97 -129
- package/node_modules/@mrclrchtr/supi-lsp/src/provider/semantic-edit-protocol.ts +132 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-controller.ts +8 -1
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-registry.ts +7 -20
- package/node_modules/@mrclrchtr/supi-lsp/src/session/runtime-rename.ts +172 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/session/workspace-lsp-runtime.ts +14 -0
- package/node_modules/@mrclrchtr/supi-lsp/src/utils.ts +12 -11
- package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +63 -17
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/LICENSE +21 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/README.md +743 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/index.js +17 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/constants.js +184 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/parse.js +1425 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/picomatch.js +361 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/scan.js +403 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/lib/utils.js +72 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/package.json +83 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/picomatch/posix.js +3 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +4 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/api.ts +11 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/file-associations.ts +190 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/src/types.ts +22 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/package.json +3 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/language.ts +16 -10
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/operation-support.ts +13 -6
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/provider/tree-sitter-provider.ts +19 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/runtime-controller.ts +18 -4
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/session.ts +10 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-client.ts +17 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-process.ts +22 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/session/structural-worker-protocol.ts +36 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/syntax-errors.ts +73 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/syntax-node.ts +4 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/call-sites.ts +15 -9
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/callees.ts +24 -15
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/exports.ts +8 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/imports.ts +233 -7
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/node-at.ts +7 -3
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline-expansion.ts +78 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline-jvm.ts +25 -4
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline-nested.ts +390 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline.ts +49 -28
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/types.ts +16 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/process-host.mjs +61 -24
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/runtime.ts +44 -10
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/service.ts +13 -9
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/worker/worker-main.ts +15 -2
- package/package.json +5 -5
- package/src/analysis/refactor/apply.ts +35 -14
- package/src/analysis/relations/callees.ts +9 -2
- package/src/analysis/relations/implementations.ts +7 -2
- package/src/analysis/search/pattern-analysis.ts +90 -12
- package/src/analysis/search/pattern.ts +1 -0
- package/src/analysis/target/anchored-structural.ts +1 -0
- package/src/analysis/target/discovery.ts +29 -0
- package/src/analysis/target/file.ts +19 -9
- package/src/analysis/target/types.ts +5 -0
- package/src/config.ts +46 -7
- package/src/session/graph/collect.ts +2 -2
- package/src/session/graph-types.ts +6 -0
- package/src/session/inspect/collect.ts +35 -20
- package/src/session/inspect-types.ts +9 -2
- package/src/session/orientation/collect.ts +90 -18
- package/src/session/orientation/context-sections.ts +22 -1
- package/src/session/orientation/gather.ts +46 -6
- package/src/session/orientation-types.ts +7 -1
- package/src/session/refactor-plans.ts +17 -0
- package/src/session/refactor-workflow.ts +13 -6
- package/src/session/target-store.ts +5 -0
- package/src/session/target-workflow.ts +3 -0
- package/src/substrate/workspace-provider-host.ts +22 -2
- package/src/tool/code_find/markdown.ts +17 -4
- package/src/tool/code_find/result.ts +17 -3
- package/src/tool/code_graph/details.ts +2 -0
- package/src/tool/code_graph/display.ts +1 -0
- package/src/tool/code_graph/format.ts +1 -0
- package/src/tool/code_graph/result.ts +32 -6
- package/src/tool/code_inspect/markdown.ts +15 -1
- package/src/tool/code_inspect/result.ts +11 -0
- package/src/tool/code_orientation/result.ts +4 -2
- package/src/tool/code_resolve/markdown.ts +34 -14
- package/src/tool/code_resolve/result.ts +7 -3
- package/src/tool/result/types.ts +20 -2
- package/src/ui/tui/display.ts +2 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/LICENSE-MIT +0 -21
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/README.md +0 -501
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/index.d.ts +0 -81
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/index.js +0 -1566
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/legacy.js +0 -1346
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/ignore/package.json +0 -93
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// biome-ignore-all lint/style/noExcessiveLinesPerFile: symbol-orientation section builders stay together to preserve one rendering contract
|
|
2
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
import * as path from "node:path";
|
|
4
|
-
import type { ConfidenceMode } from "@mrclrchtr/supi-code-runtime/api";
|
|
4
|
+
import type { ConfidenceMode, SourceRange } from "@mrclrchtr/supi-code-runtime/api";
|
|
5
5
|
import { isCodeRequestInterruption } from "@mrclrchtr/supi-code-runtime/api";
|
|
6
6
|
import { uriToFile } from "@mrclrchtr/supi-core/path";
|
|
7
7
|
import type { Diagnostic } from "@mrclrchtr/supi-lsp/api";
|
|
@@ -35,6 +35,7 @@ interface TargetSectionCollection {
|
|
|
35
35
|
readonly status: "complete" | "partial" | "unavailable";
|
|
36
36
|
readonly reason: string | null;
|
|
37
37
|
readonly evidenceLists: readonly EvidenceListMetadata[];
|
|
38
|
+
readonly errorRanges?: readonly SourceRange[];
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
const DEFAULT_TARGET_SECTIONS: OrientationSection[] = ["defs", "docs", "diagnostics"];
|
|
@@ -165,7 +166,12 @@ async function buildEnrichedDefsSection(
|
|
|
165
166
|
limit: number,
|
|
166
167
|
): Promise<TargetSectionCollection> {
|
|
167
168
|
const items = buildDefinitionItems(target, deps.cwd, treeContext);
|
|
168
|
-
const
|
|
169
|
+
const recovery = treeContext?.recovery ?? [];
|
|
170
|
+
const recoveryReason = recovery
|
|
171
|
+
.map(({ operation, reason }) => `${operation}: ${reason}`)
|
|
172
|
+
.join("; ");
|
|
173
|
+
const recoveryRanges = uniqueRecoveryRanges(recovery);
|
|
174
|
+
const hasSemanticContext = Boolean(
|
|
169
175
|
treeContext?.hover || (treeContext?.definition?.length ?? 0) > 0,
|
|
170
176
|
);
|
|
171
177
|
const hasStructuralEvidence = hasRenderableItems(items);
|
|
@@ -178,30 +184,75 @@ async function buildEnrichedDefsSection(
|
|
|
178
184
|
);
|
|
179
185
|
}
|
|
180
186
|
if (deps.lspRuntime.kind !== "ready") {
|
|
181
|
-
return {
|
|
187
|
+
return unavailableDefinitionCollection({
|
|
182
188
|
items,
|
|
183
189
|
hasStructuralEvidence,
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
};
|
|
190
|
+
hasSemanticContext,
|
|
191
|
+
recoveryReason,
|
|
192
|
+
recoveryRanges,
|
|
193
|
+
readinessReason: deps.semanticReadinessReason ?? null,
|
|
194
|
+
});
|
|
189
195
|
}
|
|
190
|
-
|
|
191
196
|
const definitions = await collectDefinitionTargets(target, deps, limit);
|
|
192
|
-
|
|
193
|
-
if (items.length > 0) items.push({ kind: "blank" });
|
|
194
|
-
items.push({ kind: "paragraph", text: "**Definition:**" }, ...definitions.items);
|
|
195
|
-
}
|
|
196
|
-
const hasSemanticEvidence = contextHasSemanticEvidence || definitions.hasSemanticEvidence;
|
|
197
|
-
return {
|
|
197
|
+
return mergeDefinitionCollection({
|
|
198
198
|
items,
|
|
199
|
+
definitions,
|
|
199
200
|
hasStructuralEvidence,
|
|
201
|
+
hasSemanticContext,
|
|
202
|
+
recoveryReason,
|
|
203
|
+
recoveryRanges,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function unavailableDefinitionCollection(input: {
|
|
208
|
+
items: OrientationItem[];
|
|
209
|
+
hasStructuralEvidence: boolean;
|
|
210
|
+
hasSemanticContext: boolean;
|
|
211
|
+
recoveryReason: string;
|
|
212
|
+
recoveryRanges: readonly SourceRange[];
|
|
213
|
+
readinessReason: string | null;
|
|
214
|
+
}): TargetSectionCollection {
|
|
215
|
+
return {
|
|
216
|
+
items: input.items,
|
|
217
|
+
hasStructuralEvidence: input.hasStructuralEvidence,
|
|
218
|
+
hasSemanticEvidence: input.hasSemanticContext,
|
|
219
|
+
status: input.recoveryReason || input.hasSemanticContext ? "partial" : "unavailable",
|
|
220
|
+
reason: [
|
|
221
|
+
input.recoveryReason || null,
|
|
222
|
+
input.readinessReason ?? "Definition targets require a live language server.",
|
|
223
|
+
]
|
|
224
|
+
.filter(Boolean)
|
|
225
|
+
.join(" "),
|
|
226
|
+
evidenceLists: [],
|
|
227
|
+
...(input.recoveryRanges.length > 0 ? { errorRanges: [...input.recoveryRanges] } : {}),
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function mergeDefinitionCollection(input: {
|
|
232
|
+
items: OrientationItem[];
|
|
233
|
+
definitions: Awaited<ReturnType<typeof collectDefinitionTargets>>;
|
|
234
|
+
hasStructuralEvidence: boolean;
|
|
235
|
+
hasSemanticContext: boolean;
|
|
236
|
+
recoveryReason: string;
|
|
237
|
+
recoveryRanges: readonly SourceRange[];
|
|
238
|
+
}): TargetSectionCollection {
|
|
239
|
+
if (input.definitions.items.length > 0) {
|
|
240
|
+
if (input.items.length > 0) input.items.push({ kind: "blank" });
|
|
241
|
+
input.items.push({ kind: "paragraph", text: "**Definition:**" }, ...input.definitions.items);
|
|
242
|
+
}
|
|
243
|
+
const hasSemanticEvidence = input.hasSemanticContext || input.definitions.hasSemanticEvidence;
|
|
244
|
+
return {
|
|
245
|
+
items: input.items,
|
|
246
|
+
hasStructuralEvidence: input.hasStructuralEvidence,
|
|
200
247
|
hasSemanticEvidence,
|
|
201
248
|
status:
|
|
202
|
-
definitions.status === "unavailable" && hasSemanticEvidence
|
|
203
|
-
|
|
204
|
-
|
|
249
|
+
input.recoveryReason || (input.definitions.status === "unavailable" && hasSemanticEvidence)
|
|
250
|
+
? "partial"
|
|
251
|
+
: input.definitions.status,
|
|
252
|
+
reason:
|
|
253
|
+
[input.recoveryReason || null, input.definitions.reason].filter(Boolean).join(" ") || null,
|
|
254
|
+
evidenceLists: input.definitions.evidenceLists,
|
|
255
|
+
...(input.recoveryRanges.length > 0 ? { errorRanges: [...input.recoveryRanges] } : {}),
|
|
205
256
|
};
|
|
206
257
|
}
|
|
207
258
|
|
|
@@ -504,6 +555,16 @@ async function maybeGatherTreeContext(
|
|
|
504
555
|
);
|
|
505
556
|
}
|
|
506
557
|
|
|
558
|
+
function uniqueRecoveryRanges(
|
|
559
|
+
recovery: readonly { errorRanges: readonly SourceRange[] }[],
|
|
560
|
+
): SourceRange[] {
|
|
561
|
+
const ranges = new Map<string, SourceRange>();
|
|
562
|
+
for (const item of recovery) {
|
|
563
|
+
for (const range of item.errorRanges) ranges.set(JSON.stringify(range), range);
|
|
564
|
+
}
|
|
565
|
+
return [...ranges.values()];
|
|
566
|
+
}
|
|
567
|
+
|
|
507
568
|
function buildDefinitionItems(
|
|
508
569
|
target: Readonly<TargetStoreEntry> | null | undefined,
|
|
509
570
|
cwd: string,
|
|
@@ -529,6 +590,16 @@ function buildDefinitionItems(
|
|
|
529
590
|
if (treeContext?.nodeInfo?.type) {
|
|
530
591
|
items.push({ kind: "list-item", text: `Node: \`${treeContext.nodeInfo.type}\`` });
|
|
531
592
|
}
|
|
593
|
+
for (const recovery of treeContext?.recovery ?? []) {
|
|
594
|
+
const locations = recovery.errorRanges.map(
|
|
595
|
+
(range) => `L${range.start.line + 1}:${range.start.character + 1}`,
|
|
596
|
+
);
|
|
597
|
+
const suffix = locations.length > 0 ? ` Errors: ${locations.join(", ")}.` : "";
|
|
598
|
+
items.push({
|
|
599
|
+
kind: "paragraph",
|
|
600
|
+
text: `Partial ${recovery.operation} evidence in \`${recovery.file}\`: ${recovery.reason}.${suffix}`,
|
|
601
|
+
});
|
|
602
|
+
}
|
|
532
603
|
if (treeContext?.hover?.contents) {
|
|
533
604
|
items.push(...hoverItems(treeContext.hover.contents));
|
|
534
605
|
}
|
|
@@ -682,6 +753,7 @@ function targetSectionResult(
|
|
|
682
753
|
confidence,
|
|
683
754
|
provenance,
|
|
684
755
|
evidenceLists: collection.evidenceLists,
|
|
756
|
+
...(collection.errorRanges ? { errorRanges: [...collection.errorRanges] } : {}),
|
|
685
757
|
items: collection.items,
|
|
686
758
|
},
|
|
687
759
|
hasStructuralEvidence: collection.hasStructuralEvidence,
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
type CodeResult,
|
|
6
6
|
type ConfidenceMode,
|
|
7
7
|
isCodeRequestInterruption,
|
|
8
|
+
type SourceRange,
|
|
8
9
|
} from "@mrclrchtr/supi-code-runtime/api";
|
|
9
10
|
import { isWithinOrEqual } from "@mrclrchtr/supi-core/project";
|
|
10
11
|
import type { WorkspaceLspRuntimeState } from "@mrclrchtr/supi-lsp/api";
|
|
@@ -37,6 +38,7 @@ export interface ListSectionInput<T> {
|
|
|
37
38
|
readonly reason?: string | null;
|
|
38
39
|
readonly unknownRemainder?: boolean;
|
|
39
40
|
readonly partialReason?: EvidencePartialReason;
|
|
41
|
+
readonly errorRanges?: readonly SourceRange[];
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
/** Start a context-Oriented document with one factual focus title. */
|
|
@@ -64,6 +66,7 @@ export function appendList<T>(
|
|
|
64
66
|
...list.metadata,
|
|
65
67
|
totalCount: null,
|
|
66
68
|
partialReason: input.partialReason ?? "filesystem-error",
|
|
69
|
+
...(input.reason ? { partialMessage: input.reason } : {}),
|
|
67
70
|
}
|
|
68
71
|
: list.metadata;
|
|
69
72
|
builder.sections.push({
|
|
@@ -75,6 +78,7 @@ export function appendList<T>(
|
|
|
75
78
|
provenance: input.provenance,
|
|
76
79
|
evidenceLists: [{ ...metadata, key: input.key }],
|
|
77
80
|
items: list.items.map((item) => ({ kind: "list-item", text: input.render(item) })),
|
|
81
|
+
...(input.errorRanges ? { errorRanges: [...input.errorRanges] } : {}),
|
|
78
82
|
});
|
|
79
83
|
}
|
|
80
84
|
|
|
@@ -226,7 +230,7 @@ async function appendStructuralList<T>(
|
|
|
226
230
|
});
|
|
227
231
|
return;
|
|
228
232
|
}
|
|
229
|
-
if (result.kind !== "success") {
|
|
233
|
+
if (result.kind !== "success" && result.kind !== "partial") {
|
|
230
234
|
appendUnavailable(builder, {
|
|
231
235
|
key: input.key,
|
|
232
236
|
title: input.title,
|
|
@@ -235,6 +239,14 @@ async function appendStructuralList<T>(
|
|
|
235
239
|
});
|
|
236
240
|
return;
|
|
237
241
|
}
|
|
242
|
+
const recoveryLocations =
|
|
243
|
+
result.kind === "partial"
|
|
244
|
+
? result.errorRanges.map((range) => `L${range.start.line + 1}:${range.start.character + 1}`)
|
|
245
|
+
: [];
|
|
246
|
+
const recoveryReason =
|
|
247
|
+
result.kind === "partial"
|
|
248
|
+
? `${result.reason}${recoveryLocations.length ? ` Error locations: ${recoveryLocations.join(", ")}.` : ""}`
|
|
249
|
+
: null;
|
|
238
250
|
appendList(builder, {
|
|
239
251
|
key: input.key,
|
|
240
252
|
title: input.title,
|
|
@@ -242,6 +254,15 @@ async function appendStructuralList<T>(
|
|
|
242
254
|
render: input.render,
|
|
243
255
|
confidence: "structural",
|
|
244
256
|
provenance: [{ source: "structural", capability: "tree-sitter" }],
|
|
257
|
+
...(result.kind === "partial"
|
|
258
|
+
? {
|
|
259
|
+
status: "partial" as const,
|
|
260
|
+
reason: recoveryReason,
|
|
261
|
+
unknownRemainder: true,
|
|
262
|
+
partialReason: "provider-limited" as const,
|
|
263
|
+
errorRanges: result.errorRanges,
|
|
264
|
+
}
|
|
265
|
+
: {}),
|
|
245
266
|
});
|
|
246
267
|
}
|
|
247
268
|
|
|
@@ -46,6 +46,13 @@ export interface SubstrateContext {
|
|
|
46
46
|
hover: { contents: string; range?: SourceRange } | null;
|
|
47
47
|
/** Best-effort LSP definition targets at the anchored position. `null` when unavailable. */
|
|
48
48
|
definition: Array<{ uri: string; range: SourceRange }> | null;
|
|
49
|
+
/** Structural recovery from independently queried source operations. */
|
|
50
|
+
recovery: Array<{
|
|
51
|
+
operation: "nodeAt" | "outline" | "imports" | "exports";
|
|
52
|
+
file: string;
|
|
53
|
+
reason: string;
|
|
54
|
+
errorRanges: readonly SourceRange[];
|
|
55
|
+
}>;
|
|
49
56
|
}
|
|
50
57
|
|
|
51
58
|
/**
|
|
@@ -74,13 +81,22 @@ export async function gatherSubstrateContext(
|
|
|
74
81
|
let exports: SubstrateContext["exports"] = [];
|
|
75
82
|
let hover: SubstrateContext["hover"] = null;
|
|
76
83
|
let definition: SubstrateContext["definition"] = null;
|
|
84
|
+
const recovery: SubstrateContext["recovery"] = [];
|
|
77
85
|
|
|
78
|
-
if (!provider) return { nodeInfo, outline, imports, exports, hover, definition: null };
|
|
86
|
+
if (!provider) return { nodeInfo, outline, imports, exports, hover, definition: null, recovery };
|
|
79
87
|
|
|
80
88
|
try {
|
|
81
89
|
if (positionStrict) {
|
|
82
90
|
const nodeResult = await provider.nodeAt(relPath, line, character, requestControl);
|
|
83
|
-
if (nodeResult.kind === "
|
|
91
|
+
if (nodeResult.kind === "partial") {
|
|
92
|
+
recovery.push({
|
|
93
|
+
operation: "nodeAt",
|
|
94
|
+
file: nodeResult.file,
|
|
95
|
+
reason: nodeResult.reason,
|
|
96
|
+
errorRanges: nodeResult.errorRanges,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (nodeResult.kind === "success" || nodeResult.kind === "partial") {
|
|
84
100
|
nodeInfo = {
|
|
85
101
|
type: nodeResult.data.type,
|
|
86
102
|
text: nodeResult.data.text,
|
|
@@ -92,7 +108,15 @@ export async function gatherSubstrateContext(
|
|
|
92
108
|
}
|
|
93
109
|
|
|
94
110
|
const outlineResult = await provider.outline(relPath, requestControl);
|
|
95
|
-
if (outlineResult.kind === "
|
|
111
|
+
if (outlineResult.kind === "partial") {
|
|
112
|
+
recovery.push({
|
|
113
|
+
operation: "outline",
|
|
114
|
+
file: outlineResult.file,
|
|
115
|
+
reason: outlineResult.reason,
|
|
116
|
+
errorRanges: outlineResult.errorRanges,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
if (outlineResult.kind === "success" || outlineResult.kind === "partial") {
|
|
96
120
|
outline = outlineResult.data.map((item) => ({
|
|
97
121
|
name: item.name,
|
|
98
122
|
kind: item.kind,
|
|
@@ -102,12 +126,28 @@ export async function gatherSubstrateContext(
|
|
|
102
126
|
}
|
|
103
127
|
|
|
104
128
|
const importsResult = await provider.imports(relPath, requestControl);
|
|
105
|
-
if (importsResult.kind === "
|
|
129
|
+
if (importsResult.kind === "partial") {
|
|
130
|
+
recovery.push({
|
|
131
|
+
operation: "imports",
|
|
132
|
+
file: importsResult.file,
|
|
133
|
+
reason: importsResult.reason,
|
|
134
|
+
errorRanges: importsResult.errorRanges,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
if (importsResult.kind === "success" || importsResult.kind === "partial") {
|
|
106
138
|
imports = importsResult.data;
|
|
107
139
|
}
|
|
108
140
|
|
|
109
141
|
const exportsResult = await provider.exports(relPath, requestControl);
|
|
110
|
-
if (exportsResult.kind === "
|
|
142
|
+
if (exportsResult.kind === "partial") {
|
|
143
|
+
recovery.push({
|
|
144
|
+
operation: "exports",
|
|
145
|
+
file: exportsResult.file,
|
|
146
|
+
reason: exportsResult.reason,
|
|
147
|
+
errorRanges: exportsResult.errorRanges,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
if (exportsResult.kind === "success" || exportsResult.kind === "partial") {
|
|
111
151
|
exports = exportsResult.data.map((item) => ({
|
|
112
152
|
name: item.name,
|
|
113
153
|
kind: item.kind,
|
|
@@ -151,5 +191,5 @@ export async function gatherSubstrateContext(
|
|
|
151
191
|
// Provider not available
|
|
152
192
|
}
|
|
153
193
|
|
|
154
|
-
return { nodeInfo, outline, imports, exports, hover, definition };
|
|
194
|
+
return { nodeInfo, outline, imports, exports, hover, definition, recovery };
|
|
155
195
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
CodeRequestControl,
|
|
3
|
+
ConfidenceMode,
|
|
4
|
+
SourceRange,
|
|
5
|
+
} from "@mrclrchtr/supi-code-runtime/api";
|
|
2
6
|
import type { WorkspaceLspRuntimeState } from "@mrclrchtr/supi-lsp/api";
|
|
3
7
|
import type { ArchitectureModel } from "../analysis/architecture/model.ts";
|
|
4
8
|
import type { EvidenceListMetadata } from "../analysis/evidence.ts";
|
|
@@ -84,6 +88,8 @@ export interface OrientationSectionData {
|
|
|
84
88
|
readonly title: string;
|
|
85
89
|
readonly status: "complete" | "partial" | "unavailable";
|
|
86
90
|
readonly reason: string | null;
|
|
91
|
+
/** Syntax recovery ranges for partial structural evidence, in 0-based coordinates. */
|
|
92
|
+
readonly errorRanges?: readonly SourceRange[];
|
|
87
93
|
/** Semantic/structural confidence only; filesystem/config facts use unavailable. */
|
|
88
94
|
readonly confidence: ConfidenceMode;
|
|
89
95
|
readonly provenance: readonly OrientationProvenance[];
|
|
@@ -37,6 +37,23 @@ export function computeFileFingerprint(file: string): string {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/** Check that request-scoped content evidence still matches the plan inputs. */
|
|
41
|
+
export function validateSynchronizedContentFingerprints(
|
|
42
|
+
preconditions: WorkspaceEdit["documentPreconditions"],
|
|
43
|
+
fileFingerprints: readonly { file: string; fingerprint: string }[],
|
|
44
|
+
): string | null {
|
|
45
|
+
const fingerprints = new Map(
|
|
46
|
+
fileFingerprints.map(({ file, fingerprint }) => [file, fingerprint]),
|
|
47
|
+
);
|
|
48
|
+
for (const precondition of preconditions ?? []) {
|
|
49
|
+
if (precondition.kind !== "open-document-content") continue;
|
|
50
|
+
if (fingerprints.get(precondition.file) !== precondition.fingerprint) {
|
|
51
|
+
return `File ${precondition.file} changed after the semantic input snapshot. Request a new rename plan.`;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
|
|
40
57
|
/** Generate a stable plan id from operation details. */
|
|
41
58
|
// biome-ignore lint/complexity/useMaxParams: plan id construction needs all positional args
|
|
42
59
|
export function generatePlanId(
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
generatePlanId,
|
|
30
30
|
isPlanFresh,
|
|
31
31
|
type RefactorPlan,
|
|
32
|
+
validateSynchronizedContentFingerprints,
|
|
32
33
|
} from "./refactor-plans.ts";
|
|
33
34
|
import {
|
|
34
35
|
PUBLIC_REFACTOR_OPERATION_NAMES,
|
|
@@ -189,6 +190,17 @@ async function planResolvedRefactor(
|
|
|
189
190
|
result.authorizedMutationRoots,
|
|
190
191
|
);
|
|
191
192
|
if (authority.kind === "unavailable") return authority;
|
|
193
|
+
const fileFingerprints = collectFileFingerprints(
|
|
194
|
+
result.edits.edits,
|
|
195
|
+
sectionRename.sourceFingerprint
|
|
196
|
+
? { file, fingerprint: sectionRename.sourceFingerprint }
|
|
197
|
+
: undefined,
|
|
198
|
+
);
|
|
199
|
+
const snapshotError = validateSynchronizedContentFingerprints(
|
|
200
|
+
result.edits.documentPreconditions,
|
|
201
|
+
fileFingerprints,
|
|
202
|
+
);
|
|
203
|
+
if (snapshotError) return { kind: "unavailable", reason: snapshotError };
|
|
192
204
|
|
|
193
205
|
const plan: RefactorPlan = {
|
|
194
206
|
id: generatePlanId(
|
|
@@ -206,12 +218,7 @@ async function planResolvedRefactor(
|
|
|
206
218
|
edits: result.edits,
|
|
207
219
|
evidenceSource: sectionRename.evidenceSource,
|
|
208
220
|
authorizedMutationRoots: authority.canonicalRoots,
|
|
209
|
-
fileFingerprints
|
|
210
|
-
result.edits.edits,
|
|
211
|
-
sectionRename.sourceFingerprint
|
|
212
|
-
? { file, fingerprint: sectionRename.sourceFingerprint }
|
|
213
|
-
: undefined,
|
|
214
|
-
),
|
|
221
|
+
fileFingerprints,
|
|
215
222
|
createdAt: Date.now(),
|
|
216
223
|
};
|
|
217
224
|
deps.storePlan(plan);
|
|
@@ -50,6 +50,8 @@ export interface TargetStoreEntry {
|
|
|
50
50
|
displayCharacter: number;
|
|
51
51
|
name: string | null;
|
|
52
52
|
kind: string | null;
|
|
53
|
+
/** Structural source-language declaration kind; it does not change identity. */
|
|
54
|
+
nativeKind?: string;
|
|
53
55
|
confidence: ConfidenceMode;
|
|
54
56
|
/** Monotonic provider families that established this target. */
|
|
55
57
|
provenance: readonly TargetProviderProvenance[];
|
|
@@ -82,6 +84,8 @@ export interface TargetRegistrationInput {
|
|
|
82
84
|
displayCharacter: number;
|
|
83
85
|
name: string | null;
|
|
84
86
|
kind: string | null;
|
|
87
|
+
/** Structural source-language declaration kind; it does not change identity. */
|
|
88
|
+
nativeKind?: string;
|
|
85
89
|
/** Provider-independent declaration kind used only for stable identity. */
|
|
86
90
|
identityKind?: string;
|
|
87
91
|
confidence: ConfidenceMode;
|
|
@@ -251,6 +255,7 @@ export function registerWorkflowTarget(
|
|
|
251
255
|
displayCharacter: input.displayCharacter,
|
|
252
256
|
name: input.name,
|
|
253
257
|
kind: input.kind,
|
|
258
|
+
...(input.nativeKind ? { nativeKind: input.nativeKind } : {}),
|
|
254
259
|
confidence: input.confidence,
|
|
255
260
|
provenance: normalizeProvenance(input.provenance),
|
|
256
261
|
anchorKind: input.anchorKind,
|
|
@@ -59,6 +59,7 @@ export type TargetWorkflowOutcome =
|
|
|
59
59
|
totalCount: number;
|
|
60
60
|
omittedCount: number;
|
|
61
61
|
unknownNestingCount: number;
|
|
62
|
+
partial?: ResolvedTargetGroupData["partial"];
|
|
62
63
|
}
|
|
63
64
|
| ({
|
|
64
65
|
kind: "disambiguation";
|
|
@@ -353,6 +354,7 @@ function registerTargetGroup(
|
|
|
353
354
|
totalCount,
|
|
354
355
|
omittedCount: totalCount - targets.length,
|
|
355
356
|
unknownNestingCount: group.unknownNestingCount,
|
|
357
|
+
...(group.partial ? { partial: group.partial } : {}),
|
|
356
358
|
});
|
|
357
359
|
}
|
|
358
360
|
|
|
@@ -386,6 +388,7 @@ function registerFromTargetData(
|
|
|
386
388
|
displayCharacter: target.displayCharacter,
|
|
387
389
|
name: target.name,
|
|
388
390
|
kind: target.kind,
|
|
391
|
+
nativeKind: target.nativeKind,
|
|
389
392
|
identityKind: target.identityKind ?? canonicalDeclarationKind(target.kind),
|
|
390
393
|
confidence: target.confidence,
|
|
391
394
|
provenance: target.provenance,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { realpathSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
|
+
import type { CFamilyFileAssociationResolver } from "@mrclrchtr/supi-code-runtime/api";
|
|
4
5
|
import { getDefaultWorkspaceRuntime } from "@mrclrchtr/supi-code-runtime/api";
|
|
5
6
|
import {
|
|
6
7
|
type AutomaticLspPathPolicy,
|
|
@@ -8,6 +9,7 @@ import {
|
|
|
8
9
|
LspRuntimeController,
|
|
9
10
|
} from "@mrclrchtr/supi-lsp/api";
|
|
10
11
|
import { TreeSitterRuntimeController } from "@mrclrchtr/supi-tree-sitter/api";
|
|
12
|
+
import { loadProjectFileAssociations } from "../config.ts";
|
|
11
13
|
|
|
12
14
|
const HOSTS = Symbol.for("supi-code-intelligence/workspace-provider-hosts");
|
|
13
15
|
const CLOSING_HOSTS = Symbol.for("supi-code-intelligence/closing-workspace-provider-hosts");
|
|
@@ -22,6 +24,8 @@ export interface WorkspaceProviderHostLease {
|
|
|
22
24
|
lspController: LspRuntimeController | null;
|
|
23
25
|
/** Immutable automatic exclusion policy captured for this lease. */
|
|
24
26
|
automaticPathPolicy: AutomaticLspPathPolicy;
|
|
27
|
+
/** Shared immutable C-family language snapshot captured by the host. */
|
|
28
|
+
fileAssociations: CFamilyFileAssociationResolver;
|
|
25
29
|
sentinelSnapshot: Map<string, number>;
|
|
26
30
|
release(): Promise<void>;
|
|
27
31
|
}
|
|
@@ -66,6 +70,8 @@ class WorkspaceProviderHost {
|
|
|
66
70
|
#settledStart = Promise.resolve();
|
|
67
71
|
#closed = false;
|
|
68
72
|
#automaticPathPolicies = new Map<boolean, AutomaticLspPathPolicy>();
|
|
73
|
+
#fileAssociations: CFamilyFileAssociationResolver | null = null;
|
|
74
|
+
#projectTrusted: boolean | null = null;
|
|
69
75
|
/** One configuration home owns all providers and policies until shutdown. */
|
|
70
76
|
#homeDir: string | null = null;
|
|
71
77
|
|
|
@@ -81,6 +87,13 @@ class WorkspaceProviderHost {
|
|
|
81
87
|
`Workspace ${this.cwd} already uses configuration home ${this.#homeDir}. Cannot use ${normalizedHome} until all existing provider leases are released.`,
|
|
82
88
|
);
|
|
83
89
|
}
|
|
90
|
+
if (this.#projectTrusted !== null && this.#projectTrusted !== projectTrusted) {
|
|
91
|
+
throw new Error(
|
|
92
|
+
`Workspace ${this.cwd} already uses projectTrusted=${this.#projectTrusted}. Cannot use projectTrusted=${projectTrusted} until all existing provider leases are released.`,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
const fileAssociations =
|
|
96
|
+
this.#fileAssociations ?? loadProjectFileAssociations(this.cwd, projectTrusted);
|
|
84
97
|
const automaticPathPolicy =
|
|
85
98
|
this.#automaticPathPolicies.get(projectTrusted) ??
|
|
86
99
|
createDefaultAutomaticLspPathPolicy(this.cwd, {
|
|
@@ -88,11 +101,15 @@ class WorkspaceProviderHost {
|
|
|
88
101
|
homeDir: normalizedHome,
|
|
89
102
|
});
|
|
90
103
|
this.#homeDir = normalizedHome;
|
|
104
|
+
this.#projectTrusted = projectTrusted;
|
|
105
|
+
this.#fileAssociations = fileAssociations;
|
|
91
106
|
this.#automaticPathPolicies.set(projectTrusted, automaticPathPolicy);
|
|
92
107
|
// Count this pending acquirer before awaiting startup so the final active lease cannot shut it down.
|
|
93
108
|
this.#leases++;
|
|
94
109
|
this.#settledStart = this.#settledStart
|
|
95
|
-
.then(() =>
|
|
110
|
+
.then(() =>
|
|
111
|
+
this.#startMissing(projectTrusted, automaticPathPolicy, fileAssociations, normalizedHome),
|
|
112
|
+
)
|
|
96
113
|
.catch(() => undefined);
|
|
97
114
|
await this.#settledStart;
|
|
98
115
|
let released = false;
|
|
@@ -100,6 +117,7 @@ class WorkspaceProviderHost {
|
|
|
100
117
|
cwd: this.cwd,
|
|
101
118
|
lspController: projectTrusted ? this.#lsp : null,
|
|
102
119
|
automaticPathPolicy,
|
|
120
|
+
fileAssociations,
|
|
103
121
|
sentinelSnapshot:
|
|
104
122
|
projectTrusted && this.#lsp?.kind === "ready"
|
|
105
123
|
? (this.#lsp.workspaceRuntime?.scanWorkspaceSentinels() ?? new Map())
|
|
@@ -127,12 +145,13 @@ class WorkspaceProviderHost {
|
|
|
127
145
|
async #startMissing(
|
|
128
146
|
projectTrusted: boolean,
|
|
129
147
|
automaticPathPolicy: AutomaticLspPathPolicy,
|
|
148
|
+
fileAssociations: CFamilyFileAssociationResolver,
|
|
130
149
|
homeDir?: string,
|
|
131
150
|
): Promise<void> {
|
|
132
151
|
const runtime = getDefaultWorkspaceRuntime();
|
|
133
152
|
if (!this.#treeStarted) {
|
|
134
153
|
this.#treeStarted = true;
|
|
135
|
-
this.#tree = new TreeSitterRuntimeController(this.cwd, runtime);
|
|
154
|
+
this.#tree = new TreeSitterRuntimeController(this.cwd, runtime, fileAssociations);
|
|
136
155
|
await this.#tree.start().catch(() => undefined);
|
|
137
156
|
}
|
|
138
157
|
if (!projectTrusted || this.#lspStarted) return;
|
|
@@ -141,6 +160,7 @@ class WorkspaceProviderHost {
|
|
|
141
160
|
automaticPathPolicy,
|
|
142
161
|
projectTrusted,
|
|
143
162
|
homeDir,
|
|
163
|
+
fileAssociations,
|
|
144
164
|
});
|
|
145
165
|
await this.#lsp.start().catch(() => undefined);
|
|
146
166
|
}
|
|
@@ -29,13 +29,24 @@ export function renderStructuredEmptyState(options: {
|
|
|
29
29
|
return lines.join("\n");
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
function renderFailureSummary(failures:
|
|
32
|
+
function renderFailureSummary(failures: StructuredPatternResult["failures"]): string[] {
|
|
33
33
|
if (failures.length === 0) return [];
|
|
34
|
+
const partialCount = failures.filter((failure) => failure.kind === "partial").length;
|
|
35
|
+
const unavailableCount = failures.length - partialCount;
|
|
36
|
+
const summary =
|
|
37
|
+
unavailableCount === 0
|
|
38
|
+
? "had partial syntax evidence"
|
|
39
|
+
: partialCount === 0
|
|
40
|
+
? "could not be analyzed"
|
|
41
|
+
: "had incomplete or unavailable structural evidence";
|
|
34
42
|
const lines: string[] = [
|
|
35
|
-
`**${failures.length} file${failures.length === 1 ? "" : "s"}
|
|
43
|
+
`**${failures.length} file${failures.length === 1 ? "" : "s"} ${summary}:**`,
|
|
36
44
|
];
|
|
37
45
|
for (const failure of failures.slice(0, 5)) {
|
|
38
|
-
|
|
46
|
+
const locations = failure.errorRanges?.length
|
|
47
|
+
? ` Errors: ${failure.errorRanges.map((range) => `L${range.start.line + 1}:${range.start.character + 1}`).join(", ")}.`
|
|
48
|
+
: "";
|
|
49
|
+
lines.push(`- \`${failure.file}\` — ${failure.reason}${locations}`);
|
|
39
50
|
}
|
|
40
51
|
if (failures.length > 5) lines.push(`- _+${failures.length - 5} more_`);
|
|
41
52
|
return lines;
|
|
@@ -117,7 +128,9 @@ export function renderStructuredMatches(
|
|
|
117
128
|
for (const [file, fileMatches] of grouped) {
|
|
118
129
|
lines.push(`### ${file}`);
|
|
119
130
|
for (const match of fileMatches) {
|
|
120
|
-
lines.push(
|
|
131
|
+
lines.push(
|
|
132
|
+
`- \`${match.name}\` (${match.kind}) L${match.line}:${match.startCharacter}–L${match.endLine}:${match.endCharacter}`,
|
|
133
|
+
);
|
|
121
134
|
}
|
|
122
135
|
lines.push("");
|
|
123
136
|
}
|
|
@@ -72,7 +72,13 @@ export function assembleFindWorkflowResult(
|
|
|
72
72
|
omittedCount: assembled.totals.omittedCount,
|
|
73
73
|
evidenceLists: [...assembled.evidenceLists],
|
|
74
74
|
nextQueries: assembledNextQueries(assembled),
|
|
75
|
-
...(outcome.data.kind === "ast"
|
|
75
|
+
...(outcome.data.kind === "ast"
|
|
76
|
+
? {
|
|
77
|
+
scan: outcome.data.result.scan,
|
|
78
|
+
astMatches: [...outcome.data.result.matches],
|
|
79
|
+
structuralFailures: [...outcome.data.result.failures],
|
|
80
|
+
}
|
|
81
|
+
: {}),
|
|
76
82
|
...(outcome.data.kind === "semantic" && outcome.data.partialMetadata?.automaticPathExclusion
|
|
77
83
|
? { automaticPathExclusion: outcome.data.partialMetadata.automaticPathExclusion }
|
|
78
84
|
: {}),
|
|
@@ -129,8 +135,16 @@ function findItems(
|
|
|
129
135
|
|
|
130
136
|
function formatFindDisplayItem(kind: "semantic" | "ast", item: unknown): string {
|
|
131
137
|
if (kind === "ast") {
|
|
132
|
-
const match = item as {
|
|
133
|
-
|
|
138
|
+
const match = item as {
|
|
139
|
+
name: string;
|
|
140
|
+
kind: string;
|
|
141
|
+
file: string;
|
|
142
|
+
line: number;
|
|
143
|
+
startCharacter: number;
|
|
144
|
+
endLine: number;
|
|
145
|
+
endCharacter: number;
|
|
146
|
+
};
|
|
147
|
+
return `${match.name} (${match.kind}) — ${match.file}:L${match.line}:${match.startCharacter}–L${match.endLine}:${match.endCharacter}`;
|
|
134
148
|
}
|
|
135
149
|
|
|
136
150
|
const symbol = item as {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SourceRange } from "@mrclrchtr/supi-code-runtime/api";
|
|
1
2
|
import type { EvidenceListMetadata } from "../../analysis/evidence.ts";
|
|
2
3
|
import type { ReadNextItem } from "../../analysis/read-next.ts";
|
|
3
4
|
import type { CalleeScope } from "../../analysis/relations/types.ts";
|
|
@@ -18,6 +19,7 @@ export interface GraphSectionDetails {
|
|
|
18
19
|
externalCount: number;
|
|
19
20
|
enclosingScope: CalleeScope | null;
|
|
20
21
|
depth: "direct" | "deep" | null;
|
|
22
|
+
recovery?: { file: string; reason: string; errorRanges: readonly SourceRange[] } | null;
|
|
21
23
|
/** Absent in older results whose display rows already contain full paths. */
|
|
22
24
|
fileGroups?: GraphFileGroup[];
|
|
23
25
|
}
|
|
@@ -33,6 +33,7 @@ export function graphDisplaySection(
|
|
|
33
33
|
totalCount: section.evidence.metadata.totalCount,
|
|
34
34
|
omittedCount: section.evidence.metadata.omittedCount,
|
|
35
35
|
partialReason: section.evidence.metadata.partialReason,
|
|
36
|
+
partialMessage: section.evidence.metadata.partialMessage,
|
|
36
37
|
format: (item) => {
|
|
37
38
|
const site = `L${item.line}:${item.character}`;
|
|
38
39
|
if (section.rel !== "callees") return site;
|
|
@@ -17,6 +17,7 @@ export function formatGraphEvidence(
|
|
|
17
17
|
: `${totalCount} ${label}`;
|
|
18
18
|
if (externalCount > 0)
|
|
19
19
|
text += `; ${externalCount} external location${externalCount === 1 ? "" : "s"}`;
|
|
20
|
+
if (metadata.partialMessage) text += ` — ${metadata.partialMessage}`;
|
|
20
21
|
if (invalidLocationCount) {
|
|
21
22
|
const invalidNoun = invalidLocationCount === 1 ? "location" : "locations";
|
|
22
23
|
text += `; ${invalidLocationCount} invalid provider ${invalidNoun} omitted (invalid-provider-location)`;
|