Disable async await warnings in empty Execute method.
Also removed a confusing CSharpCodeWriting method. #28
This commit is contained in:
parent
20c91146f1
commit
2800c4938a
|
|
@ -57,9 +57,13 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
|
|||
// Add space inbetween constructor and method body
|
||||
writer.WriteLine();
|
||||
|
||||
using (writer.BuildMethodDeclaration("public override async", "Task", Host.GeneratedClassContext.ExecuteMethodName))
|
||||
// 1998 is to not warn about empty async methods.
|
||||
using (writer.BuildDisableWarningScope(1998))
|
||||
{
|
||||
new CSharpCodeVisitor(writer, Context).Accept(Tree.Chunks);
|
||||
using (writer.BuildMethodDeclaration("public override async", "Task", Host.GeneratedClassContext.ExecuteMethodName))
|
||||
{
|
||||
new CSharpCodeVisitor(writer, Context).Accept(Tree.Chunks);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -226,11 +226,6 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
|
|||
return WriteStartMethodInvocation(methodName).Write(string.Join(", ", parameters)).WriteEndMethodInvocation(endLine);
|
||||
}
|
||||
|
||||
public CSharpDisableWarningScope BuildDisableWarningScope()
|
||||
{
|
||||
return new CSharpDisableWarningScope(this, 219);
|
||||
}
|
||||
|
||||
public CSharpDisableWarningScope BuildDisableWarningScope(int warning)
|
||||
{
|
||||
return new CSharpDisableWarningScope(this, warning);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
|
|||
{
|
||||
using (Writer.BuildMethodDeclaration("private", "void", "@" + DesignTimeHelperMethodName))
|
||||
{
|
||||
using (Writer.BuildDisableWarningScope())
|
||||
using (Writer.BuildDisableWarningScope(219))
|
||||
{
|
||||
Accept(tree.Chunks);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue