/// <summary> /// Gets top-level and nested diagnostics from the <paramref name="node"/>. /// </summary> /// <typeparam name="TNode">The type of syntax node.</typeparam> /// <param name="node">The syntax node.</param> /// <returns>The list of <see cref="RazorDiagnostic"/>s.</returns> public static IReadOnlyList <RazorDiagnostic> GetAllDiagnostics <TNode>(this TNode node) where TNode : SyntaxNode { var walker = new DiagnosticSyntaxWalker(); walker.Visit(node); return(walker.Diagnostics); }
/// <summary> /// Gets top-level and nested diagnostics from the <paramref name="node"/>. /// </summary> /// <typeparam name="TNode">The type of syntax node.</typeparam> /// <param name="node">The syntax node.</param> /// <returns>The list of <see cref="RazorDiagnostic"/>s.</returns> public static IReadOnlyList <RazorDiagnostic> GetAllDiagnostics <TNode>(this TNode node) where TNode : SyntaxNode { if (node == null) { throw new ArgumentNullException(nameof(node)); } var walker = new DiagnosticSyntaxWalker(); walker.Visit(node); return(walker.Diagnostics); }