未验证 提交 07aaeed6 编写于 作者: D David Poeschl 提交者: GitHub

Merge pull request #22714 from dpoeschl/HandleMissingOOPProcess

Be resilient to the OOP process going away in TodoComments and DesignerAttribute processing
......@@ -67,6 +67,11 @@ private async Task<KeepAliveSession> TryGetKeepAliveSessionAsync(RemoteHostClien
private async Task<DesignerAttributeResult> ScanDesignerAttributesInRemoteHostAsync(RemoteHostClient client, Document document, CancellationToken cancellationToken)
{
var keepAliveSession = await TryGetKeepAliveSessionAsync(client, cancellationToken).ConfigureAwait(false);
if (keepAliveSession == null)
{
// The client is not currently running, so we don't know the state of the DesignerAttribute.
return new DesignerAttributeResult(designerAttributeArgument: null, containsErrors: false, applicable: false);
}
var result = await keepAliveSession.TryInvokeAsync<DesignerAttributeResult>(
nameof(IRemoteDesignerAttributeService.ScanDesignerAttributesAsync),
......
......@@ -62,6 +62,11 @@ public async Task<IList<TodoComment>> GetTodoCommentsAsync(Document document, IL
RemoteHostClient client, Document document, IList<TodoCommentDescriptor> commentDescriptors, CancellationToken cancellationToken)
{
var keepAliveSession = await TryGetKeepAliveSessionAsync(client, cancellationToken).ConfigureAwait(false);
if (keepAliveSession == null)
{
// The client is not currently running, so we don't have any results.
return SpecializedCollections.EmptyList<TodoComment>();
}
var result = await keepAliveSession.TryInvokeAsync<IList<TodoComment>>(
nameof(IRemoteTodoCommentService.GetTodoCommentsAsync),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册