private static IReadOnlyList <SyntaxResult> VisitAllNodes(RazorCodeDocument razorCodeDocument)
        {
            var visitor = new TagHelperSpanVisitor(razorCodeDocument);

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

            return(visitor.TagHelperData);
        }
        public static IReadOnlyList <TagHelperSpanInternal> GetTagHelperSpans(this RazorSyntaxTree syntaxTree)
        {
            if (syntaxTree == null)
            {
                throw new ArgumentNullException(nameof(syntaxTree));
            }

            var visitor = new TagHelperSpanVisitor(syntaxTree.Source);

            visitor.Visit(syntaxTree.Root);

            return(visitor.TagHelperSpans);
        }