opencode
opencode copied to clipboard
feat(tui): Ability to Toggle LSP Diagnostics
Closes #6692
- Add ability to toggle LSP Diagnostics on/off via the command palette or slash command
- When toggled off, the
edit&writetools skip fetching and adding LSP diagnostics to the model - LSP diagnostics are enabled by default and need to toggled off actively
Screenshots
Command Palette
Slash Command
Toast + Sidebar
Output Comparison
# LSP Diagnostics enabled
DEBUG +0ms service=lsp fileCount=1 totalDiagnostics=158 diagnostics fetched
DEBUG +0ms service=tool.write diagnostics_enabled=true filepath=/tmp/lsp-stress-test.ts diagnosticFileCount=1 tool.write diagnostics check
This file has errors, please fix
<file_diagnostics>
ERROR [4:7] Type 'number' is not assignable to type 'string'.
ERROR [5:7] Type 'string' is not assignable to type 'number'.
ERROR [6:7] Type 'string' is not assignable to type 'boolean'.
ERROR [7:24] Type 'string' is not assignable to type 'number'.
ERROR [7:29] Type 'string' is not assignable to type 'number'.
ERROR [7:34] Type 'string' is not assignable to type 'number'.
ERROR [8:30] Type 'string' is not assignable to type 'number'.
ERROR [14:5] Argument of type 'string' is not assignable to parameter of type 'number'.
... and 67 more
</file_diagnostics>
tool.write diagnostic output
vs
# LSP Diagnostics Disabled
DEBUG +0ms service=lsp enabled=false diagnosticsStatus called
DEBUG +0ms service=tool.write diagnostics_enabled=false filepath=/tmp/lsp-stress-test-common.ts diagnosticFileCount=0 tool.write diagnostics check
DEBUG +0ms service=tool.write diagnostics={} output= tool.write diagnostic output