This repository was archived by the owner on Sep 24, 2020. It is now read-only.

Description
This is the problem code.
I want to change Space Indent to Tab Indent.
// use Bridge.NRefactory.5.5.4
using System;
using ICSharpCode.NRefactory.CSharp;
using ICSharpCode.NRefactory.Editor;
namespace Foo
{
class MainClass
{
public static void Main (string [] args)
{
var policy = FormattingOptionsFactory.CreateMono();
var formatter = new CSharpFormatter(policy);
formatter.TextEditorOptions.TabsToSpaces = false;
var text = @"
namespace Foo
{
public class Bar
{
public void MethodA()
{
Promise.All
(
MethodB(),
MethodC(),
() => {}
);
}
}
}
";
var document = new StringBuilderDocument(text);
var syntaxTree = SyntaxTree.Parse(document, document.FileName);
var changes = formatter.AnalyzeFormatting(document, syntaxTree);
changes.ApplyChanges();
Console.WriteLine(document.Text.Replace('\t', '>'));
Console.ReadLine();
}
}
}
Output
(Replace Tab to ">" for github)
namespace Foo
{
>public class Bar
>{
>>public void MethodA ()
>>{
>>>Promise.All
(
>>>>MethodB (),
>>>>MethodC (),
>>>>() => {
>>>>}
>>>);
>>}
>}
}
Why does Line 8 have white space indent?