feat: add top level lsp: false and formatter: false to allow disabling all formatters or lsps at once

This commit is contained in:
Aiden Cline
2025-11-18 17:44:34 -06:00
parent 429708e3d5
commit 81ebf56cf1
4 changed files with 78 additions and 48 deletions

View File

@@ -62,10 +62,21 @@ export namespace LSP {
async () => {
const clients: LSPClient.Info[] = []
const servers: Record<string, LSPServer.Info> = {}
const cfg = await Config.get()
if (cfg.lsp === false) {
log.info("all LSPs are disabled")
return {
broken: new Set<string>(),
servers,
clients,
spawning: new Map<string, Promise<LSPClient.Info | undefined>>(),
}
}
for (const server of Object.values(LSPServer)) {
servers[server.id] = server
}
const cfg = await Config.get()
for (const [name, item] of Object.entries(cfg.lsp ?? {})) {
const existing = servers[name]
if (item.disabled) {