Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DSLX:LS] Ansi color codes don't render in vscode problems pane #1940

Open
cdleary opened this issue Feb 19, 2025 · 2 comments
Open

[DSLX:LS] Ansi color codes don't render in vscode problems pane #1940

cdleary opened this issue Feb 19, 2025 · 2 comments
Labels
dslx:lsp DSLX language server/protocol implementation

Comments

@cdleary
Copy link
Collaborator

cdleary commented Feb 19, 2025

Describe the bug
The dslx_ls produces ANSI escapes in the problems pane in VSCode.

To Reproduce
Install DSLX vscode extension
Point at dslx_ls installation
Make a type error where we're displaying member type diffs (e.g. a component within a tuple)
Observe the unredered ANSI escapes

Expected behavior
I think somehow other languages provide color coding? But if not we probably need to plumb a "can do ANSI escapes" from the outside world to the error rendering.

Screenshots
Image

@cdleary cdleary added the dslx:lsp DSLX language server/protocol implementation label Feb 19, 2025
@hzeller
Copy link
Member

hzeller commented Feb 19, 2025

I guess things to figure out

  • Inside the error emitting code we should ask isatty(STDERR_FILENO) before proceeding to emit ANSI codes
  • Why does VSCode terminal not understand ANSI codes ? I know for the terminal app inside VSCode they do understand these (even images, if enabled), so not supporting it in log output is kinda meh - maybe there is a plugin for that ?

@cdleary
Copy link
Collaborator Author

cdleary commented Feb 23, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dslx:lsp DSLX language server/protocol implementation
Projects
None yet
Development

No branches or pull requests

2 participants