This commit is contained in:
Dax Raad
2025-05-26 13:39:16 -04:00
parent 2ed17f4877
commit e1ec815d1b
3 changed files with 30 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ export namespace LSP {
const state = App.state("lsp", async () => {
const clients = new Map<string, LSPClient.Info>();
// QUESTION: how lazy should lsp auto discovery be? should it not initialize until a file is opened?
clients.set(
"typescript",
await LSPClient.create({
@@ -28,4 +29,30 @@ export namespace LSP {
const tasks = clients.map((x) => input(x));
return Promise.all(tasks);
}
const AUTO: {
command: string[];
extensions: string[];
install?: () => Promise<void>;
}[] = [
{
command: ["bun", "x", "typescript-language-server", "--stdio"],
extensions: [
"ts",
"tsx",
"js",
"jsx",
"mjs",
"cjs",
"mts",
"cts",
"mtsx",
"ctsx",
],
},
{
command: ["gopls"],
extensions: ["go"],
},
];
}