Skip to content

Commit cd09f4a

Browse files
authored
consider cancel state when recomputing response type context key (microsoft#226409)
re microsoft/vscode-copilot#7324
1 parent 29be8e8 commit cd09f4a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,12 @@ export class ReportIssueAction extends AbstractInlineChatAction {
527527
id: MENU_INLINE_CHAT_WIDGET_STATUS,
528528
group: '0_main',
529529
order: 6,
530-
when: ContextKeyExpr.and(CTX_INLINE_CHAT_VISIBLE, CTX_INLINE_CHAT_SUPPORT_REPORT_ISSUE, CTX_INLINE_CHAT_REQUEST_IN_PROGRESS.negate())
530+
when: ContextKeyExpr.and(
531+
CTX_INLINE_CHAT_VISIBLE,
532+
CTX_INLINE_CHAT_SUPPORT_REPORT_ISSUE,
533+
CTX_INLINE_CHAT_RESPONSE_TYPE.notEqualsTo(InlineChatResponseType.None),
534+
CTX_INLINE_CHAT_REQUEST_IN_PROGRESS.negate()
535+
)
531536
}]
532537
});
533538
}

src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ export class InlineChatController implements IEditorContribution {
921921

922922
let responseType = InlineChatResponseType.None;
923923
for (const request of this._session.chatModel.getRequests()) {
924-
if (!request.response) {
924+
if (!request.response || request.response.isCanceled) {
925925
continue;
926926
}
927927
responseType = InlineChatResponseType.Messages;

0 commit comments

Comments
 (0)