Exemple #1
0
        private static async Task <Document> MakeMultiline(
            Document document,
            ParameterListSyntax parameterList,
            CancellationToken cancellationToken)
        {
            var parameters = parameterList.Parameters.ToList();

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

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

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

            var currentIndent   = parameterList.EstimateIndent(tree, cancellationToken);
            var parameterIndent = currentIndent + Settings.IndentOneLevel;

            return(await RewriteParameterList(
                       document,
                       parameterList,
                       Settings.EndOfLine,
                       Settings.EndOfLine,
                       SF.Whitespace(parameterIndent),
                       cancellationToken));
        }