MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / loadFileImpactSymbols

Function loadFileImpactSymbols

graph-ui/src/impact/change-set.ts:96–107  ·  view source on GitHub ↗
(client: ChangeSymbolSource, project: string, filePath: string)

Source from the content-addressed store, hash-verified

94 queryRows(project: string, query: string): Promise<Record<string, string>[]>;
95}
96export async function loadFileImpactSymbols(client: ChangeSymbolSource, project: string, filePath: string): Promise<SelectionImpactTarget[]> {
97 const results = await Promise.all(['Function', 'Method'].map(label => client.queryRows(project,
98 `MATCH (n:${label}) WHERE n.file_path = ${JSON.stringify(filePath)} RETURN n.name, n.qualified_name, n.file_path, n.start_line LIMIT 200`)));
99 const unique = new Map<string, SelectionImpactTarget>();
100 for (const row of results.flat()) {
101 const qualifiedName = row['n.qualified_name'];
102 if (!qualifiedName || row['n.file_path'] !== filePath) continue;
103 unique.set(qualifiedName, { name: row['n.name'], qualifiedName, filePath,
104 ...(Number(row['n.start_line']) > 0 ? { line: Number(row['n.start_line']) } : {}) });
105 }
106 return [...unique.values()].sort((a, b) => (a.line ?? 0) - (b.line ?? 0));
107}
108
109export function localDiffCommand(base: string, filePath: string): string {
110 if (!validChangeRef(base)) return '';

Callers 1

change-set.test.tsFile · 0.90

Calls 1

queryRowsMethod · 0.65

Tested by

no test coverage detected