(context: BrowserChatContext | undefined)
| 43 | |
| 44 | /** The symbol an explanation is about, whether its source is read or already carried. */ |
| 45 | export function selectionSubject(context: BrowserChatContext | undefined): { name: string; kind?: string } | undefined { |
| 46 | if (!context || context.text.length > 128_000) return undefined; |
| 47 | const galaxy = readGalaxyEvidence(context.text); |
| 48 | if (galaxy) return galaxy.rootCount === 1 && galaxy.roots[0] ? { name: galaxy.roots[0].name, kind: galaxy.roots[0].kind } : undefined; |
| 49 | return architectureTarget(context); |
| 50 | } |
| 51 | |
| 52 | /** A bounded, validated source block for the explanation, or undefined when the reply is |
| 53 | * not that symbol's source. The repository-relative path of the selection is kept. */ |
no test coverage detected