Add padding support to the functions directive.
Exposed the CreateCodeMapping method on the CSharpCodeVisitor.
This commit is contained in:
parent
3afb31b78b
commit
dcf35ca20b
|
|
@ -308,7 +308,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
|
|||
Writer.WriteEndMethodInvocation();
|
||||
}
|
||||
|
||||
private void CreateCodeMapping(string code, Chunk chunk)
|
||||
public void CreateCodeMapping(string code, Chunk chunk)
|
||||
{
|
||||
using (CSharpLineMappingWriter mappingWriter = Writer.BuildLineMapping(chunk.Start, code.Length, Context.SourceFile))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,17 +4,19 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
|
|||
{
|
||||
public class CSharpTypeMemberVisitor : CodeVisitor<CSharpCodeWriter>
|
||||
{
|
||||
private CSharpCodeVisitor _csharpCodeVisitor;
|
||||
|
||||
public CSharpTypeMemberVisitor(CSharpCodeWriter writer, CodeGeneratorContext context)
|
||||
: base(writer, context) { }
|
||||
: base(writer, context)
|
||||
{
|
||||
_csharpCodeVisitor = new CSharpCodeVisitor(writer, context);
|
||||
}
|
||||
|
||||
protected override void Visit(TypeMemberChunk chunk)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(chunk.Code))
|
||||
{
|
||||
using (Writer.BuildLineMapping(chunk.Start, chunk.Code.Length, Context.SourceFile))
|
||||
{
|
||||
Writer.WriteLine(chunk.Code);
|
||||
}
|
||||
_csharpCodeVisitor.CreateCodeMapping(chunk.Code, chunk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue