(line: string)
| 77 | } |
| 78 | |
| 79 | function parseRipgrepLine(line: string): { |
| 80 | filePath: string |
| 81 | lineNumber: string |
| 82 | content: string |
| 83 | isContext: boolean |
| 84 | } | null { |
| 85 | // Try match line pattern: filename:digits:content |
| 86 | const matchLineMatch = line.match(/(.*?):(\d+):(.*)$/) |
| 87 | if (matchLineMatch) { |
| 88 | return { |
| 89 | filePath: matchLineMatch[1], |
| 90 | lineNumber: matchLineMatch[2], |
| 91 | content: matchLineMatch[3], |
| 92 | isContext: false, |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | // Try context line pattern: filename-digits-content |
| 97 | const contextLineMatch = line.match(/(.*?)-(\d+)-(.*)$/) |
| 98 | if (contextLineMatch) { |
| 99 | return { |
| 100 | filePath: contextLineMatch[1], |
| 101 | lineNumber: contextLineMatch[2], |
| 102 | content: contextLineMatch[3], |
| 103 | isContext: true, |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | return null |
| 108 | } |
| 109 | |
| 110 | function countFormattedMatches(lines: string[]): number { |
| 111 | return lines.filter((line) => { |
no outgoing calls
no test coverage detected