Browse Source

Merge pull request #366 from sven-n/fix-move-class

Fix indentation for 'Move class to File' function
4.x
Siegfried Pammer 12 years ago
parent
commit
f0930c43f4
  1. 6
      src/Main/ICSharpCode.SharpDevelop.Dom/Project/Src/Refactoring/NRefactoryRefactoringProvider.cs

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

@ -6,6 +6,7 @@ using System.Collections.Generic; @@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using ICSharpCode.NRefactory.Ast;
using ICSharpCode.NRefactory.PrettyPrinter;
@ -430,6 +431,11 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring @@ -430,6 +431,11 @@ namespace ICSharpCode.SharpDevelop.Dom.Refactoring
}
}
IOutputAstVisitor outputVisitor = (language==NR.SupportedLanguage.CSharp) ? new CSharpOutputVisitor() : (IOutputAstVisitor)new VBNetOutputVisitor();
var match = Regex.Match(codeForNewType, @"^([\s]+)", RegexOptions.Multiline);
if (match != null && !string.IsNullOrEmpty(match.Groups[0].Value)) {
outputVisitor.Options.IndentationChar = match.Groups[0].Value[0];
}
using (SpecialNodesInserter.Install(comments, outputVisitor)) {
parser.CompilationUnit.AcceptVisitor(outputVisitor, null);
}

Loading…
Cancel
Save