internal static SyntaxToken Normalize(SyntaxToken token, string indentWhitespace, string eolWhitespace, bool useElasticTrivia = false) { var normalizer = new SyntaxNormalizer(token.FullSpan, indentWhitespace, eolWhitespace, useElasticTrivia); var result = normalizer.VisitToken(token); normalizer.Free(); return(result); }
internal static TNode Normalize <TNode>(TNode node, string indentWhitespace, string eolWhitespace, bool useElasticTrivia = false) where TNode : SyntaxNode { var normalizer = new SyntaxNormalizer(node.FullSpan, indentWhitespace, eolWhitespace, useElasticTrivia); var result = (TNode)normalizer.Visit(node); normalizer.Free(); return(result); }
internal static SyntaxTriviaList Normalize(SyntaxTriviaList trivia, string indentWhitespace, string eolWhitespace, bool useElasticTrivia = false) { var normalizer = new SyntaxNormalizer(trivia.FullSpan, indentWhitespace, eolWhitespace, useElasticTrivia); var result = normalizer.RewriteTrivia( trivia, normalizer.GetIndentationDepth(), isTrailing: false, mustBeIndented: false, mustHaveSeparator: false, lineBreaksAfter: 0, lineBreaksBefore: 0); normalizer.Free(); return(result); }