project-system icon indicating copy to clipboard operation
project-system copied to clipboard

Red "ignored" icon next to all analyzers through project reference

Open Sergio0694 opened this issue 2 years ago • 9 comments

Version Used: VS2022 17.2.0

Steps to Reproduce:

  1. https://github.com/Sergio0694/ComputeSharp
  2. Open solution, build any of the samples (eg. ComputeSharp.Sample)
  3. 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?

image

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.

Sergio0694 avatar May 15 '22 21:05 Sergio0694

I see this too, even in the Roslyn repo - CSharpSyntaxGenerator works fine but it shows a red icon that says "Ignored" image

Neme12 avatar May 15 '22 21:05 Neme12

@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?

jasonmalinowski avatar May 23 '22 19:05 jasonmalinowski

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 avatar May 24 '22 12:05 drewnoakes

@drewnoakes Transferred over to project system then; let me know if you need assistance (or need me to look after all).

jasonmalinowski avatar May 24 '22 16:05 jasonmalinowski

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.

drewnoakes avatar May 25 '22 00:05 drewnoakes

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:

image

We may need a way to suppress source control status for specific tree items. Perhaps via ProjectTreeFlags.

drewnoakes avatar Jun 06 '22 01:06 drewnoakes

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.

Neme12 avatar Jun 06 '22 11:06 Neme12

Yes, that is an option to explore.

drewnoakes avatar Jun 06 '22 12:06 drewnoakes

With #8329, this issue will also apply to shared projects.

drewnoakes avatar Jul 18 '22 21:07 drewnoakes

So this red icon is a ghost we should ignore? What is the status of this issue?

dlandi avatar Jan 06 '23 14:01 dlandi

right click - then go to git - then add to source repository image I mean its a plus now beause I solved it

olamission avatar Mar 09 '23 14:03 olamission

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.

drewnoakes avatar Mar 15 '23 00:03 drewnoakes

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.

olamission avatar Mar 15 '23 01:03 olamission

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.

drewnoakes avatar Mar 15 '23 01:03 drewnoakes

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.

olamission avatar Mar 15 '23 01:03 olamission