GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(core): break filesystem search import cycle (#50439) · dmouse/opencode@f5ce4f8

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/core/src/filesystem
    • search.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/core/src/filesystem/search.ts‎

Copy file name to clipboardExpand all lines: packages/core/src/filesystem/search.ts
+10-9Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import path from "path"
55
import { Context, Effect, Layer, Scope } from "effect"
66
import { Fff } from "#fff"
77
import fuzzysort from "fuzzysort"
8-
import { FileSystem } from "../filesystem"
8+
import { Entry, Match } from "@opencode-ai/schema/filesystem"
9+
import type { FileSystem } from "../filesystem"
910
import { FSUtil } from "../fs-util"
1011
import { Location } from "../location"
1112
import { Ripgrep } from "../ripgrep"
@@ -61,7 +62,7 @@ export const ripgrepLayer = Layer.effect(
6162
.pipe(
6263
Effect.map((result) =>
6364
result.map((entry) =>
64-
FileSystem.Entry.make({
65+
Entry.make({
6566
...entry,
6667
path: RelativePath.make(path.relative(location.directory, path.resolve(cwd, entry.path))),
6768
}),
@@ -86,9 +87,9 @@ export const ripgrepLayer = Layer.effect(
8687
.pipe(
8788
Effect.map((result) =>
8889
result.map((match) =>
89-
FileSystem.Match.make({
90+
Match.make({
9091
...match,
91-
entry: FileSystem.Entry.make({
92+
entry: Entry.make({
9293
...match.entry,
9394
path: RelativePath.make(path.relative(location.directory, path.resolve(cwd, match.entry.path))),
9495
}),
@@ -109,7 +110,7 @@ export const ripgrepLayer = Layer.effect(
109110
return fuzzysort.go(input.query, items, { limit: input.limit ?? 50 }).map((item) => {
110111
const relative = item.target
111112
const type = relative.endsWith(path.sep) ? ("directory" as const) : ("file" as const)
112-
return FileSystem.Entry.make({
113+
return Entry.make({
113114
path: RelativePath.make(relative),
114115
type,
115116
})
@@ -154,7 +155,7 @@ export const fffLayer = Layer.effect(
154155
})
155156
if (!found.ok) throw found.error
156157
return found.value.items.map((item) =>
157-
FileSystem.Entry.make({
158+
Entry.make({
158159
path: RelativePath.make(item.relativePath.replaceAll("\\", "/")),
159160
type: "file",
160161
}),
@@ -172,8 +173,8 @@ export const fffLayer = Layer.effect(
172173
if (!found.ok) throw found.error
173174
return found.value.items.map((match) => {
174175
const bytes = Buffer.from(match.lineContent)
175-
return FileSystem.Match.make({
176-
entry: FileSystem.Entry.make({
176+
return Match.make({
177+
entry: Entry.make({
177178
path: RelativePath.make(match.relativePath.replaceAll("\\", "/")),
178179
type: "file",
179180
}),
@@ -222,7 +223,7 @@ export const fffLayer = Layer.effect(
222223
.sort((a, b) => b.score - a.score || a.path.length - b.path.length)
223224
.map((item) => {
224225
const relative = item.path.replaceAll("\\", "/").replace(/\/$/, "")
225-
return FileSystem.Entry.make({
226+
return Entry.make({
226227
path: RelativePath.make(relative + (item.type === "directory" ? path.sep : "")),
227228
type: item.type,
228229
})

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.