Browse Source

Fixed xml doc formatting bug.

pull/45/merge
Mike Krüger 12 years ago
parent
commit
e3c40ba7f3
  1. 2
      ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_Global.cs
  2. 17
      ICSharpCode.NRefactory.Tests/FormattingTests/TestTypeLevelIndentation.cs

2
ICSharpCode.NRefactory.CSharp/Formatter/FormattingVisitor_Global.cs

@ -122,8 +122,8 @@ namespace ICSharpCode.NRefactory.CSharp
{ {
var node = entity.FirstChild; var node = entity.FirstChild;
while (node != null && node.Role == Roles.Comment) { while (node != null && node.Role == Roles.Comment) {
FixIndentation(node);
node = node.GetNextSibling(NoWhitespacePredicate); node = node.GetNextSibling(NoWhitespacePredicate);
FixIndentation(node);
} }
if (entity.Attributes.Count > 0) { if (entity.Attributes.Count > 0) {
AstNode n = null; AstNode n = null;

17
ICSharpCode.NRefactory.Tests/FormattingTests/TestTypeLevelIndentation.cs

@ -107,6 +107,23 @@ class Test {
@"class Test {}"); @"class Test {}");
} }
[Test]
public void TestClassIndentationWithDocComment()
{
CSharpFormattingOptions policy = FormattingOptionsFactory.CreateMono();
policy.ClassBraceStyle = BraceStyle.DoNotChange;
Test(policy,
@"/// <summary>
/// olwcowcolwc
/// </summary>
class Test {}",
@"/// <summary>
/// olwcowcolwc
/// </summary>
class Test {}");
}
[Test] [Test]
public void TestAttributeIndentation() public void TestAttributeIndentation()
{ {

Loading…
Cancel
Save