-
Notifications
You must be signed in to change notification settings - Fork 77
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
USP0016 not working in VS Code #213
Comments
Are you on the latest VSCode ? For a long time analyzers were working properly but not suppressors. (it seems to be still the case on the VSCode documentation : https://code.visualstudio.com/docs/other/unity#_enabling-unity-warnings) We filled an issue regarding this on the OmniSharp repo: |
Hi @sailro, I saw that the support for suppressor was added in a while ago (OmniSharp/omnisharp-roslyn#2182). From my testing, at least USP0001 and USP0003 is working. I updated the screenshot to reflect more examples of the suppressors at work. I am using everything latest. I'm on C# plugin 1.24.1 and VS Code 1.65.2. My Mono should also be latest; the version info is in the top post. |
I managed to get debugging working by building a debug version of the analyzer DLL and attach a mono debugger to OmniSharp. From my observation, breakpoints placed at the start of
Can I suspect this is an OmniSharp issue? |
Ah very interesting, thank you for investigating this. Indeed if our Could it be related to a custom perhaps you could try the following: [*.cs]
dotnet_diagnostic.CS8618.severity = warning @jbevain any idea ? |
I do have .editorconfig in my project, but there is nothing specific to modify the severity of CS8618. In fact, I got rid of those configs as it was mainly for blocking out false positives of other analyzers that I no longer use, and the issue still persists. I don't have a global copy of .editorconfig either. |
Hi @filipw, I think the thread above is interesting regarding diagnostic suppressors and To summarize, several suppressors of our package are working correctly, but for this one, we can see that it is correctly loaded (@heshuimu was able to debug the call to the initialization step), but never called afterwards when a We only repro under Do you have any idea that we could explore to try to solve this ? |
@heshuimu we were able to create a minimal repro without Unity. In the end the issue seems to be on the Roslyn side (compiler infrastructure). The fix: |
Bug description
A clear and concise description of what the bug is.
To Reproduce
Steps or code to reproduce the behavior:
The following code would not have CS8618 if opened in VS for Mac, but will have errors if opened in VS Code. Because of this I have no way to recreate the issue while debugging with VS for Mac. If there is a way to debug analyzers with VS Code, I'd do a PR.
If it helps, I'm using this version of Mono for the C# plugin
Expected behavior
No CS8618 warnings
Screenshots
The following shows that some Suppressors do work in VS Code since the support is added.
The text was updated successfully, but these errors were encountered: