Esempio n. 1
0
        public static IReadOnlyList <SemanticRange> VisitAllNodes(RazorCodeDocument razorCodeDocument, Range range = null)
        {
            var visitor = new TagHelperSemanticRangeVisitor(razorCodeDocument, range);

            visitor.Visit(razorCodeDocument.GetSyntaxTree().Root);

            return(visitor._semanticRanges);
        }
        public static IReadOnlyList <SemanticRange> VisitAllNodes(RazorCodeDocument razorCodeDocument, Range?range = null)
        {
            TextSpan?rangeAsTextSpan = null;

            if (range is not null)
            {
                var sourceText = razorCodeDocument.GetSourceText();
                rangeAsTextSpan = range.AsRazorTextSpan(sourceText);
            }

            var visitor = new TagHelperSemanticRangeVisitor(razorCodeDocument, rangeAsTextSpan);

            visitor.Visit(razorCodeDocument.GetSyntaxTree().Root);

            return(visitor._semanticRanges);
        }