fix(core): include hidden files in ripgrep file search

This commit is contained in:
Dan Smolsky
2026-11-07 06:46:19 -05:00
Unverified
parent caf8d6a554
commit 1a7f817b97
2 changed files with 20 additions and 0 deletions
+1
View File
@@ -68,6 +68,7 @@ const ripgrepLayer = Layer.effect(
yield* ripgrep.find({
cwd: location.directory,
pattern: "*",
hidden: true,
limit: location.vcs && !home ? Number.MAX_SAFE_INTEGER : 100_000,
exclude: home ? [...Protected.names()].map((name) => `${name}/**`) : undefined,
onEntry: (entry) =>
@@ -200,6 +200,25 @@ describe("FileSystemSearch", () => {
}),
)
it.live("ripgrep search finds hidden files", () =>
Effect.gen(function* () {
const directory = (yield* Effect.acquireDisposable(Effect.promise(() => tmpdir("opencode-search-hidden-")))).path
yield* Effect.promise(() => Bun.write(path.join(directory, ".github/workflows/ci.yml"), "ci"))
const layer = AppNodeBuilder.build(FileSystemSearch.configured({ fff: false }), [
Location.node.replace(
Layer.succeed(Location.Service, Location.Service.of(location({ directory: AbsolutePath.make(directory) }))),
),
])
yield* Effect.gen(function* () {
const search = yield* FileSystemSearch.Service
const found = yield* search
.find({ query: "ci.yml", type: "file" })
.pipe(Effect.map((entries) => entries.map((entry) => entry.path)))
expect(found).toContain(RelativePath.make(".github/workflows/ci.yml"))
}).pipe(Effect.provide(layer))
}),
)
it.live("selects the ripgrep layer for workspace-backed locations even when vcs would pick fff", () =>
Effect.gen(function* () {
const directory = (yield* Effect.acquireDisposable(Effect.promise(() => tmpdir("opencode-search-workspace-"))))