mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-01 22:10:23 +00:00
do not wait for LSP to be fully ready
This commit is contained in:
parent
a826936702
commit
0ee3b1ede2
3 changed files with 4 additions and 11 deletions
|
|
@ -184,9 +184,7 @@ export namespace LSPClient {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if (input.server.onInitialized) {
|
if (input.server.onInitialized) input.server.onInitialized(result)
|
||||||
await input.server.onInitialized(result)
|
|
||||||
}
|
|
||||||
l.info("initialized")
|
l.info("initialized")
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,7 @@ export namespace Mode {
|
||||||
})
|
})
|
||||||
.optional(),
|
.optional(),
|
||||||
prompt: z.string().optional(),
|
prompt: z.string().optional(),
|
||||||
tools: z
|
tools: z.record(z.boolean()),
|
||||||
.object({
|
|
||||||
write: z.boolean().optional(),
|
|
||||||
edit: z.boolean().optional(),
|
|
||||||
patch: z.boolean().optional(),
|
|
||||||
})
|
|
||||||
.optional(),
|
|
||||||
})
|
})
|
||||||
.openapi({
|
.openapi({
|
||||||
ref: "Mode",
|
ref: "Mode",
|
||||||
|
|
@ -61,6 +55,7 @@ export namespace Mode {
|
||||||
if (value.prompt) item.prompt = await Bun.file(value.prompt).text()
|
if (value.prompt) item.prompt = await Bun.file(value.prompt).text()
|
||||||
if (value.tools) item.tools = value.tools
|
if (value.tools) item.tools = value.tools
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ export const ReadTool = Tool.define({
|
||||||
output += "\n</file>"
|
output += "\n</file>"
|
||||||
|
|
||||||
// just warms the lsp client
|
// just warms the lsp client
|
||||||
await LSP.touchFile(filePath, false)
|
LSP.touchFile(filePath, false)
|
||||||
FileTime.read(ctx.sessionID, filePath)
|
FileTime.read(ctx.sessionID, filePath)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue