From f2b36b92347622f4c7f150c8dcef7218960d0702 Mon Sep 17 00:00:00 2001 From: adamdottv <2363879+adamdottv@users.noreply.github.com> Date: Thu, 1 May 2025 07:28:37 -0500 Subject: fix: remove lsp tool --- internal/llm/agent/tools.go | 1 - internal/llm/tools/lsp.go | 49 --------------------------------------------- 2 files changed, 50 deletions(-) delete mode 100644 internal/llm/tools/lsp.go (limited to 'internal/llm') diff --git a/internal/llm/agent/tools.go b/internal/llm/agent/tools.go index df1dd1b66..e6b0119ae 100644 --- a/internal/llm/agent/tools.go +++ b/internal/llm/agent/tools.go @@ -35,7 +35,6 @@ func CoderAgentTools( tools.NewViewTool(lspClients), tools.NewPatchTool(lspClients, permissions, history), tools.NewWriteTool(lspClients, permissions, history), - tools.NewConfigureLspServerTool(), NewAgentTool(sessions, messages, lspClients), }, otherTools..., ) diff --git a/internal/llm/tools/lsp.go b/internal/llm/tools/lsp.go deleted file mode 100644 index c2b4b04f3..000000000 --- a/internal/llm/tools/lsp.go +++ /dev/null @@ -1,49 +0,0 @@ -package tools - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/opencode-ai/opencode/internal/lsp/discovery/tool" -) - -// ConfigureLspServerTool is a tool for configuring LSP servers -type ConfigureLspServerTool struct{} - -// NewConfigureLspServerTool creates a new ConfigureLspServerTool -func NewConfigureLspServerTool() *ConfigureLspServerTool { - return &ConfigureLspServerTool{} -} - -// Info returns information about the tool -func (t *ConfigureLspServerTool) Info() ToolInfo { - return ToolInfo{ - Name: "configureLspServer", - Description: "Searches for an LSP server for the given language", - Parameters: map[string]any{ - "language": map[string]any{ - "type": "string", - "description": "The language identifier (e.g., \"go\", \"typescript\", \"python\")", - }, - }, - Required: []string{"language"}, - } -} - -// Run executes the tool -func (t *ConfigureLspServerTool) Run(ctx context.Context, params ToolCall) (ToolResponse, error) { - result, err := tool.ConfigureLspServer(ctx, json.RawMessage(params.Input)) - if err != nil { - return NewTextErrorResponse(err.Error()), nil - } - - // Convert the result to JSON - resultJSON, err := json.MarshalIndent(result, "", " ") - if err != nil { - return NewTextErrorResponse(fmt.Sprintf("Failed to marshal result: %v", err)), nil - } - - return NewTextResponse(string(resultJSON)), nil -} - -- cgit v1.2.3