Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/opencode/specs/effect-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,5 @@ Still open and likely worth migrating:
- [ ] `SessionCompaction`
- [ ] `Provider`
- [ ] `Project`
- [ ] `LSP`
- [x] `LSP`
- [ ] `MCP`
3 changes: 3 additions & 0 deletions packages/opencode/src/effect/instances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { File } from "@/file/service"
import { FileTime } from "@/file/time-service"
import { FileWatcher } from "@/file/watcher"
import { Format } from "@/format/service"
import { LSP } from "@/lsp"
import { Permission } from "@/permission/service"
import { Instance } from "@/project/instance"
import { Vcs } from "@/project/vcs"
Expand All @@ -26,6 +27,7 @@ export type InstanceServices =
| File.Service
| Skill.Service
| Snapshot.Service
| LSP.Service

// NOTE: LayerMap only passes the key (directory string) to lookup, but we need
// the full instance context (directory, worktree, project). We read from the
Expand All @@ -46,6 +48,7 @@ function lookup(_key: string) {
File.layer,
Skill.defaultLayer,
Snapshot.defaultLayer,
LSP.layer,
).pipe(Layer.provide(ctx))
}

Expand Down
4 changes: 4 additions & 0 deletions packages/opencode/src/effect/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export function runPromiseInstance<A, E>(effect: Effect.Effect<A, E, InstanceSer
return runtime.runPromise(effect.pipe(Effect.provide(Instances.get(Instance.directory))))
}

export function runSyncInstance<A, E>(effect: Effect.Effect<A, E, InstanceServices>) {
return runtime.runSync(effect.pipe(Effect.provide(Instances.get(Instance.directory))))
}

export function disposeRuntime() {
return runtime.dispose()
}
Loading
Loading