Skip to content

Document colored diagnostic output#3858

Merged
AlexWaygood merged 2 commits into
mainfrom
alex/document-color-diagnostic-output
Jun 26, 2026
Merged

Document colored diagnostic output#3858
AlexWaygood merged 2 commits into
mainfrom
alex/document-color-diagnostic-output

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented Jun 25, 2026

Copy link
Copy Markdown
Member

Context

This builds on the original Click for full diagnostic feature implemented in astral-sh/ruff#26269 and astral-sh/ty-vscode#462. The colored rendering follows the approach established by rust-lang/rust-analyzer#13848.

Summary

Explain that fullDiagnosticOutput can include ANSI colour codes and clients are expected to be able to handle this

Companion PRs

AlexWaygood added a commit to astral-sh/ty-vscode that referenced this pull request Jun 26, 2026
## Context

This builds on the original **Click for full diagnostic** feature
implemented in
[astral-sh/ruff#26269](astral-sh/ruff#26269) and
[#462](#462).
The colored rendering follows the approach established by
[rust-lang/rust-analyzer#13848](rust-lang/rust-analyzer#13848).

## Summary

- advertise support for colored full diagnostic output
- strip ANSI sequences from the virtual document and recreate their
styles with VS Code decorations
- support named terminal colors, 256-color palette entries, truecolor,
and text decorations

## Companion PRs

- [astral-sh/ruff#26384](astral-sh/ruff#26384)
- [astral-sh/ty#3858](astral-sh/ty#3858)

## Test plan



https://github.com/user-attachments/assets/36638263-fe48-4ba7-8abe-95db353f1257
@AlexWaygood AlexWaygood enabled auto-merge (squash) June 26, 2026 12:16
@AlexWaygood AlexWaygood merged commit 3ed874d into main Jun 26, 2026
16 checks passed
@AlexWaygood AlexWaygood deleted the alex/document-color-diagnostic-output branch June 26, 2026 12:17
AlexWaygood added a commit to astral-sh/ruff that referenced this pull request Jun 26, 2026
## Context

This builds on the original **Click for full diagnostic** feature
implemented in
[#26269](#26269) and
[astral-sh/ty-vscode#462](astral-sh/ty-vscode#462).
The colored rendering follows the approach established by
[rust-lang/rust-analyzer#13848](rust-lang/rust-analyzer#13848).

## Summary

- render full ty diagnostics with ANSI color and styling when the client
opts in
- negotiate color support separately from `fullDiagnosticOutput` for
rollout compatibility
- disable terminal hyperlinks in LSP output and cover the behavior under
forced hyperlink support

## Companion PRs

-
[astral-sh/ty-vscode#463](astral-sh/ty-vscode#463)
- [astral-sh/ty#3858](astral-sh/ty#3858)

## Test plan



https://github.com/user-attachments/assets/dc7e7538-ae2b-4870-9e9b-f59943ee804a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants