ignore: rework bootstrap so server lazy starts it

This commit is contained in:
Dax Raad
2025-09-19 05:11:29 -04:00
parent 0e19ca21ed
commit ae6154e1c3
13 changed files with 690 additions and 637 deletions

View File

@@ -1,19 +1,14 @@
import { Format } from "../format"
import { LSP } from "../lsp"
import { Plugin } from "../plugin"
import { InstanceBootstrap } from "../project/bootstrap"
import { Instance } from "../project/instance"
import { Share } from "../share/share"
import { Snapshot } from "../snapshot"
export async function bootstrap<T>(directory: string, cb: () => Promise<T>) {
return Instance.provide(directory, async () => {
await Plugin.init()
Share.init()
Format.init()
LSP.init()
Snapshot.init()
const result = await cb()
await Instance.dispose()
return result
return Instance.provide({
directory,
init: InstanceBootstrap,
fn: async () => {
const result = await cb()
await Instance.dispose()
return result
},
})
}