Skip to content
代码片段 群组 项目
提交 7e0ea5b7 编辑于 作者: Jonathon Marolf's avatar Jonathon Marolf
浏览文件

check if syntax tree is present

上级 44b03197
无相关合并请求
......@@ -278,17 +278,24 @@ private static async Task<CompletionList> GetCompletionListAsync(
CancellationToken cancellationToken)
{
var context = new CompletionListContext(document, position, triggerInfo, options, cancellationToken);
var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
if (!root.FullSpan.IntersectsWith(position))
if (document.SupportsSyntaxTree)
{
try
var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false);
if (!root.FullSpan.IntersectsWith(position))
{
// Trying to track down source of https://github.com/dotnet/roslyn/issues/9325
var sourceText = await document.GetTextAsync(cancellationToken).ConfigureAwait(false);
ReportException(position, root, sourceText);
try
{
// Trying to track down source of https://github.com/dotnet/roslyn/issues/9325
var sourceText = await document.GetTextAsync(cancellationToken).ConfigureAwait(false);
ReportException(position, root, sourceText);
}
catch (Exception e) when (FatalError.ReportWithoutCrash(e))
{
}
}
catch (Exception e) when (FatalError.ReportWithoutCrash(e))
else
{
await provider.ProduceCompletionListAsync(context).ConfigureAwait(false);
}
}
else
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册