Browse Source

Fixed xml doc formatting bug.

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

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

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

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

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

Loading…
Cancel
Save