belav / csharpier

CSharpier is an opinionated code formatter for c#.
https://csharpier.com
MIT License
1.41k stars 98 forks source link

Ignore VSCode Error Notifications #1307

Closed RobertOstermann closed 3 months ago

RobertOstermann commented 3 months ago

I often see an error such as CSharpier needs to be installed globally to format files in when clicking into a source c# file. It would be nice to have the option to mute this error.

Environments

Log Output

Steps to reproduce

Go to definition of a decompiled source file, such as TimeSpan.cs and a VSCode Error Window appears even though I have CSharpier globally installed.

Expected behavior

Add a setting, maybe csharpier.notificationLevel with the options [default, error, warning, information, none]. This would allow the user to override the default notification level to avoid the error notifications.

Actual behavior

The error notification always shows. It is impossible to ignore in VSCode settings as the notification level is error.

belav commented 3 months ago

I believe #1323 will resolve your problems. Hopefully by properly detecting your global install and also never warning about decompiled files if there isn't a global install. Let me know if your decompiled sources end up in a directory not under DecompilationMetadataAsSourceFileProvider, rider had a few directories I had to ignore.

RobertOstermann commented 3 months ago

That seems to have fixed the issue, thanks!