Пример #1
0
        private static DocumentedElement LoadFromSyntaxTokenAndTrivia(SyntaxToken token, SyntaxTriviaList triviaList)
        {
            DocumentedElement element = new DocumentedElement();

            element.Name = token.Text;

            // Break apart lines that come as a single group, remove empty lines, and trim whitespace overall.
            element.Documentation = triviaList.SelectMany(line => line.ToFullString().Split(new[] { '\r', '\n' })).ToList();
            element.Documentation = element.Documentation
                                    .Where(line => !string.IsNullOrWhiteSpace(line))
                                    .Select(line => line.Trim()).ToList();

            return(element);
        }