dotnet / project-system

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

Need to support the ability to override "generators" #2602

Open davkean opened 7 years ago

davkean commented 7 years ago

To speed up code generation when switching tabs in the XAML designer, the XAML "overrides" the MSBuild::Compile generator and replaces it with the XAML single file generator. We need to make official support for this, especially as build is out-of-proc and XAML won't be able to register a host object to get unsaved changes.

See CLangFileNode::GetXamlOverrideGenerator for more information.

davkean commented 6 years ago

The way this works is like follows:

image

The last one suspects that we might need to write a custom data source for the CustomTool property instead of just swapping at the point we go to create it.

davidwengier commented 5 years ago

This works now, via CPS in src\Microsoft.VisualStudio.ProjectSystem.VS.Implementation\CodeGenerators\WpfCodeGeneratorOverriderProvider.cs but probably needs to move to VsGeneratorsCacheService and be read from the registry