refactor(lsp): clean up lsp_servers references and update prompts to use PascalCase
- Remove dead lsp_servers function from tools.ts - Update utils.ts to reference LspServers (OpenCode built-in) - Update AGENTS.md: 7 tools → 3 tools - Update init-deep.ts prompts to use PascalCase OpenCode tools - Update refactor.ts prompts to use PascalCase OpenCode tools
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import { tool, type ToolDefinition } from "@opencode-ai/plugin/tool"
|
||||
import { getAllServers } from "./config"
|
||||
import {
|
||||
DEFAULT_MAX_DIAGNOSTICS,
|
||||
} from "./constants"
|
||||
@@ -68,28 +67,6 @@ export const lsp_diagnostics: ToolDefinition = tool({
|
||||
},
|
||||
})
|
||||
|
||||
export const lsp_servers: ToolDefinition = tool({
|
||||
description: "List available LSP servers and installation status.",
|
||||
args: {},
|
||||
execute: async (_args, context) => {
|
||||
try {
|
||||
const servers = getAllServers()
|
||||
const lines = servers.map((s) => {
|
||||
if (s.disabled) {
|
||||
return `${s.id} [disabled] - ${s.extensions.join(", ")}`
|
||||
}
|
||||
const status = s.installed ? "[installed]" : "[not installed]"
|
||||
return `${s.id} ${status} - ${s.extensions.join(", ")}`
|
||||
})
|
||||
const output = lines.join("\n")
|
||||
return output
|
||||
} catch (e) {
|
||||
const output = `Error: ${e instanceof Error ? e.message : String(e)}`
|
||||
return output
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
export const lsp_prepare_rename: ToolDefinition = tool({
|
||||
description: "Check if rename is valid. Use BEFORE lsp_rename.",
|
||||
args: {
|
||||
|
||||
@@ -55,7 +55,7 @@ export function formatServerLookupError(result: Exclude<ServerLookupResult, { st
|
||||
`Supported extensions: ${server.extensions.join(", ")}`,
|
||||
``,
|
||||
`After installation, the server will be available automatically.`,
|
||||
`Run 'lsp_servers' tool to verify installation status.`,
|
||||
`Run 'LspServers' tool to verify installation status.`,
|
||||
].join("\n")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user