-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
Summary
Add CodeFix/CodeRefactoring Support for AdditionalFiles to support XAML lightbulbs for MAUI.
Required to fix Hot Reload rude edit reporting issue https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1579223
Features
This work requires 3 different API sets:
- CodeRefactoring API
- CodeFix API
- FixAll API
Background and Motivation
.NET MAUI adds XAML files to C#/VB projects as AdditionalFiles. This breaks XAML lightbulb functionality, etc. because we create special XAML shadow projects to support that. While analyzers are now supported for AdditionalFiles (see issue #44131) we cannot provide any code fixes or refactorings that way.
At least for MAUI we would then be able to avoid creating XAML shadow projects, which cause additional issues with the MAUI source generators.
Proposed Feature
Code fixes use CodeActions, which are based on Document. We would need to either allow the creation of XAML Documents in AdditionalFiles (something I would still like to see in order to support SyntaxTrees for XAML) or support CodeActions for AdditionalDocument/TextDocument.
Alternative Designs
see above
Metadata
Metadata
Assignees
Labels
Type
Projects
Status