diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/MoveTypeToFileContextAction.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/MoveTypeToFileContextAction.cs index 136e0c77f9..00ce53d9f7 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/MoveTypeToFileContextAction.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/MoveTypeToFileContextAction.cs @@ -81,7 +81,7 @@ namespace CSharpBinding.Refactoring IViewContent viewContent = FileService.NewFile(newFileName, newCode.ToString()); viewContent.PrimaryFile.SaveToDisk(newFileName); // now that the code is saved in the other file, remove it from the original document - RemoveExtractedNode(); + RemoveExtractedNode(context, node); IProject project = (IProject)compilation.GetProject(); if (project != null) { @@ -94,9 +94,12 @@ namespace CSharpBinding.Refactoring } } - void RemoveExtractedNode() + void RemoveExtractedNode(EditorRefactoringContext context, EntityDeclaration node) { - //throw new NotImplementedException(); + IDocument document = context.Editor.Document; + int start = document.GetOffset(node.StartLocation); + int end = document.GetOffset(node.EndLocation); + document.Remove(start, end - start); } string CopyFileHeader(IDocument document, CSharpFullParseInformation info)