@mrclrchtr/supi-code-intelligence 4.1.0 → 4.2.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 +4 -2
- package/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-code-runtime/package.json +2 -2
- package/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-lsp/node_modules/@mrclrchtr/supi-code-runtime/package.json +2 -2
- 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/utils.ts +2 -2
- package/node_modules/@mrclrchtr/supi-tree-sitter/README.md +5 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/node_modules/@mrclrchtr/supi-core/package.json +1 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/node_modules/@mrclrchtr/supi-code-runtime/package.json +2 -2
- 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 +2 -1
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/operation-support.ts +19 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/syntax-node.ts +1 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline-c-family.ts +230 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline-html-sql.ts +186 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline-jvm.ts +311 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline-polyglot.ts +218 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline-scripting.ts +307 -0
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/tool/outline.ts +9 -5
- package/node_modules/@mrclrchtr/supi-tree-sitter/src/types.ts +6 -2
- package/package.json +5 -5
- package/src/analysis/search/pattern.ts +2 -2
- package/src/analysis/target/symbol.ts +5 -2
- package/src/session/orientation/collect.ts +134 -180
- package/src/session/orientation/context-sections.ts +14 -48
- package/src/session/orientation-types.ts +14 -4
- package/src/session/orientation-workflow.ts +20 -48
- package/src/tool/graph/execute.ts +1 -1
- package/src/tool/graph/markdown.ts +222 -0
- package/src/tool/orientation/markdown.ts +66 -11
- package/src/tool/register.ts +10 -0
- package/src/ui/markdown/overview-data.ts +3 -15
- package/src/ui/markdown/overview.ts +4 -10
- package/src/ui/markdown/types.ts +0 -1
- package/src/tool/graph/calls-md.ts +0 -41
- package/src/tool/graph/implementations-md.ts +0 -57
- package/src/tool/graph/markdown-base.ts +0 -88
- package/src/tool/graph/provider-location-md.ts +0 -9
- package/src/tool/graph/references-md.ts +0 -41
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/** Implementations markdown renderer over assembled semantic evidence. */
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
type EvidenceList,
|
|
5
|
-
type EvidenceListMetadata,
|
|
6
|
-
renderEvidenceListMetadataDisclosure,
|
|
7
|
-
} from "../../analysis/evidence.ts";
|
|
8
|
-
import { compactLineRanges } from "../../analysis/references/semantic-refs.ts";
|
|
9
|
-
import type { ImplementationEntry } from "../../analysis/relations/types.ts";
|
|
10
|
-
import { toDisplayPath } from "../../analysis/search/paths.ts";
|
|
11
|
-
import { renderInvalidProviderLocations } from "./provider-location-md.ts";
|
|
12
|
-
|
|
13
|
-
function groupByFile(impls: readonly ImplementationEntry[], cwd: string): Map<string, number[]> {
|
|
14
|
-
const byFile = new Map<string, number[]>();
|
|
15
|
-
for (const impl of impls) {
|
|
16
|
-
const displayPath = toDisplayPath(cwd, impl.file);
|
|
17
|
-
const group = byFile.get(displayPath) ?? [];
|
|
18
|
-
group.push(impl.line);
|
|
19
|
-
byFile.set(displayPath, group);
|
|
20
|
-
}
|
|
21
|
-
return byFile;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function renderImplementationsResult(options: {
|
|
25
|
-
implementations: EvidenceList<ImplementationEntry>;
|
|
26
|
-
externalCount: number;
|
|
27
|
-
cwd: string;
|
|
28
|
-
targetName?: string;
|
|
29
|
-
}): { content: string; evidenceList: EvidenceListMetadata } {
|
|
30
|
-
const lines: string[] = [
|
|
31
|
-
options.targetName
|
|
32
|
-
? `# Implementations of \`${options.targetName}\` (semantic)`
|
|
33
|
-
: "# Implementations (semantic)",
|
|
34
|
-
"",
|
|
35
|
-
];
|
|
36
|
-
const total =
|
|
37
|
-
options.implementations.metadata.totalCount ?? options.implementations.metadata.shownCount;
|
|
38
|
-
if (total > 0) {
|
|
39
|
-
lines.push(`**${total} implementation${total === 1 ? "" : "s"}** in the project`, "");
|
|
40
|
-
for (const [file, locations] of groupByFile(options.implementations.items, options.cwd)) {
|
|
41
|
-
lines.push(`### ${file}`, `- ${compactLineRanges(locations)}`, "");
|
|
42
|
-
}
|
|
43
|
-
const disclosure = renderEvidenceListMetadataDisclosure(options.implementations.metadata);
|
|
44
|
-
if (disclosure) lines.push(disclosure);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (options.externalCount > 0) {
|
|
48
|
-
lines.push(
|
|
49
|
-
`_+${options.externalCount} external location${options.externalCount === 1 ? "" : "s"} (outside this project)_`,
|
|
50
|
-
"",
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
const invalidDisclosure = renderInvalidProviderLocations(options.implementations.metadata);
|
|
54
|
-
if (invalidDisclosure) lines.push(invalidDisclosure, "");
|
|
55
|
-
|
|
56
|
-
return { content: lines.join("\n"), evidenceList: options.implementations.metadata };
|
|
57
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/** Markdown adapter for assembled code_graph evidence. */
|
|
2
|
-
|
|
3
|
-
import { renderReadNextSection } from "../../analysis/read-next.ts";
|
|
4
|
-
import type { GraphResultAssembly } from "../result/graph.ts";
|
|
5
|
-
import { renderCallsResult } from "./calls-md.ts";
|
|
6
|
-
import { renderImplementationsResult } from "./implementations-md.ts";
|
|
7
|
-
import { renderReferencesResult } from "./references-md.ts";
|
|
8
|
-
|
|
9
|
-
/** Render an assembled graph result. */
|
|
10
|
-
export function renderGraphResult(assembly: GraphResultAssembly): string {
|
|
11
|
-
const lines = [
|
|
12
|
-
`# Graph of \`${assembly.displayName}\``,
|
|
13
|
-
"",
|
|
14
|
-
`_File: \`${assembly.resolvedDisplayFile}\`_`,
|
|
15
|
-
"",
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
const available = assembly.sections.filter((section) => section.kind === "ok");
|
|
19
|
-
if (available.length > 0) {
|
|
20
|
-
lines.push(
|
|
21
|
-
available
|
|
22
|
-
.map(
|
|
23
|
-
(section) =>
|
|
24
|
-
`**${section.rel}**: ${sectionCount(section)} result${sectionCount(section) === 1 ? "" : "s"}`,
|
|
25
|
-
)
|
|
26
|
-
.join(" | "),
|
|
27
|
-
"",
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const unavailable = assembly.sections.filter((section) => section.kind === "unavailable");
|
|
32
|
-
if (unavailable.length > 0) {
|
|
33
|
-
lines.push(
|
|
34
|
-
`_Unavailable: ${unavailable.map((section) => `\`${section.rel}\``).join(", ")}_`,
|
|
35
|
-
"",
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
for (const section of assembly.sections) {
|
|
40
|
-
if (section.kind === "unavailable") {
|
|
41
|
-
lines.push(`**${section.rel}**: ${section.message}`, "");
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
switch (section.rel) {
|
|
46
|
-
case "references": {
|
|
47
|
-
const rendered = renderReferencesResult({
|
|
48
|
-
symbolName: assembly.displayName,
|
|
49
|
-
references: section.evidence,
|
|
50
|
-
externalCount: section.data.externalCount,
|
|
51
|
-
confidence: section.data.confidence,
|
|
52
|
-
cwd: assembly.cwd,
|
|
53
|
-
});
|
|
54
|
-
lines.push(rendered.content, "");
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
case "callees": {
|
|
58
|
-
const rendered = renderCallsResult(
|
|
59
|
-
section.data.enclosingScope,
|
|
60
|
-
section.evidence,
|
|
61
|
-
assembly.resolvedDisplayFile,
|
|
62
|
-
section.data.depth,
|
|
63
|
-
);
|
|
64
|
-
lines.push(rendered.content, "");
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
case "implements": {
|
|
68
|
-
const rendered = renderImplementationsResult({
|
|
69
|
-
implementations: section.evidence,
|
|
70
|
-
externalCount: section.data.externalCount,
|
|
71
|
-
cwd: assembly.cwd,
|
|
72
|
-
targetName: assembly.displayName,
|
|
73
|
-
});
|
|
74
|
-
lines.push(rendered.content, "");
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
lines.push(...renderReadNextSection(available.flatMap((section) => section.readNext)));
|
|
81
|
-
return lines.join("\n");
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function sectionCount(
|
|
85
|
-
section: Extract<GraphResultAssembly["sections"][number], { kind: "ok" }>,
|
|
86
|
-
): number {
|
|
87
|
-
return section.evidence.metadata.totalCount ?? section.evidence.metadata.shownCount;
|
|
88
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { EvidenceListMetadata } from "../../analysis/evidence.ts";
|
|
2
|
-
|
|
3
|
-
/** Render an explicit disclosure for unusable semantic-provider locations. */
|
|
4
|
-
export function renderInvalidProviderLocations(metadata: EvidenceListMetadata): string | null {
|
|
5
|
-
const count = metadata.invalidLocationCount ?? 0;
|
|
6
|
-
if (count <= 0 || metadata.partialReason === null) return null;
|
|
7
|
-
const noun = count === 1 ? "location" : "locations";
|
|
8
|
-
return `_${count} invalid provider ${noun} omitted (${metadata.partialReason})_`;
|
|
9
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/** References markdown renderer over assembled semantic evidence. */
|
|
2
|
-
|
|
3
|
-
import type { EvidenceList, EvidenceListMetadata } from "../../analysis/evidence.ts";
|
|
4
|
-
import { formatAssembledReferenceList } from "../../analysis/references/semantic-refs.ts";
|
|
5
|
-
import type { ReferenceEntry } from "../../analysis/relations/types.ts";
|
|
6
|
-
import { toDisplayPath } from "../../analysis/search/paths.ts";
|
|
7
|
-
import { renderInvalidProviderLocations } from "./provider-location-md.ts";
|
|
8
|
-
|
|
9
|
-
export function renderReferencesResult(options: {
|
|
10
|
-
symbolName: string;
|
|
11
|
-
references: EvidenceList<ReferenceEntry>;
|
|
12
|
-
externalCount: number;
|
|
13
|
-
confidence: string;
|
|
14
|
-
cwd: string;
|
|
15
|
-
}): { content: string; evidenceList: EvidenceListMetadata | null } {
|
|
16
|
-
const total = options.references.metadata.totalCount ?? options.references.metadata.shownCount;
|
|
17
|
-
const lines = [
|
|
18
|
-
`# References of \`${options.symbolName}\``,
|
|
19
|
-
"",
|
|
20
|
-
`**${total} reference${total === 1 ? "" : "s"}** (${options.confidence})`,
|
|
21
|
-
];
|
|
22
|
-
if (options.externalCount > 0) {
|
|
23
|
-
lines.push(
|
|
24
|
-
`_+${options.externalCount} external reference${options.externalCount === 1 ? "" : "s"}_`,
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
const invalidDisclosure = renderInvalidProviderLocations(options.references.metadata);
|
|
28
|
-
if (invalidDisclosure) lines.push(invalidDisclosure);
|
|
29
|
-
lines.push("");
|
|
30
|
-
|
|
31
|
-
const displayEvidence = {
|
|
32
|
-
key: options.references.key,
|
|
33
|
-
items: options.references.items.map((reference) => ({
|
|
34
|
-
file: toDisplayPath(options.cwd, reference.file),
|
|
35
|
-
line: reference.line,
|
|
36
|
-
})),
|
|
37
|
-
metadata: options.references.metadata,
|
|
38
|
-
};
|
|
39
|
-
const evidenceList = formatAssembledReferenceList(lines, displayEvidence);
|
|
40
|
-
return { content: lines.join("\n"), evidenceList };
|
|
41
|
-
}
|