Browse Source

Fixed SD2-1494 - 'Move class to file' duplicates delegate declarations

Based on patch by Bruno Marques.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4748 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 16 years ago
parent
commit
cd800c8308
  1. 17
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/NRefactoryRefactoringProvider.cs

17
src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/NRefactoryRefactoringProvider.cs

@ -488,7 +488,7 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring
} }
} }
public override object VisitTypeDeclaration(TypeDeclaration typeDeclaration, object data) void HandleTypeDeclaration(AttributedNode typeDeclaration)
{ {
if (typeDeclaration.EndLocation.Y > includeCommentsAfterLine) if (typeDeclaration.EndLocation.Y > includeCommentsAfterLine)
includeCommentsAfterLine = typeDeclaration.EndLocation.Y; includeCommentsAfterLine = typeDeclaration.EndLocation.Y;
@ -498,6 +498,17 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring
} else { } else {
RemoveCurrentNode(); RemoveCurrentNode();
} }
}
public override object VisitTypeDeclaration(TypeDeclaration typeDeclaration, object data)
{
HandleTypeDeclaration(typeDeclaration);
return null;
}
public override object VisitDelegateDeclaration(DelegateDeclaration delegateDeclaration, object data)
{
HandleTypeDeclaration(delegateDeclaration);
return null; return null;
} }
} }
@ -608,13 +619,13 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring
static bool IsEndDirective(string trimLine) static bool IsEndDirective(string trimLine)
{ {
return trimLine.StartsWith("#endregion", StringComparison.Ordinal) return trimLine.StartsWith("#endregion", StringComparison.Ordinal)
|| trimLine.StartsWith("#endif", StringComparison.Ordinal); || trimLine.StartsWith("#endif", StringComparison.Ordinal);
} }
static bool IsStartDirective(string trimLine) static bool IsStartDirective(string trimLine)
{ {
return trimLine.StartsWith("#region", StringComparison.Ordinal) return trimLine.StartsWith("#region", StringComparison.Ordinal)
|| trimLine.StartsWith("#if", StringComparison.Ordinal); || trimLine.StartsWith("#if", StringComparison.Ordinal);
} }
#endregion #endregion

Loading…
Cancel
Save