public static bool CheckSpanDirectives(this AnalysisOptions options, SyntaxNode node, TextSpan span) { if (!options.CanContainDirectives) { if (node.Span.Contains(span)) { return(!node.ContainsDirectives(span)); } foreach (SyntaxNode ancestor in node.Ancestors()) { if (ancestor.Span.Contains(span)) { return(!ancestor.ContainsDirectives(span)); } } } return(true); }
public static bool CheckSpanDirectives(this AnalysisOptions options, SyntaxNode node) { return(options.CanContainDirectives || !node.SpanContainsDirectives()); }