Task <CompilationUnitSyntax> FixupSubmissionForEmissionAsync( CompilationUnitSyntax compilationUnit, CancellationToken cancellationToken = default(CancellationToken)) { var lastToken = compilationUnit.GetLastToken(); var trailingField = lastToken.Parent as FieldDeclarationSyntax; if (trailingField != null) { compilationUnit = FixupSubmissionWithTrailingFieldDeclarationForEmission( compilationUnit, trailingField); } else if (lastToken.Kind() == SyntaxKind.SemicolonToken) { compilationUnit = FixupSubmissionWithTrailingSemicolon(compilationUnit, lastToken); } return(Task.FromResult(compilationUnit)); }