Vscode: Show other invisible characters with renderWhitespace option

Created on 10 Feb 2016  ·  3Comments  ·  Source: microsoft/vscode

just in case atom also render CR, EOL characters
0-31 and 127 ASCII code are non-printable characters
also #2085 is related

editor-render-whitespace feature-request

Most helpful comment

Is it possible to render not printable characters?

All 3 comments

Is it possible to render not printable characters?

I just waisted 20m debugging a url problem because I had a Unicode Decimal Code ‭ preceding my absolute url causing it to be treated as a relative path.

Please allow us to enable rendering of these weird characters that no programmer ever wants in their code.

+all other non-graphical code points.

Example:
Create a source-code file containing U+200B (ZERO WIDTH SPACE) format character, and open it in VSCode.
PS> [char]0x200B | Out-File .\zero_width_space.ps1 -Encoding utf8
File content in bytes:
PS > [io.file]::ReadAllBytes('.\zero_width_space.ps1')
239 187 191 226 128 139 13 10

Result:
VSCode does not display anything when opening the file, even when "editor.renderWhitespace"="all"
The first 239 187 191 (ZERO WIDTH NON-BREAKING SPACE) is intepreted as BOM.
The rest 226 128 139 13 10 (ZERO WIDTH SPACE) +(CR) + (LF) is source code text.

Background.
I this case, the second code point (ZERO WIDTH SPACE) is a syntax error for the particular source-code.

The source-code contains syntax error => important to be able to show invisible characters in a code editor.

In general, it may be useful to have an option to display Unicode-formatting characters in text file, if used explicitly in doc comments.

Formatting characters may also be accidental garbage when pasting text from a webbrowser.

Even the BOM-character could be shown as invisible character for full transparency.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukehoban picture lukehoban  ·  3Comments

shanalikhan picture shanalikhan  ·  3Comments

mrkiley picture mrkiley  ·  3Comments

trstringer picture trstringer  ·  3Comments

ryan-wong picture ryan-wong  ·  3Comments