summaryrefslogtreecommitdiffhomepage
path: root/js/src/tool/lsp-hover.ts
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-05-30 20:47:56 -0400
committerDax Raad <[email protected]>2025-05-30 20:48:36 -0400
commitf3da73553c45f17e04b1e77cb13eb0fca714d1bd (patch)
treea24317a19e1ab2a89da50db669dc6894f15d00d1 /js/src/tool/lsp-hover.ts
parent9a26b3058ffc1023e5c7e54b6d571c903d15888e (diff)
downloadopencode-f3da73553c45f17e04b1e77cb13eb0fca714d1bd.tar.gz
opencode-f3da73553c45f17e04b1e77cb13eb0fca714d1bd.zip
sync
Diffstat (limited to 'js/src/tool/lsp-hover.ts')
-rw-r--r--js/src/tool/lsp-hover.ts38
1 files changed, 0 insertions, 38 deletions
diff --git a/js/src/tool/lsp-hover.ts b/js/src/tool/lsp-hover.ts
deleted file mode 100644
index c7a132645..000000000
--- a/js/src/tool/lsp-hover.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import { z } from "zod";
-import { Tool } from "./tool";
-import path from "path";
-import { LSP } from "../lsp";
-import { App } from "../app/app";
-
-export const LspHoverTool = Tool.define({
- name: "opencode.lsp_hover",
- description: `
- Looks up hover information for a given position in a source file using the Language Server Protocol (LSP).
- This includes type information, documentation, or symbol details at the specified line and character.
- Useful for providing code insights, explanations, or context-aware assistance based on the user's current cursor location.
- `,
- parameters: z.object({
- file: z.string().describe("The path to the file to get diagnostics."),
- line: z.number().describe("The line number to get diagnostics."),
- character: z.number().describe("The character number to get diagnostics."),
- }),
- execute: async (args) => {
- console.log(args);
- const app = await App.use();
- const file = path.isAbsolute(args.file)
- ? args.file
- : path.join(app.root, args.file);
- await LSP.file(file);
- const result = await LSP.hover({
- ...args,
- file,
- });
- console.log(result);
- return {
- metadata: {
- result,
- },
- output: JSON.stringify(result, null, 2),
- };
- },
-});