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

Diagnostic highlighting #1

Open
edusporto opened this issue Aug 12, 2024 · 2 comments
Open

Diagnostic highlighting #1

edusporto opened this issue Aug 12, 2024 · 2 comments

Comments

@edusporto
Copy link
Collaborator

The Bend compiler already allows highlighting of diagnostic reporting through ANSI color escape codes - however, we're still not able to send highlighted messages to VSCode since it does not implement it yet.

Once microsoft/vscode#54272 is closed/merged, we will be able to easily implement this using a library like ansi_to_html.

@developedby
Copy link
Member

Does it know how to handle (properly ignore) color escape codes?
If not, we can easily remove all of them from the language server diagnostics with a simple regex.

I wouldn't count on any external tool in particular implementing this. These things can be quite slow and are out of our control.

@edusporto
Copy link
Collaborator Author

edusporto commented Aug 12, 2024

Does it know how to handle (properly ignore) color escape codes?

Not really, VSCode just prints the color escape codes as if they were in a raw string. Right now I'm implementing the regex you mentioned to remove these color codes in the language server's side.

Another way to deal with this would be to implement some sort of "is terminal?" check in the Bend compiler and avoid printing the color codes if it is not, like many other compilers do, and add a flag to force color printing if needed. Considering TSPL already prints messages with the color codes, I imagine the team would prefer the first solution I mentioned.

edusporto added a commit that referenced this issue Aug 12, 2024
@kings177 kings177 added this to the Language Server v0 milestone Aug 20, 2024
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

No branches or pull requests

3 participants