File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -47,13 +47,31 @@ import { Pty } from "@/pty"
4747import { Installation } from "@/installation"
4848import { ShareNext } from "@/share/share-next"
4949import { SessionShare } from "@/share/session"
50+ import * as Effect from "effect/Effect"
51+
52+ // Adjusts the default Config layer to ensure that plugins are always initialised before
53+ // any other layers read the current config
54+ const ConfigWithPluginPriority = Layer . effect (
55+ Config . Service ,
56+ Effect . gen ( function * ( ) {
57+ const config = yield * Config . Service
58+ const plugin = yield * Plugin . Service
59+
60+ return {
61+ ...config ,
62+ get : ( ) => Effect . andThen ( plugin . init ( ) , config . get ) ,
63+ getGlobal : ( ) => Effect . andThen ( plugin . init ( ) , config . getGlobal ) ,
64+ getConsoleState : ( ) => Effect . andThen ( plugin . init ( ) , config . getConsoleState ) ,
65+ }
66+ } ) ,
67+ ) . pipe ( Layer . provide ( Layer . merge ( Plugin . defaultLayer , Config . defaultLayer ) ) )
5068
5169export const AppLayer = Layer . mergeAll (
5270 AppFileSystem . defaultLayer ,
5371 Bus . defaultLayer ,
5472 Auth . defaultLayer ,
5573 Account . defaultLayer ,
56- Config . defaultLayer ,
74+ ConfigWithPluginPriority ,
5775 Git . defaultLayer ,
5876 Ripgrep . defaultLayer ,
5977 FileTime . defaultLayer ,
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import * as Effect from "effect/Effect"
1515
1616export const InstanceBootstrap = Effect . gen ( function * ( ) {
1717 Log . Default . info ( "bootstrapping" , { directory : Instance . directory } )
18- yield * Plugin . Service . use ( ( svc ) => svc . init ( ) )
1918 yield * Effect . all (
2019 [
2120 LSP . Service ,
You can’t perform that action at this time.
0 commit comments