-
Notifications
You must be signed in to change notification settings - Fork 653
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
Feature Request - Suppress Diagnostics #3746
Comments
@ercgeek which scripting mechanism are you using with the C# code? |
I use an older library called Westwind.wwScripting. My app wraps the C# user code with a namespace and class definition plus some predefined members and methods before calling wwScripting for execution. If wwScripting finds any C# errors I want to report them back as VS Code problems. I had posted a question in StackOverflow before I understood better how OmniSharp C# extension works - https://stackoverflow.com/questions/61310404/vs-code-c-sharp-extension-extending-further I've tested the idea by modifying OmniSharp extension in two places: 1) adding the "Supress Diagnostics" settings option in package.json and 2) adding a few lines of code to diagnosticsProvider.ts to read the settings and prevent reporting the diagnostics to VS Code when "Suppress Diagnostics" is true. I realize my use case is unique, would welcome other ideas on how to do what I need if adding this feature is not valuable to the overall OmniSharp extension user base. |
@ercgeek The next release of the C# extension (or set
|
Excellent, thanks much. |
For those wondering: @JoeRobich 's code should be added to a |
Issue Description
This is not an issue, is a request for an additional configuration option: "Suppress Diagnostics". When checked on the extension would perform all other C# functionality but would not report diagnostic errors or warnings. Similar to "Suppress Hidden Diagnostics" but suppressing all diagnostics.
This feature would allow another extension to associate with "csharp" documents and provide diagnostics that override the OmniSharp diagnosticsProvider entries.
In my use case my custom app uses C# as its scripting mechanism. The C# written is valid C# but without namespace & class wrappers and with some classes, members and methods predefined. VS Code is a great front-end to edit these scripts but the diagnostics from OmniSharp are not relevant to the scripts.
Alternatively, provide a mechanism for another extension to turn diagnosticsProvider off programatically.
Steps to Reproduce
Expected Behavior
When "Suppress Diagnostics" is true the extension would not report diagnostic errors or warnings
Actual Behavior
Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.44.2
C# Extension: 1.21.17
Dotnet Information
.NET Core SDK (reflecting any global.json): Version: 3.1.201 Commit: b1768b4ae7Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.201\
Host (useful for support):
Version: 3.1.3
Commit: 4a9f85e9f8
.NET Core SDKs installed:
3.1.201 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: