1- import { Plugin } from "../plugin"
21import { Format } from "../format"
32import { LSP } from "@/lsp/lsp"
43import { File } from "../file"
@@ -9,27 +8,28 @@ import { Bus } from "../bus"
98import { Command } from "../command"
109import { Instance } from "./instance"
1110import * as Log from "@opencode-ai/core/util/log"
11+ import { Plugin } from "../plugin"
1212import { FileWatcher } from "@/file/watcher"
1313import { ShareNext } from "@/share/share-next"
1414import * as Effect from "effect/Effect"
1515import { Config } from "@/config/config"
1616
1717export const InstanceBootstrap = Effect . gen ( function * ( ) {
1818 Log . Default . info ( "bootstrapping" , { directory : Instance . directory } )
19- // everything depends on config so eager load it for nice traces
20- yield * Config . Service . use ( ( svc ) => svc . get ( ) )
21- // Plugin can mutate config so it has to be initialized before anything else.
22- yield * Plugin . Service . use ( ( svc ) => svc . init ( ) )
2319 yield * Effect . all (
2420 [
25- LSP . Service ,
26- ShareNext . Service ,
27- Format . Service ,
28- File . Service ,
29- FileWatcher . Service ,
30- Vcs . Service ,
31- Snapshot . Service ,
32- ] . map ( ( s ) => Effect . forkDetach ( s . use ( ( i ) => i . init ( ) ) ) ) ,
21+ Config . Service . use ( ( i ) => i . get ( ) ) ,
22+ ...[
23+ Plugin . Service ,
24+ LSP . Service ,
25+ ShareNext . Service ,
26+ Format . Service ,
27+ File . Service ,
28+ FileWatcher . Service ,
29+ Vcs . Service ,
30+ Snapshot . Service ,
31+ ] . map ( ( s ) => s . use ( ( i ) => i . init ( ) ) ) ,
32+ ] . map ( ( e ) => Effect . forkDetach ( e ) ) ,
3333 ) . pipe ( Effect . withSpan ( "InstanceBootstrap.init" ) )
3434
3535 yield * Bus . Service . use ( ( svc ) =>
0 commit comments