Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Render full diagnostics in color - #463

#463
Merged
AlexWaygood merged 3 commits into
mainastral-sh/ty-vscode:mainfrom
alex/colored-diagnosticsastral-sh/ty-vscode:alex/colored-diagnosticsCopy head branch name to clipboard
Jun 26, 2026
Merged

Render full diagnostics in color#463
AlexWaygood merged 3 commits into
mainastral-sh/ty-vscode:mainfrom
alex/colored-diagnosticsastral-sh/ty-vscode:alex/colored-diagnosticsCopy head branch name to clipboard

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

  • 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

Test plan

Screen.Recording.2026-06-25.at.19.40.15.mov

@AlexWaygood
AlexWaygood marked this pull request as ready for review June 25, 2026 18:45
@MichaReiser
MichaReiser self-requested a review June 26, 2026 06:26

@MichaReiser MichaReiser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Comment thread src/extension.ts
Comment thread src/extension.ts Outdated
Comment thread src/common/diagnostics.ts Outdated
Comment thread src/common/diagnostics.ts Outdated
Comment thread src/common/diagnostics.ts
style.background,
style.backgroundTruecolor,
);
const bold = style.decorations.includes("bold");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I don't like the string based API of answer 😓

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codex agrees 😆

Comment thread src/common/diagnostics.ts Outdated
@AlexWaygood
AlexWaygood merged commit 7b1a031 into main Jun 26, 2026
3 checks passed
@AlexWaygood
AlexWaygood deleted the alex/colored-diagnostics branch June 26, 2026 11:59
AlexWaygood added a commit to astral-sh/ty 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
[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

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

## Companion PRs

- [astral-sh/ruff#26384](astral-sh/ruff#26384)
-
[astral-sh/ty-vscode#463](astral-sh/ty-vscode#463)
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.