sidp / vscode-strict-whitespace

A Visual Studio Code extension to highlight whitespace issues
https://marketplace.visualstudio.com/items?itemName=sidp.strict-whitespace
MIT License
4 stars 1 forks source link

Allowed line patterns per language #1

Open Tamschi opened 3 years ago

Tamschi commented 3 years ago

Hello!

I've recently gotten a lot of use out of this extension writing Rust programs. However, the meaningful trailing spaces in Markdown trip me up a bit, so I thought I'd ask about them in case it's an easy thing to support.


In short:

Rust uses markdown documentation like the following: image

The lines always start with /// or //! (or are valid almost in general in plain Markdown files of course) and, while they're easy to ignore in context, the trailing whitespace marker shows up in red in the sidebar also: image

This is confusing when looking for error markers in a long file, so what I'd love to see is an option to, per language, flag certain patterns as valid. I'm fluent in Regex, but anything else that's expressive enough would still solve the issue for me.

The marker should still show up (less conspicuously) in the document, since I rely on it when editing anything Markdown, but should be removed from the side bar in these cases. Maybe switching the local foreground and background colours for valid trailing whitespace would be possible? It would be clearly visible this way without being as attention-grabbing as the error variant.

Thanks for your consideration!

Daniel-Collins97 commented 3 years ago

Valid trailing whitespace could be underlined in yellow or green to indicate that there IS whitespace there but it is potentially required/valid, while still keeping the user aware of it