diff options
| author | Kujtim Hoxha <[email protected]> | 2025-04-04 15:03:50 +0200 |
|---|---|---|
| committer | Kujtim Hoxha <[email protected]> | 2025-04-04 15:03:50 +0200 |
| commit | 3aef4dedcfd1ad408c6cb6c06e5e731feb528a1e (patch) | |
| tree | 20e018a73754880e78c0e7f569828b415c66b6a2 /internal/llm/tools/write.go | |
| parent | a1f6147506af1f98e5dfa670fc83fa45c2249842 (diff) | |
| download | opencode-3aef4dedcfd1ad408c6cb6c06e5e731feb528a1e.tar.gz opencode-3aef4dedcfd1ad408c6cb6c06e5e731feb528a1e.zip | |
Improve LSP diagnostics handling for file operations
- Split LSP file notification into separate functions
- Add waitForLspDiagnostics function to wait for diagnostics after file changes
- Move LSP diagnostics to after file operations in edit and write tools
- Fix string splitting in diff generation
- Reduce diagnostics timeout from 10 to 5 seconds
🤖 Generated with termai
Co-Authored-By: termai <[email protected]>
Diffstat (limited to 'internal/llm/tools/write.go')
| -rw-r--r-- | internal/llm/tools/write.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/llm/tools/write.go b/internal/llm/tools/write.go index 1c32410f7..86c9be37e 100644 --- a/internal/llm/tools/write.go +++ b/internal/llm/tools/write.go @@ -100,7 +100,6 @@ func (w *writeTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error return NewTextErrorResponse(fmt.Sprintf("Failed to create parent directories: %s", err)), nil } - notifyLspOpenFile(ctx, filePath, w.lspClients) // Get old content for diff if file exists oldContent := "" if fileInfo != nil && !fileInfo.IsDir() { @@ -135,6 +134,8 @@ func (w *writeTool) Run(ctx context.Context, call ToolCall) (ToolResponse, error // Record the file write recordFileWrite(filePath) recordFileRead(filePath) + // Wait for LSP diagnostics after writing the file + waitForLspDiagnostics(ctx, filePath, w.lspClients) result := fmt.Sprintf("File successfully written: %s", filePath) result = fmt.Sprintf("<result>\n%s\n</result>", result) |
