Skip to content

Commit 6d631a2

Browse files
committed
Doc
1 parent f350778 commit 6d631a2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/RazorCodeDocumentExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using Microsoft.AspNetCore.Razor.Language.Syntax;
1111
using Microsoft.CodeAnalysis;
1212
using Microsoft.CodeAnalysis.Razor;
13+
using Microsoft.CodeAnalysis.Razor.ProjectSystem;
1314
using Microsoft.CodeAnalysis.Razor.Protocol;
1415
using Microsoft.CodeAnalysis.Text;
1516

@@ -42,6 +43,11 @@ public static SourceText GetHtmlSourceText(this RazorCodeDocument document)
4243
/// Retrieves a cached Roslyn <see cref="SyntaxTree"/> from the generated C# document.
4344
/// If a tree has not yet been cached, a new one will be parsed and added to the cache.
4445
/// </summary>
46+
/// <remarks>
47+
/// If possible, prefer calling <see cref="IDocumentSnapshot.GetCSharpSyntaxTreeAsync(CancellationToken)" />
48+
/// because it will either call this method, or in cohosting get the syntax tree from Roslyn, where the cached
49+
/// tree can be shared with many more features.
50+
/// </remarks>
4551
public static SyntaxTree GetOrParseCSharpSyntaxTree(this RazorCodeDocument document, CancellationToken cancellationToken)
4652
=> GetCachedData(document).GetOrParseCSharpSyntaxTree(cancellationToken);
4753

0 commit comments

Comments
 (0)