mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-08 18:34:59 +01:00
fix: remove file existence check from LSP debug and format storage code
This commit is contained in:
@@ -2,7 +2,6 @@ import { LSP } from "../../../lsp"
|
|||||||
import { bootstrap } from "../../bootstrap"
|
import { bootstrap } from "../../bootstrap"
|
||||||
import { cmd } from "../cmd"
|
import { cmd } from "../cmd"
|
||||||
import { Log } from "../../../util/log"
|
import { Log } from "../../../util/log"
|
||||||
import { UI } from "../../ui"
|
|
||||||
|
|
||||||
export const LSPCommand = cmd({
|
export const LSPCommand = cmd({
|
||||||
command: "lsp",
|
command: "lsp",
|
||||||
@@ -16,10 +15,6 @@ const DiagnosticsCommand = cmd({
|
|||||||
builder: (yargs) => yargs.positional("file", { type: "string", demandOption: true }),
|
builder: (yargs) => yargs.positional("file", { type: "string", demandOption: true }),
|
||||||
async handler(args) {
|
async handler(args) {
|
||||||
await bootstrap(process.cwd(), async () => {
|
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)
|
await LSP.touchFile(args.file, true)
|
||||||
console.log(JSON.stringify(await LSP.diagnostics(), null, 2))
|
console.log(JSON.stringify(await LSP.diagnostics(), null, 2))
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -14,7 +14,10 @@ export namespace Storage {
|
|||||||
const MIGRATIONS: Migration[] = [
|
const MIGRATIONS: Migration[] = [
|
||||||
async (dir) => {
|
async (dir) => {
|
||||||
const project = path.resolve(dir, "../project")
|
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}`)
|
log.info(`migrating project ${projectDir}`)
|
||||||
let projectID = projectDir
|
let projectID = projectDir
|
||||||
const fullProjectDir = path.join(project, projectDir)
|
const fullProjectDir = path.join(project, projectDir)
|
||||||
|
|||||||
Reference in New Issue
Block a user