(atMentioned: IDEAtMentioned)
| 1281 | // Insert the at-mentioned reference (the file and, optionally, a line range) when |
| 1282 | // we receive an at-mentioned notification the IDE. |
| 1283 | const onIdeAtMentioned = function (atMentioned: IDEAtMentioned) { |
| 1284 | logEvent('tengu_ext_at_mentioned', {}); |
| 1285 | let atMentionedText: string; |
| 1286 | const relativePath = path.relative(getCwd(), atMentioned.filePath); |
| 1287 | if (atMentioned.lineStart && atMentioned.lineEnd) { |
| 1288 | atMentionedText = atMentioned.lineStart === atMentioned.lineEnd ? `@${relativePath}#L${atMentioned.lineStart} ` : `@${relativePath}#L${atMentioned.lineStart}-${atMentioned.lineEnd} `; |
| 1289 | } else { |
| 1290 | atMentionedText = `@${relativePath} `; |
| 1291 | } |
| 1292 | const cursorChar = input[cursorOffset - 1] ?? ' '; |
| 1293 | if (!/\s/.test(cursorChar)) { |
| 1294 | atMentionedText = ` ${atMentionedText}`; |
| 1295 | } |
| 1296 | insertTextAtCursor(atMentionedText); |
| 1297 | }; |
| 1298 | useIdeAtMentioned(mcpClients, onIdeAtMentioned); |
| 1299 | |
| 1300 | // Handler for chat:undo - undo last edit |
nothing calls this directly
no test coverage detected