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

Formatting (highlighting white space/new line as errors) #1402

Open
risenovsky13 opened this issue Dec 9, 2024 · 3 comments
Open

Formatting (highlighting white space/new line as errors) #1402

risenovsky13 opened this issue Dec 9, 2024 · 3 comments

Comments

@risenovsky13
Copy link

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 risenovsky13 changed the title Formatting ((highlighting white space/new line as errors) Formatting (highlighting white space/new line as errors) Dec 9, 2024
@Taxato
Copy link

Taxato commented Dec 9, 2024

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

@ahmednfwela
Copy link

there should definitely be an option to disable this

@belav
Copy link
Owner

belav commented Dec 9, 2024

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 belav added this to the Planned - Extensions milestone Dec 9, 2024
pisolofin pushed a commit to pisolofin/csharpier-editorconfig that referenced this issue Dec 14, 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

4 participants