Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public static bool CheckSpanDirectives(this AnalysisOptions options, SyntaxNode node)
 {
     return(options.CanContainDirectives || !node.SpanContainsDirectives());
 }