Move semicolon out from pragma for usings.
This commit is contained in:
parent
2ff6c12347
commit
fa342287ad
|
|
@ -129,18 +129,19 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
|
||||||
|
|
||||||
public CSharpCodeWriter WriteUsing(string name)
|
public CSharpCodeWriter WriteUsing(string name)
|
||||||
{
|
{
|
||||||
int throwAway;
|
return WriteUsing(name, endLine: true);
|
||||||
|
|
||||||
return WriteUsing(name, out throwAway);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public CSharpCodeWriter WriteUsing(string name, out int writeSize)
|
public CSharpCodeWriter WriteUsing(string name, bool endLine)
|
||||||
{
|
{
|
||||||
string output = String.Format("using {0};", name);
|
Write(String.Format("using {0}", name));
|
||||||
|
|
||||||
writeSize = output.Length;
|
if(endLine)
|
||||||
|
{
|
||||||
|
WriteLine(";");
|
||||||
|
}
|
||||||
|
|
||||||
return WriteLine(output);
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CSharpCodeWriter WriteLineDefaultDirective()
|
public CSharpCodeWriter WriteLineDefaultDirective()
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,14 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
|
||||||
|
|
||||||
protected override void Visit(UsingChunk chunk)
|
protected override void Visit(UsingChunk chunk)
|
||||||
{
|
{
|
||||||
|
ImportedUsings.Add(chunk.Namespace);
|
||||||
|
|
||||||
using (Writer.BuildLineMapping(chunk.Start, chunk.Association.Length, Context.SourceFile))
|
using (Writer.BuildLineMapping(chunk.Start, chunk.Association.Length, Context.SourceFile))
|
||||||
{
|
{
|
||||||
ImportedUsings.Add(chunk.Namespace);
|
Writer.WriteUsing(chunk.Namespace, endLine: false);
|
||||||
Writer.WriteUsing(chunk.Namespace);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Writer.WriteLine(";");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue