fix(grep): follow symlinks by default in ripgrep searches (#7501)

This commit is contained in:
Kenny
2026-01-10 11:57:18 -05:00
committed by GitHub
parent 02b7eb59f8
commit d5738f542c
2 changed files with 9 additions and 2 deletions

View File

@@ -367,8 +367,15 @@ export namespace Ripgrep {
return lines.join("\n")
}
export async function search(input: { cwd: string; pattern: string; glob?: string[]; limit?: number }) {
export async function search(input: {
cwd: string
pattern: string
glob?: string[]
limit?: number
follow?: boolean
}) {
const args = [`${await filepath()}`, "--json", "--hidden", "--glob='!.git/*'"]
if (input.follow !== false) args.push("--follow")
if (input.glob) {
for (const g of input.glob) {

View File

@@ -33,7 +33,7 @@ export const GrepTool = Tool.define("grep", {
const searchPath = params.path || Instance.directory
const rgPath = await Ripgrep.filepath()
const args = ["-nH", "--field-match-separator=|", "--regexp", params.pattern]
const args = ["-nH", "--hidden", "--follow", "--field-match-separator=|", "--regexp", params.pattern]
if (params.include) {
args.push("--glob", params.include)
}