Esempio n. 1
0
        //If there is a comment on the same line as the method it is contained in trailing trivia for the parameter list
        //If it's there we need to add it to the final comments
        private static void AddParamListTriviaIfNeeded(ISyntaxFacts syntaxFacts, SyntaxNode methodDeclaration, List <SyntaxTrivia> finalLeadingTrivia)
        {
            var paramList = syntaxFacts.GetParameterList(methodDeclaration);

            if (paramList != null)
            {
                var trailingTrivia = paramList.GetTrailingTrivia();
                if (trailingTrivia.Any(t => syntaxFacts.IsRegularComment(t)))
                {
                    // we have a meaningful comment on the parameter list so add it to the trivia list
                    finalLeadingTrivia.AddRange(trailingTrivia);
                }
            }
        }