fix(grep): follow symlinks by default in ripgrep searches (#7501)
This commit is contained in:
@@ -367,8 +367,15 @@ export namespace Ripgrep {
|
|||||||
return lines.join("\n")
|
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/*'"]
|
const args = [`${await filepath()}`, "--json", "--hidden", "--glob='!.git/*'"]
|
||||||
|
if (input.follow !== false) args.push("--follow")
|
||||||
|
|
||||||
if (input.glob) {
|
if (input.glob) {
|
||||||
for (const g of input.glob) {
|
for (const g of input.glob) {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export const GrepTool = Tool.define("grep", {
|
|||||||
const searchPath = params.path || Instance.directory
|
const searchPath = params.path || Instance.directory
|
||||||
|
|
||||||
const rgPath = await Ripgrep.filepath()
|
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) {
|
if (params.include) {
|
||||||
args.push("--glob", params.include)
|
args.push("--glob", params.include)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user