Expose MoveToNamespace action in code fixes #68853
Labels
Area-IDE
Concept-API
This issue involves adding, removing, clarification, or modification of an API.
Feature Request
Milestone
Background and Motivation
I would like to write an analyzer and codefix to enforce a specific namespace/directory relationship that's a little different from the standard, motivated by the Unity game engine. I would like the codefix to be able to do the equivalent of MoveToNamespace when changing namespaces, but as far as I can tell that functionality isn't exposed.
I tried looking at the MatchFolderAndNamespace codefix for tips, but it looks like that moves the file to match the namespace, which is the opposite of what I want.
It might be possible to chase symbol references throughout the solution and to manually patch them to a changed namespace, but this seems very brittle to problems such as ambiguities introduced by adding new
using
s to other files. Presumably the infrastructure for doing this well already exists and could be exposed.Proposed API
I would expect an API similar to
Renamer
for refactoring namespaces.The text was updated successfully, but these errors were encountered: