opencode-agent[bot] пре 2 месеци
родитељ
комит
be8fee5c2b
1 измењених фајлова са 10 додато и 8 уклоњено
  1. 10 8
      packages/core/src/filesystem/search.ts

+ 10 - 8
packages/core/src/filesystem/search.ts

@@ -225,15 +225,17 @@ export const fffLayer = Layer.effect(
               score: found.value.scores[index]?.total ?? 0,
               score: found.value.scores[index]?.total ?? 0,
             }))
             }))
           })()
           })()
-          return items.sort((a, b) => b.score - a.score || a.path.length - b.path.length).map((item) => {
-            const relative = item.path.replaceAll("\\", "/").replace(/\/$/, "")
-            const absolute = path.resolve(location.directory, relative)
-            return new FileSystem.Entry({
-              path: RelativePath.make(relative + (item.type === "directory" ? path.sep : "")),
-              type: item.type,
-              mime: item.type === "directory" ? "application/x-directory" : FSUtil.mimeType(absolute),
+          return items
+            .sort((a, b) => b.score - a.score || a.path.length - b.path.length)
+            .map((item) => {
+              const relative = item.path.replaceAll("\\", "/").replace(/\/$/, "")
+              const absolute = path.resolve(location.directory, relative)
+              return new FileSystem.Entry({
+                path: RelativePath.make(relative + (item.type === "directory" ? path.sep : "")),
+                type: item.type,
+                mime: item.type === "directory" ? "application/x-directory" : FSUtil.mimeType(absolute),
+              })
             })
             })
-          })
         }),
         }),
     })
     })
   }),
   }),