提交 d2af97f7 编写于 作者: C CyrusNajmabadi

Merge pull request #3609 from CyrusNajmabadi/solutionSizeCrash

Fix crash in the solution size tracker for solutions that don't support syntax.
......@@ -66,6 +66,11 @@ public Task NewSolutionSnapshotAsync(Solution solution, CancellationToken cancel
public async Task AnalyzeSyntaxAsync(Document document, CancellationToken cancellationToken)
{
if (!document.SupportsSyntaxTree)
{
return;
}
// getting tree is cheap since tree always stays in memory
var tree = await document.GetSyntaxTreeAsync(cancellationToken).ConfigureAwait(false);
var length = tree.Length;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册