From f40b91ab7a349e64d9d5d07f24fe1452212839cc Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Tue, 23 Sep 2025 16:49:49 -0400 Subject: [PATCH] fix: remove file existence check from LSP debug and format storage code --- packages/opencode/src/cli/cmd/debug/lsp.ts | 5 ----- packages/opencode/src/storage/storage.ts | 5 ++++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/opencode/src/cli/cmd/debug/lsp.ts b/packages/opencode/src/cli/cmd/debug/lsp.ts index d906e5f8..292c8ba6 100644 --- a/packages/opencode/src/cli/cmd/debug/lsp.ts +++ b/packages/opencode/src/cli/cmd/debug/lsp.ts @@ -2,7 +2,6 @@ import { LSP } from "../../../lsp" import { bootstrap } from "../../bootstrap" import { cmd } from "../cmd" import { Log } from "../../../util/log" -import { UI } from "../../ui" export const LSPCommand = cmd({ command: "lsp", @@ -16,10 +15,6 @@ const DiagnosticsCommand = cmd({ builder: (yargs) => yargs.positional("file", { type: "string", demandOption: true }), async handler(args) { await bootstrap(process.cwd(), async () => { - if (!(await Bun.file(args.file).exists())) { - UI.error(`File ${args.file} does not exist`) - return - } await LSP.touchFile(args.file, true) console.log(JSON.stringify(await LSP.diagnostics(), null, 2)) }) diff --git a/packages/opencode/src/storage/storage.ts b/packages/opencode/src/storage/storage.ts index 976cffdc..546d123c 100644 --- a/packages/opencode/src/storage/storage.ts +++ b/packages/opencode/src/storage/storage.ts @@ -14,7 +14,10 @@ export namespace Storage { const MIGRATIONS: Migration[] = [ async (dir) => { const project = path.resolve(dir, "../project") - for await (const projectDir of new Bun.Glob("*").scan({ cwd: project, onlyFiles: false })) { + for await (const projectDir of new Bun.Glob("*").scan({ + cwd: project, + onlyFiles: false, + })) { log.info(`migrating project ${projectDir}`) let projectID = projectDir const fullProjectDir = path.join(project, projectDir)