MCPcopy Create free account
hub / github.com/continuedev/continue / runRipgrepQuery

Method runRipgrepQuery

extensions/vscode/src/VsCodeIde.ts:444–474  ·  view source on GitHub ↗
(dirUri: string, args: string[])

Source from the content-addressed store, hash-verified

442 }
443
444 runRipgrepQuery(dirUri: string, args: string[]) {
445 const relativeDir = vscode.Uri.parse(dirUri).fsPath;
446 const ripGrepUri = vscode.Uri.joinPath(
447 getExtensionUri(),
448 "out/node_modules/@vscode/ripgrep/bin/rg",
449 );
450 const p = child_process.spawn(ripGrepUri.fsPath, args, {
451 cwd: relativeDir,
452 });
453 let output = "";
454
455 p.stdout.on("data", (data) => {
456 output += data.toString();
457 });
458
459 return new Promise<string>((resolve, reject) => {
460 p.on("error", reject);
461 p.on("close", (code) => {
462 if (code === 0) {
463 resolve(output);
464 } else if (code === 1) {
465 // No matches
466 resolve(
467 "No matches found. Build, secrets, etc. dirs and files are not included.",
468 );
469 } else {
470 reject(new Error(`Process exited with code ${code}`));
471 }
472 });
473 });
474 }
475
476 async getFileResults(
477 pattern: string,

Callers 2

getFileResultsMethod · 0.95
getSearchResultsMethod · 0.95

Calls 2

getExtensionUriFunction · 0.90
onMethod · 0.65

Tested by

no test coverage detected