-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Debug console uses unexpected text colours for some strings #34043
Comments
@isidorn why do we try to colorise stuff in the debug console? |
@weinand currently we use some simple regex heuristics to try to colorise booleans, numbers and strings. I can remove all of these colors but not sure if it will upset the users. |
@isidorn please remove the regex heuristics for colorising because it is surprising and mostly wrong. But keep the ANSI coloring because it is deterministic and expected. |
@weinand makes sense. Do you get a sense that it is mostly wrong also in the watch and variables pane since we use the same heuristic there. Should it also be removed there? |
My 2¢... I was surprised to see colours in the debug output. I'm not against it, though if it's kept it should be reliable. If the same regex is being used for the watch window, then even if colours are removed from the debug console, then I think the regex needs fixing, since it'll presumably also color the string |
If we want to continue to support regexp-based "value colorisation", we should only do it where we control and understand the underlying syntax. This is true for the variables and watches view and for structured objects in the debug console since all are trees. For the trees we should make sure that the regexps only match simple values like |
Thanks. @DanTup I have checked the boolean regex and it looks fine to me. I think the difference in coloring comes from the fact that those output elements came in a different order from the adapter. Which means that part of tha string first came which passed the regex check making it blue. |
@isidorn I don't understand the explanation for it happening (the output is in the same order as the |
@DanTup no it does not make 100% sense to me either, I was just speculating as to what might have been the cause. Since the adapter can send the output events chunked to vscode (I did not investigate further) |
@roblourens please file a feature request to me to respect the type in the debug console for colorisation |
Add the following code in an extension:
When it runs, the colours of the output lines are inconsistent:
Looking in the dev tools, it seems the blue lines have
boolean
in their CSS class which is missing from the white lines. It seems strange thattrue vs false
andfalse vs true
are categorised differently.The text was updated successfully, but these errors were encountered: