コード例 #1
0
        private static SyntaxRemoveOptions GetRemoveOptions(CaseSwitchLabelSyntax label)
        {
            if (label.GetLeadingTrivia().IsEmptyOrWhitespace() &&
                label.GetTrailingTrivia().IsEmptyOrWhitespace())
            {
                return(SyntaxRemoveOptions.KeepNoTrivia);
            }

            return(SyntaxRemoveOptions.KeepExteriorTrivia);
        }
コード例 #2
0
        private static SyntaxRemoveOptions GetRemoveOptions(CaseSwitchLabelSyntax label)
        {
            if (label.GetLeadingTrivia().All(f => f.IsWhitespaceOrEndOfLineTrivia()) &&
                label.GetTrailingTrivia().All(f => f.IsWhitespaceOrEndOfLineTrivia()))
            {
                return(SyntaxRemoveOptions.KeepNoTrivia);
            }

            return(SyntaxRemoveOptions.KeepExteriorTrivia);
        }