Explorar o código

chore: kill some unused tools

Aiden Cline hai 1 mes
pai
achega
1e2ef07c97

+ 0 - 26
packages/opencode/src/tool/lsp-diagnostics.ts

@@ -1,26 +0,0 @@
-import z from "zod"
-import { Tool } from "./tool"
-import path from "path"
-import { LSP } from "../lsp"
-import DESCRIPTION from "./lsp-diagnostics.txt"
-import { Instance } from "../project/instance"
-
-export const LspDiagnosticTool = Tool.define("lsp_diagnostics", {
-  description: DESCRIPTION,
-  parameters: z.object({
-    path: z.string().describe("The path to the file to get diagnostics."),
-  }),
-  execute: async (args) => {
-    const normalized = path.isAbsolute(args.path) ? args.path : path.join(Instance.directory, args.path)
-    await LSP.touchFile(normalized, true)
-    const diagnostics = await LSP.diagnostics()
-    const file = diagnostics[normalized]
-    return {
-      title: path.relative(Instance.worktree, normalized),
-      metadata: {
-        diagnostics,
-      },
-      output: file?.length ? file.map(LSP.Diagnostic.pretty).join("\n") : "No errors found",
-    }
-  },
-})

+ 0 - 1
packages/opencode/src/tool/lsp-diagnostics.txt

@@ -1 +0,0 @@
-do not use

+ 0 - 31
packages/opencode/src/tool/lsp-hover.ts

@@ -1,31 +0,0 @@
-import z from "zod"
-import { Tool } from "./tool"
-import path from "path"
-import { LSP } from "../lsp"
-import DESCRIPTION from "./lsp-hover.txt"
-import { Instance } from "../project/instance"
-
-export const LspHoverTool = Tool.define("lsp_hover", {
-  description: DESCRIPTION,
-  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) => {
-    const file = path.isAbsolute(args.file) ? args.file : path.join(Instance.directory, args.file)
-    await LSP.touchFile(file, true)
-    const result = await LSP.hover({
-      ...args,
-      file,
-    })
-
-    return {
-      title: path.relative(Instance.worktree, file) + ":" + args.line + ":" + args.character,
-      metadata: {
-        result,
-      },
-      output: JSON.stringify(result, null, 2),
-    }
-  },
-})

+ 0 - 1
packages/opencode/src/tool/lsp-hover.txt

@@ -1 +0,0 @@
-do not use