(query_0, controller_1, setMatches_0, setTruncated_0, setIsSearching_0)
| 263 | return t15; |
| 264 | } |
| 265 | function _temp4(query_0, controller_1, setMatches_0, setTruncated_0, setIsSearching_0) { |
| 266 | const cwd = getCwd(); |
| 267 | let collected = 0; |
| 268 | ripGrepStream(["-n", "--no-heading", "-i", "-m", String(MAX_MATCHES_PER_FILE), "-F", "-e", query_0], cwd, controller_1.signal, lines => { |
| 269 | if (controller_1.signal.aborted) { |
| 270 | return; |
| 271 | } |
| 272 | const parsed = []; |
| 273 | for (const line of lines) { |
| 274 | const m_1 = parseRipgrepLine(line); |
| 275 | if (!m_1) { |
| 276 | continue; |
| 277 | } |
| 278 | const rel = relativePath(cwd, m_1.file); |
| 279 | parsed.push({ |
| 280 | ...m_1, |
| 281 | file: rel.startsWith("..") ? m_1.file : rel |
| 282 | }); |
| 283 | } |
| 284 | if (!parsed.length) { |
| 285 | return; |
| 286 | } |
| 287 | collected = collected + parsed.length; |
| 288 | collected; |
| 289 | setMatches_0(prev => { |
| 290 | const seen = new Set(prev.map(matchKey)); |
| 291 | const fresh = parsed.filter(p => !seen.has(matchKey(p))); |
| 292 | if (!fresh.length) { |
| 293 | return prev; |
| 294 | } |
| 295 | const next = prev.concat(fresh); |
| 296 | return next.length > MAX_TOTAL_MATCHES ? next.slice(0, MAX_TOTAL_MATCHES) : next; |
| 297 | }); |
| 298 | if (collected >= MAX_TOTAL_MATCHES) { |
| 299 | controller_1.abort(); |
| 300 | setTruncated_0(true); |
| 301 | setIsSearching_0(false); |
| 302 | } |
| 303 | }).catch(_temp2).finally(() => { |
| 304 | if (controller_1.signal.aborted) { |
| 305 | return; |
| 306 | } |
| 307 | if (collected === 0) { |
| 308 | setMatches_0(_temp3); |
| 309 | } |
| 310 | setIsSearching_0(false); |
| 311 | }); |
| 312 | } |
| 313 | function _temp3(m_2) { |
| 314 | return m_2.length ? [] : m_2; |
| 315 | } |
nothing calls this directly
no test coverage detected