The open source coding agent.
TypeScript
sync
Dax Raade1ec815d1b6a
diff --git a/js/src/lsp/index.ts b/js/src/lsp/index.tsindex ac200fc51eb..f20a15e7050 100644--- a/js/src/lsp/index.ts+++ b/js/src/lsp/index.ts@@ -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"],+ },+ ];}diff --git a/js/src/lsp/language.ts b/js/src/lsp/language.tsindex 0a9bc0f7fbd..964ebc803f3 100644--- a/js/src/lsp/language.ts+++ b/js/src/lsp/language.ts@@ -1,4 +1,4 @@-export const LANGUAGE_EXTENSIONS: Record<string, string> = {+export const LANGUAGE_EXTENSIONS = {".abap": "abap",".bat": "bat",".bib": "bibtex",@@ -80,4 +80,4 @@ export const LANGUAGE_EXTENSIONS: Record<string, string> = {".xsl": "xsl",".yaml": "yaml",".yml": "yaml",-};+} as const;diff --git a/js/src/tool/util/file-times.ts b/js/src/tool/util/file-times.tsindex d07c5264c2f..aab562dd458 100644--- a/js/src/tool/util/file-times.ts+++ b/js/src/tool/util/file-times.ts@@ -1,7 +1,7 @@import { App } from "../../app";export namespace FileTimes {- export const state = App.state("tool.edit", () => ({+ export const state = App.state("tool.filetimes", () => ({read: new Map<string, Date>(),write: new Map<string, Date>(),}));