[PR #6175] fix: only show diagnostics block when errors exist #11765

Closed
opened 2026-02-16 18:16:42 -05:00 by yindo · 0 comments
Owner

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

State: closed
Merged: Yes


Problem

When the LSP returns only warnings (severity 2), the edit/write tools showed "This file has errors" with an empty diagnostics block. This happened because the code checked issues.length > 0 before filtering for severity 1 errors.

Fix

Changed to check errors.length > 0 (after filtering) instead of issues.length > 0 (before filtering).

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6175 **State:** closed **Merged:** Yes --- ## Problem When the LSP returns only warnings (severity 2), the edit/write tools showed "This file has errors" with an empty diagnostics block. This happened because the code checked `issues.length > 0` before filtering for severity 1 errors. ## Fix Changed to check `errors.length > 0` (after filtering) instead of `issues.length > 0` (before filtering).
yindo added the pull-request label 2026-02-16 18:16:42 -05:00
yindo closed this issue 2026-02-16 18:16:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11765