private static SyntaxRemoveOptions GetRemoveOptions(NamespaceDeclarationSyntax declaration)
 {
     if (declaration.GetLeadingTrivia().All(f => f.IsWhitespaceOrEndOfLineTrivia()))
     {
         if (declaration.GetTrailingTrivia().All(f => f.IsWhitespaceOrEndOfLineTrivia()))
         {
             return(SyntaxRemoveOptions.KeepNoTrivia);
         }
         else
         {
             return(SyntaxRemoveOptions.KeepTrailingTrivia);
         }
     }
     else if (declaration.GetTrailingTrivia().All(f => f.IsWhitespaceOrEndOfLineTrivia()))
     {
         return(SyntaxRemoveOptions.KeepLeadingTrivia);
     }
     else
     {
         return(SyntaxRemoveOptions.KeepExteriorTrivia);
     }
 }
Exemplo n.º 2
0
 private static SyntaxRemoveOptions GetRemoveOptions(NamespaceDeclarationSyntax declaration)
 {
     if (declaration.GetLeadingTrivia().IsEmptyOrWhitespace())
     {
         if (declaration.GetTrailingTrivia().IsEmptyOrWhitespace())
         {
             return(SyntaxRemoveOptions.KeepNoTrivia);
         }
         else
         {
             return(SyntaxRemoveOptions.KeepTrailingTrivia);
         }
     }
     else if (declaration.GetTrailingTrivia().IsEmptyOrWhitespace())
     {
         return(SyntaxRemoveOptions.KeepLeadingTrivia);
     }
     else
     {
         return(SyntaxRemoveOptions.KeepExteriorTrivia);
     }
 }