Skip to content

Commit

Permalink
Fix build break
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonchou committed Mar 17, 2023
1 parent 4b3db49 commit 0bc049d
Showing 1 changed file with 0 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -994,44 +994,4 @@ private static IReadOnlyList<TagHelperSpanInternal> GetTagHelperSpans(RazorCodeD

return tagHelperSpans;
}

private static IReadOnlyList<ClassifiedSpanInternal> GetClassifiedSpans(RazorCodeDocument document)
{
// Since this service is called so often, we get a good performance improvement by caching these values
// for this code document. If the document changes, as the user types, then the document instance will be
// different, so we don't need to worry about invalidating the cache.
var classifiedSpans = (IReadOnlyList<ClassifiedSpanInternal>)document.Items[typeof(ClassifiedSpanInternal)];
if (classifiedSpans is null)
{
var syntaxTree = document.GetSyntaxTree();

var visitor = new ClassifiedSpanVisitor(syntaxTree.Source);
visitor.Visit(syntaxTree.Root);
classifiedSpans = visitor.ClassifiedSpans;

document.Items[typeof(ClassifiedSpanInternal)] = classifiedSpans;
}

return classifiedSpans;
}

private static IReadOnlyList<TagHelperSpanInternal> GetTagHelperSpans(RazorCodeDocument document)
{
// Since this service is called so often, we get a good performance improvement by caching these values
// for this code document. If the document changes, as the user types, then the document instance will be
// different, so we don't need to worry about invalidating the cache.
var tagHelperSpans = (IReadOnlyList<TagHelperSpanInternal>)document.Items[typeof(TagHelperSpanInternal)];
if (tagHelperSpans is null)
{
var syntaxTree = document.GetSyntaxTree();

var visitor = new TagHelperSpanVisitor(syntaxTree.Source);
visitor.Visit(syntaxTree.Root);
tagHelperSpans = visitor.TagHelperSpans;

document.Items[typeof(TagHelperSpanInternal)] = tagHelperSpans;
}

return tagHelperSpans;
}
}

0 comments on commit 0bc049d

Please sign in to comment.