Starting with this - note my project is not in c:\shared
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="c:\shared\*.cs" />
</ItemGroup>
</Project>
which in my case gives me foo.cs and bar.cs in the solution explorer, I remove foo.cs and bar.cs from the solution explorer, and it gives me
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="c:\shared\*.cs" />
</ItemGroup>
<ItemGroup>
<Compile Remove="c:\shared\bar.cs" />
<Compile Remove="c:\shared\foo.cs" />
</ItemGroup>
</Project>
In my mind, it's more likely that I meant "I don't need the shared files" than I mean "I don't need these specific files but I might add other files to that folder later". In my actual case there were a large number of files pulled in by the wildcard so I ended up with a lot of Remove tags.
I suggest the heuristic be, if a gesture removes the last files originating from a project file wildcard expression outside of the project root, the wildcard expression (and any Remove expressions against it) can be removed.
Starting with this - note my project is not in c:\shared
which in my case gives me foo.cs and bar.cs in the solution explorer, I remove foo.cs and bar.cs from the solution explorer, and it gives me
In my mind, it's more likely that I meant "I don't need the shared files" than I mean "I don't need these specific files but I might add other files to that folder later". In my actual case there were a large number of files pulled in by the wildcard so I ended up with a lot of Remove tags.
I suggest the heuristic be, if a gesture removes the last files originating from a project file wildcard expression outside of the project root, the wildcard expression (and any Remove expressions against it) can be removed.