示例#1
0
        private static async Task <Document> MakeMultiline(
            Document document,
            ArgumentListSyntax argumentList,
            CancellationToken cancellationToken)
        {
            var arguments = argumentList.Arguments.ToList();

            if (arguments.Count == 0)
            {
                return(document);
            }

            var tree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);

            if (tree == default)
            {
                return(document);
            }

            var currentIndent = argumentList.EstimateIndent(tree, cancellationToken);
            var indent        = currentIndent + Settings.IndentOneLevel;

            return(await RewriteArgumentList(
                       document,
                       argumentList,
                       Settings.EndOfLine,
                       Settings.EndOfLine,
                       SF.Whitespace(indent),
                       cancellationToken));
        }