csharpier icon indicating copy to clipboard operation
csharpier copied to clipboard

Formatting (highlighting white space/new line as errors)

Open risenovsky13 opened this issue 1 year ago • 3 comments

When adding a couple of white spaces or new lines anywhere in the code, csharpier highlights those spaces like an error with underlined red line. This issue occurs in the latest version 1.9.0. I have tried older one 1.8.0 and this problem does not exist.

Providing some screenshots:

1.9.0 Zrzut ekranu z 2024-12-09 08-04-09

1.8.0 Zrzut ekranu z 2024-12-09 08-33-28

risenovsky13 avatar Dec 09 '24 07:12 risenovsky13

If anyone else is having this issue, just downgrade to previous version. This change is very annoying

Taxato avatar Dec 09 '24 11:12 Taxato

there should definitely be an option to disable this

ahmednfwela avatar Dec 09 '24 15:12 ahmednfwela

I've added an option to disable this for now - it is out with 1.9.1

@badsyntax a couple ideas I have for this feature after playing with it a bit more.

If possible, I think highlighting less would be an improvement. Meaning for the example above - highlight just the beginning of each extra new line, or possibly just the beginning and/or end of all of the whitespace.

Possibly only run the diagnostic when a file is saved. It doesn't appear that the other c# diagnostics run that way. Or maybe if format on save is turned on then only run it on save.

Also when I was testing enabling/disabling the diagnostics I ran into a situation where I had disabled the diagnostics, but couldn't get vscode to stop displaying it. When I ran the code fix, it ended up removing some valid code. I'm guessing this is because I had disabled the diagnostic, so when the quick fix ran it was using some older state of the file instead of the current state of the file. Perhaps there is some way to clear the diagnostics when the option is changed.

belav avatar Dec 09 '24 23:12 belav