private static ImmutableArray <SymbolDisplayPart> .Builder ReplaceDefaultExpressionWithDefaultLiteral(
            ISymbol symbol,
            ImmutableArray <SymbolDisplayPart> .Builder parts)
        {
            ImmutableArray <SymbolDisplayPart> .Builder builder = null;

            int prevIndex = 0;
            int i         = 0;

            while (i < parts.Count)
            {
                if (parts[i].IsKeyword("default"))
                {
                    ReplaceDefaultExpressionWithDefaultLiteral3();
                }

                i++;
            }

            if (builder == null)
            {
                return(parts);
            }

            for (int j = prevIndex; j < parts.Count; j++)
            {
                builder.Add(parts[j]);
            }

            return(builder);

            void ReplaceDefaultExpressionWithDefaultLiteral3()
            {
                int openParenIndex = i + 1;

                if (openParenIndex >= parts.Count ||
                    !parts[openParenIndex].IsPunctuation("("))
                {
                    return;
                }

                int closeParenIndex = FindClosingParentheses(openParenIndex + 1);

                if (closeParenIndex == -1)
                {
                    return;
                }

                if (builder == null)
                {
                    builder = ImmutableArray.CreateBuilder <SymbolDisplayPart>(parts.Count);
                }

                for (int l = prevIndex; l < openParenIndex; l++)
                {
                    builder.Add(parts[l]);
                }

                i = closeParenIndex;

                prevIndex = i + 1;
            }

            int FindClosingParentheses(int startIndex)
            {
                int depth = 1;

                int j = startIndex;

                while (j < parts.Count)
                {
                    SymbolDisplayPart part = parts[j];

                    if (part.IsPunctuation())
                    {
                        string text = part.ToString();

                        if (text == "(")
                        {
                            depth++;
                        }
                        else if (text == ")")
                        {
                            Debug.Assert(depth > 0, "Parentheses depth should be greater than 0\r\n" + symbol.ToDisplayString(Roslynator.SymbolDisplayFormats.Test));

                            depth--;

                            if (depth == 0)
                            {
                                return(j);
                            }
                        }
                    }

                    j++;
                }

                return(-1);
            }
        }