Write helper method template functions with no indent.

Also removed capturing of the LineMapping (wasn't being used) for the CSharpHelperVisitor.
This commit is contained in:
N. Taylor Mullen 2014-02-26 10:26:48 -08:00
parent 49ffb5ae81
commit 9f05cf8fbb
1 changed files with 5 additions and 1 deletions

View File

@ -20,9 +20,13 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
string accessibility = "public " + (Context.Host.StaticHelpers ? "static" : String.Empty);
// We want to write the method signature at 0 indentation so if helper's are formatted they format correctly.
int currentIndentation = Writer.CurrentIndent;
Writer.ResetIndent();
Writer.Write(accessibility).Write(" ").Write(Context.Host.GeneratedClassContext.TemplateTypeName).Write(" ");
Writer.SetIndent(currentIndentation);
using (CSharpLineMappingWriter mappingWriter = Writer.BuildLineMapping(chunk.Signature.Location, chunk.Signature.Value.Length, Context.SourceFile))
using (Writer.BuildLineMapping(chunk.Signature.Location, chunk.Signature.Value.Length, Context.SourceFile))
{
Writer.Write(chunk.Signature);
}