icsharpcode/NRefactory — Issue #10: When an AST is written out, lines following // comments are unindented.
Author: holmak
Created: 2011-12-04 04:55:51+00:00
State: open

Regardless of the formatting options, NRefactory always outputs lines that follow single-line comments completely unindented. I believe this is not intended behavior.

**INPUT:**

```C#
// This is the input file.
using System;

namespace ReproForNRefactoryCommentOutputBug
{
public sealed class FileToBeParsedAndWritten
{
public int SomeFunction()
{
// When NRefactory writes out the AST of this source file,
// the line following this comment will not be indented.
string text = "This line won't be indented.";
string moreText = "But this line will be formatted correctly.";

// This happens after all comments.
return 42;
}
}
}
```

**EXPECTED:** The output file's lines will be indented according to the CSharpFormattingOptions.

**ACTUAL:** Any lines in the output that follow a comment will be completely unindented.

```C#
// This is the actual output.
using System;
namespace ReproForNRefactoryCommentOutputBug
{
public sealed class FileToBeParsedAndWritten
{
public int SomeFunction ()
{
// When NRefactory writes out the AST of this source file,
// the line following this comment will not be indented.
string text = "This line won't be indented.";
string moreText = "But this line will be formatted correctly.";
// This happens after all comments.
return 42;
}
}
}
```