Diagnostics from single file vs project are not deduped correctly
See original GitHub issueI’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)
namespace Sonova.Nephele.Shared.Web.AspNetCore
{
public class ErrorData
{
public string Message { get; set; }
}
}dddd
Hover over dddd
. Then hover again, and again.
Expected behavior
Diagnostic is de-duped.
We make 2 calls to /codecheck
:
- once with current file context
- once with no file context (against all projects)
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.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:11
- Comments:11 (4 by maintainers)
Top Results From Across the Web
"Error: One or more projects in the solution were not loaded ...
Solution: Run the solution file with administrator account. ex: Visual studio 2010 in your windows start menu, and right-click, run as ...
Read more >OneFS In-line Dedupe | Dell Technologies Info Hub
When in-line dedupe discovers a duplicate block, it moves a single copy of the block to a special set of files known as...
Read more >Data Storage Software - NetApp Knowledge Base
How to delete manually invoked autosupport files in ONTAP 9. ... Element storage node with Predictive Failure event for one or more drives ......
Read more >Imaging Tests for the Staging of Colorectal Cancer
and another 50,000 receive a diagnosis of rectal cancer.1 Colorectal cancer most ... Further, no single test may be sufficient for staging,.
Read more >The How to Build A Windows Virtual Desktop (VDI ...
You have to be open to making changes in AD in order to support them or your VDI project will outright fail because...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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
EndPointHandler.cs
that sniffs the filepath to figure out what the extension is. However, if there’s no file name, like in the “project” case, the C# and Cake code check handlers both get invoked, and both produce the same diagnostics, leading to duplicates.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?
@mholo65 Working on it–almost ready.