[PR #7276] feat(tui): Ability to Toggle LSP Diagnostics #12330

Open
opened 2026-02-16 18:17:15 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7276

State: open
Merged: No


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
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7276 **State:** open **Merged:** No --- 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 <img width="450" height="259" alt="SCR-20260106-mpta" src="https://github.com/user-attachments/assets/356f7d27-1d44-45c6-9b79-f8b3dd321df8" /> Slash Command <img width="411" height="86" alt="SCR-20260106-mpxs" src="https://github.com/user-attachments/assets/748f075a-ae18-411c-b32b-09d6f99e2224" /> Toast + Sidebar <img width="487" height="290" alt="SCR-20260106-mqxj" src="https://github.com/user-attachments/assets/9327bf63-c9bc-4006-832f-101cdd4f3303" /> ## Output Comparison ```txt # 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 ```txt # 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 ```
yindo added the pull-request label 2026-02-16 18:17:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12330