dotnet / project-system

The .NET Project System for Visual Studio
MIT License
969 stars 387 forks source link

Ignore automatic nesting for Designer files #7105

Open msedi opened 3 years ago

msedi commented 3 years ago

I'm currently using the filenesting for C# projects. Everything works fine except that .Designer.cs files are automatically nested.

Background: We are having CUDA-files with the cu extensions. A process creates three additional files. Aas an example I have named my CUDA file Convolution.cu. So what is created is

Convolution.cu
+ Convolution.cs
+ Convolution.Designer.cs
+ Convolution.ptx

which is also the hierarchy I expect in the solution explorer. I have defined my own file nesting so that I don't have to use the complex DependentUpon project entries:

{
  "help": "https://go.microsoft.com/fwlink/?linkid=866610",
  "root": true,

  "dependentFileProviders": {
    "add": {
      "extensionToExtension": {
        "add": {
          ".cs": [
            ".cu"
          ],
          ".ptx": [
            ".cu"
          ]
        }
      }
    }
  }
}

What I get is this:

Convolution.cu
+ Convolution.cs
   + Convolution.Designer.cs
+ Convolution.ptx

Obviously some other mechanism is already active that does the nesting.

I search a while but there is obviously not Default filenesting.json I can have a look at. I expect that this mechanism is not done by filenesting.json but some other method?

Is there any way to remove the nesting?

jjmew commented 3 years ago

@swesonga Do you have a recommendation?