Skip to content

Commit f40b91a

Browse files
committed
fix: remove file existence check from LSP debug and format storage code
1 parent 6404bd0 commit f40b91a

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

packages/opencode/src/cli/cmd/debug/lsp.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { LSP } from "../../../lsp"
22
import { bootstrap } from "../../bootstrap"
33
import { cmd } from "../cmd"
44
import { Log } from "../../../util/log"
5-
import { UI } from "../../ui"
65

76
export const LSPCommand = cmd({
87
command: "lsp",
@@ -16,10 +15,6 @@ const DiagnosticsCommand = cmd({
1615
builder: (yargs) => yargs.positional("file", { type: "string", demandOption: true }),
1716
async handler(args) {
1817
await bootstrap(process.cwd(), async () => {
19-
if (!(await Bun.file(args.file).exists())) {
20-
UI.error(`File ${args.file} does not exist`)
21-
return
22-
}
2318
await LSP.touchFile(args.file, true)
2419
console.log(JSON.stringify(await LSP.diagnostics(), null, 2))
2520
})

packages/opencode/src/storage/storage.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ export namespace Storage {
1414
const MIGRATIONS: Migration[] = [
1515
async (dir) => {
1616
const project = path.resolve(dir, "../project")
17-
for await (const projectDir of new Bun.Glob("*").scan({ cwd: project, onlyFiles: false })) {
17+
for await (const projectDir of new Bun.Glob("*").scan({
18+
cwd: project,
19+
onlyFiles: false,
20+
})) {
1821
log.info(`migrating project ${projectDir}`)
1922
let projectID = projectDir
2023
const fullProjectDir = path.join(project, projectDir)

0 commit comments

Comments
 (0)