-
Notifications
You must be signed in to change notification settings - Fork 676
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
Diagnostics from single file vs project are not deduped correctly #1830
Comments
Definitely seeing this. AFAIK I am running a pretty plain dotnetcore project |
Also seeing this. |
Seeing this on multiple computers and project types and also in colleagues setups. All errors are reported twice. AFAIK this is happening under any scenario, I have not actually seen a setup wherein errors are only reported once. Any idea on what is happening? |
This is a long standing issue. I saw it as far as half a year back, when I started using Code for my local C# projects. |
@rchande : This is getting hit a lot. I think you even filed a dupe at one point. Could we raise the priority on this one? It'd be great to get it fixed for 1.14. |
@TheRealPiotrP : I'm seeing a lot of these. It would be great if we could get this assigned out and fixed. |
Self-assigning. |
@DustinCampbell @mholo65 @david-driscoll The C# extension makes 2 diagnostics calls: one with a filename, and one with no filename which is supposed to get all the diagnostics for a "project". (This actually means all the diagnostics in the O# Workspace's CurrentSolution). When we make a request with a filename, we get back the correct diagnostics. When we make a request with no filename, Omnisharp returns every diagnostic twice. The C# extension faithfully adds each diagnostic to the error list twice. It looks like Omnisharp regressed this when we added cake support. Cake added another CodeCheckRequest handler that also uses the C# CodeCheckService. The cake code check handler properly reports that it support "cake" files and there is code in I'm not sure what the best fix is there. I don't think adding a "language" field to the code check request would be the right thing--when we request diagnostics for all projects we probably want to include cake projects. Should we have the cake handler only provide diagnostics in cake files? |
@rchande : Good analysis! |
@mholo65 Working on it--almost ready. |
Cake's diagnostics engine calls the generic CodeCheckService, which generates all diagnostics for the solution if called without a specific file path. This results in duplicate errors in C# projects when VS Code requests project level diagnostics. The solution is to only compute diagnostics for specified files. Fixes dotnet/vscode-csharp#1830
I'm not sure if I simply managed to mess up my local set up but I don't think so - I can repro it on both Windows and macOS.
Environment data
VS Code version: 1.17.2
C# Extension version: 1.13.0-beta4
Steps to reproduce
Give the following code, in a .NET Core 1.1 project (project type is irrelevant, I can repro the same error i.e. with CSX)
Hover over
dddd
. Then hover again, and again.Expected behavior
Diagnostic is de-duped.
We make 2 calls to
/codecheck
:As soon as the second one completes, the 2 diagnostic entry shows up next to the original one.
Actual behavior
The diagnostic is not deduped:
It also shows up twice in the
Problems
panel.Note that the project is not multi-targeted for 2 frameworks. As mentioned, same behavior can be observed for i.e. CSX.
The text was updated successfully, but these errors were encountered: