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

Function attachSelection

graph-ui/src/App.tsx:4782–4792  ·  view source on GitHub ↗
(selection: ReaderSelection)

Source from the content-addressed store, hash-verified

4780 };
4781
4782 const attachSelection = (selection: ReaderSelection): void => {
4783 if (selection.path !== activePath || document?.path !== activePath) return;
4784 const range = { startLine: selection.startLine, endLine: selection.endLine
4785 - (selection.endColumn === 1 && selection.endLine > selection.startLine ? 1 : 0) };
4786 const symbol = symbolMatchesReader(liveCode.symbol, selection.path, range) ? liveCode.symbol : undefined;
4787 setReaderSelection(selection);
4788 setChatAttachment(undefined);
4789 setChatGraphSelection(inspectorChatContext({ ...liveCode, symbol,
4790 ir: matchingInspectorIr(liveCode.ir, symbol, project, activePath), selection }, crypto.randomUUID()));
4791 setBrowserAiOpen(true);
4792 };
4793 // The chat grounds explanations in the selected symbol's source, read like "Read source evidence" (K14).
4794 const readSymbolSource = useCallback((qualifiedName: string, window: { maxLines: number }) =>
4795 client.getCodeSnippet(project, qualifiedName, window), [client, project]);

Callers 1

ProjectWindowViewFunction · 0.85

Calls 3

symbolMatchesReaderFunction · 0.90
inspectorChatContextFunction · 0.90
matchingInspectorIrFunction · 0.90

Tested by

no test coverage detected