icsharpcode / NRefactory

NRefactory - Refactoring Your C# Code
684 stars 262 forks source link

Move to a new file #450

Closed jchannon closed 9 years ago

jchannon commented 9 years ago

Do you have any plans to provide a code action that will move a type to a new file?

For example I can use the create interface code action but was wondering if there was a way to return the class, usings, namespace etc for said interface that I could put into a new file

Thanks

dgrunwald commented 9 years ago

This is already implemented in SharpDevelop: https://github.com/icsharpcode/SharpDevelop/blob/master/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/MoveTypeToFileContextAction.cs (it's not in NRefactory itself because it needs to add a new file to the IDE-specific project system)