( mention: string, )
| 2834 | } |
| 2835 | |
| 2836 | export function parseAtMentionedFileLines( |
| 2837 | mention: string, |
| 2838 | ): AtMentionedFileLines { |
| 2839 | // Parse mentions like "file.txt#L10-20", "file.txt#heading", or just "file.txt" |
| 2840 | // Supports line ranges (#L10, #L10-20) and strips non-line-range fragments (#heading) |
| 2841 | const match = mention.match(/^([^#]+)(?:#L(\d+)(?:-(\d+))?)?(?:#[^#]*)?$/) |
| 2842 | |
| 2843 | if (!match) { |
| 2844 | return { filename: mention } |
| 2845 | } |
| 2846 | |
| 2847 | const [, filename, lineStartStr, lineEndStr] = match |
| 2848 | const lineStart = lineStartStr ? parseInt(lineStartStr, 10) : undefined |
| 2849 | const lineEnd = lineEndStr ? parseInt(lineEndStr, 10) : lineStart |
| 2850 | |
| 2851 | return { filename: filename ?? mention, lineStart, lineEnd } |
| 2852 | } |
| 2853 | |
| 2854 | async function getDiagnosticAttachments( |
| 2855 | toolUseContext: ToolUseContext, |
no outgoing calls
no test coverage detected