| 85 | |
| 86 | /** One candidate, as the list writes it: the name, the file, the line. */ |
| 87 | export function chatCandidateLabel( |
| 88 | name: string, |
| 89 | filePath: string | undefined, |
| 90 | line: number | undefined, |
| 91 | ): string { |
| 92 | const where = filePath === undefined || filePath.length === 0 |
| 93 | ? 'no file in the index' |
| 94 | : line === undefined ? filePath : `${filePath}:${line}`; |
| 95 | return `${name} (${where})`; |
| 96 | } |
| 97 | |
| 98 | /** The tooltip of a candidate. It names the act and not the thing. */ |
| 99 | export function chatCandidateTitle(name: string): string { |