提交 7d3b82ae 编写于 作者: K Kirill Osenkov

When a text buffer does not represent a document from a workspace...

When a text buffer does not represent a document from a workspace GetOpenDocumentInCurrentContextWithChanges() will return null. Allow for that without a NullReferenceException.

Fixes #24625.
上级 f6d6c3f9
......@@ -897,6 +897,11 @@ public async Task<ISuggestedActionCategorySet> GetSuggestedActionCategoriesAsync
using (var asyncToken = _owner.OperationListener.BeginAsyncOperation(nameof(GetSuggestedActionCategoriesAsync)))
{
var document = range.Snapshot.GetOpenDocumentInCurrentContextWithChanges();
if (document == null)
{
return null;
}
using (var linkedTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken))
{
var linkedToken = linkedTokenSource.Token;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册