opencode-agent[bot] 3 месяцев назад
Родитель
Сommit
4ae468ff06
1 измененных файлов с 14 добавлено и 16 удалено
  1. 14 16
      packages/core/src/filesystem/search.ts

+ 14 - 16
packages/core/src/filesystem/search.ts

@@ -30,22 +30,20 @@ export const ripgrepLayer = Layer.effect(
       directories: [] as string[],
     }
     const directories = new Set<string>()
-    yield* ripgrep.find({
-      cwd: location.directory,
-      pattern: "*",
-      limit: location.vcs ? Number.MAX_SAFE_INTEGER : 100_000,
-      onEntry: (entry) =>
-        Effect.sync(() => {
-          state.files.push(entry.path)
-          const parts = entry.path.split("/")
-          parts.slice(0, -1).forEach((_, index) => directories.add(parts.slice(0, index + 1).join("/") + path.sep))
-          state.directories = Array.from(directories)
-        }),
-    }).pipe(
-      Effect.orDie,
-      Effect.asVoid,
-      Effect.forkIn(scope),
-    )
+    yield* ripgrep
+      .find({
+        cwd: location.directory,
+        pattern: "*",
+        limit: location.vcs ? Number.MAX_SAFE_INTEGER : 100_000,
+        onEntry: (entry) =>
+          Effect.sync(() => {
+            state.files.push(entry.path)
+            const parts = entry.path.split("/")
+            parts.slice(0, -1).forEach((_, index) => directories.add(parts.slice(0, index + 1).join("/") + path.sep))
+            state.directories = Array.from(directories)
+          }),
+      })
+      .pipe(Effect.orDie, Effect.asVoid, Effect.forkIn(scope))
     return Service.of({
       glob: (input) =>
         Effect.gen(function* () {