project-system
project-system copied to clipboard
Red "ignored" icon next to all analyzers through project reference
Version Used: VS2022 17.2.0
Steps to Reproduce:
- https://github.com/Sergio0694/ComputeSharp
- Open solution, build any of the samples (eg.
ComputeSharp.Sample
) - Expand the analyzers node
Expected Behavior:
The analyzers from local projects should be displayed the same as the other ones.
Actual Behavior:
You should see a red "ignored" icon next to all local analyzers. I assume this come from the git tooling?
The icon doesn't really make sense to me though given those generated files are not part of the repository/folder anyway. Also this wasn't there before 17.2.0. Additionally, this doesn't happen when the same analyzer is from a NuGet package.
I see this too, even in the Roslyn repo - CSharpSyntaxGenerator works fine but it shows a red icon that says "Ignored"
@drewnoakes Any chance this is fallout with the changes we made around the analyzer nodes? Now that there's a proper file here the Git tooling is triggering?
It seems that way yes. We should investigate whether there's a way of excluding these items from the source control provider's consideration.
@drewnoakes Transferred over to project system then; let me know if you need assistance (or need me to look after all).
This falls out from https://github.com/dotnet/project-system/pull/8045 where we added ProjectTreeFlags.FileSystemEntity
to these nodes, so that they would report actual file paths to Roslyn, so that Roslyn would be able to correctly identify the analyzer in order to hang child nodes off of it.
It seems that ProjectTreeFlags.FileSystemEntity
also enables tracking from the SCC provider.
These red "ignored" source control status icons show because the analyzer assemblies are under the repository's root directory, and potentially subject to source control.
Here's an example from the Imports Tree where a build file is located under the obj
folder, where we show the same:
We may need a way to suppress source control status for specific tree items. Perhaps via ProjectTreeFlags
.
I think it's odd that analyzer nodes have the FileSystemEntity
flag in the first place. Looking at #8045, it seems that was added as some sort of hack just for the paths to be preserved? Couldn't there be another flag added that does what is necessary to preserve the path, but is separate from FileSystemEntity
? That seems like a better solution to this, because the user really doesn't think of the analyzer nodes as files on disk. Even if source control status is suppressed, there might arise other scenarios where certain features are activated for all nodes with FileSystemEntity
which isn't appropriate for analyzer nodes.
Yes, that is an option to explore.
With #8329, this issue will also apply to shared projects.
So this red icon is a ghost we should ignore? What is the status of this issue?
right click - then go to git - then add to source repository
I mean its a plus now beause I solved it
So this red icon is a ghost we should ignore? What is the status of this issue?
Yes you can just ignore it. Obviously we would prefer if it wasn't shown in the first place to avoid confusion. This issue is tracking that.
So this red icon is a ghost we should ignore? What is the status of this issue?
Yes you can just ignore it. Obviously we would prefer if it wasn't shown in the first place to avoid confusion. This issue is tracking that.
If you really want to get rid of it you can right click there should be a git tab then there should be something like add to version control then it would be showing a green plus if you need more info in terms of direction and pictures just respond to me.
If you really want to get rid of it you can right click there should be a git tab then there should be something like add to version control then it would be showing a green plus if you need more info in terms of direction and pictures just respond to me.
You almost certainly don't want to add this file to version control. It's a DLL that's produced during compilation.
In your example above you're referring to a source file. In this specific case it's an analyzer in the dependencies tree, which is quite different.
I've marked our comments here as off topic to hide them and reduce the chance for confusion in this thread.
So this red icon is a ghost we should ignore? What is the status of this issue?
Yes you can just ignore it. Obviously we would prefer if it wasn't shown in the first place to avoid confusion. This issue is tracking that.
Yeah your right . I was just talking about having that problem generally . So for the that package listen to drewnoakes.