mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 17:54:23 +01:00
Refactor LSP tools and add hover functionality
- Split diagnostics tool into separate lsp-diagnostics.ts file - Add new lsp-hover.ts tool for LSP hover information - Update tool exports and session integration - Remove old diagnostics.ts file 🤖 Generated with opencode Co-Authored-By: opencode <noreply@opencode.ai>
This commit is contained in:
@@ -54,6 +54,24 @@ export namespace LSP {
|
||||
return results;
|
||||
}
|
||||
|
||||
export async function hover(input: {
|
||||
file: string;
|
||||
line: number;
|
||||
character: number;
|
||||
}) {
|
||||
return run((client) => {
|
||||
return client.connection.sendRequest("textDocument/hover", {
|
||||
textDocument: {
|
||||
uri: `file://${input.file}`,
|
||||
},
|
||||
position: {
|
||||
line: input.line,
|
||||
character: input.character,
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function run<T>(
|
||||
input: (client: LSPClient.Info) => Promise<T>,
|
||||
): Promise<T[]> {
|
||||
|
||||
Reference in New Issue
Block a user