opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat(tui): Ability to Toggle LSP Diagnostics

Open itsrainingmani opened this issue 1 week ago • 1 comments

Closes #6692

  • Add ability to toggle LSP Diagnostics on/off via the command palette or slash command
  • When toggled off, the edit & write tools skip fetching and adding LSP diagnostics to the model
  • LSP diagnostics are enabled by default and need to toggled off actively

Screenshots

Command Palette SCR-20260106-mpta

Slash Command SCR-20260106-mpxs

Toast + Sidebar SCR-20260106-mqxj

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

itsrainingmani avatar Jan 08 '26 03:01 itsrainingmani