@@ -32,7 +32,7 @@ import { EditResponse, EmptyResponse, ErrorResponse, ExpansionState, IInlineChat
32
32
import { EditModeStrategy , LivePreviewStrategy , LiveStrategy , PreviewStrategy } from 'vs/workbench/contrib/inlineChat/browser/inlineChatStrategies' ;
33
33
import { InlineChatZoneWidget } from 'vs/workbench/contrib/inlineChat/browser/inlineChatWidget' ;
34
34
import { CTX_INLINE_CHAT_HAS_ACTIVE_REQUEST , CTX_INLINE_CHAT_LAST_FEEDBACK , IInlineChatRequest , IInlineChatResponse , INLINE_CHAT_ID , EditMode , InlineChatResponseFeedbackKind , CTX_INLINE_CHAT_LAST_RESPONSE_TYPE , InlineChatResponseType , CTX_INLINE_CHAT_DID_EDIT , CTX_INLINE_CHAT_HAS_STASHED_SESSION } from 'vs/workbench/contrib/inlineChat/common/inlineChat' ;
35
- import { IChatWidgetService } from 'vs/workbench/contrib/chat/browser/chat' ;
35
+ import { IChatAccessibilityService , IChatWidgetService } from 'vs/workbench/contrib/chat/browser/chat' ;
36
36
import { IChatService } from 'vs/workbench/contrib/chat/common/chatService' ;
37
37
import { INotebookEditorService } from 'vs/workbench/contrib/notebook/browser/services/notebookEditorService' ;
38
38
import { CellUri } from 'vs/workbench/contrib/notebook/common/notebookCommon' ;
@@ -114,6 +114,7 @@ export class InlineChatController implements IEditorContribution {
114
114
@IContextKeyService contextKeyService : IContextKeyService ,
115
115
@IAccessibilityService private readonly _accessibilityService : IAccessibilityService ,
116
116
@IKeybindingService private readonly _keybindingService : IKeybindingService ,
117
+ @IChatAccessibilityService private readonly _chatAccessibilityService : IChatAccessibilityService
117
118
) {
118
119
this . _ctxHasActiveRequest = CTX_INLINE_CHAT_HAS_ACTIVE_REQUEST . bindTo ( contextKeyService ) ;
119
120
this . _ctxDidEdit = CTX_INLINE_CHAT_DID_EDIT . bindTo ( contextKeyService ) ;
@@ -504,6 +505,7 @@ export class InlineChatController implements IEditorContribution {
504
505
selection : this . _editor . getSelection ( ) ,
505
506
wholeRange : this . _activeSession . wholeRange . value ,
506
507
} ;
508
+ this . _chatAccessibilityService . acceptRequest ( ) ;
507
509
const task = this . _activeSession . provider . provideResponse ( this . _activeSession . session , request , requestCts . token ) ;
508
510
this . _log ( 'request started' , this . _activeSession . provider . debugName , this . _activeSession . session , request ) ;
509
511
@@ -514,7 +516,6 @@ export class InlineChatController implements IEditorContribution {
514
516
this . _zone . value . widget . updateInfo ( ! this . _activeSession . lastExchange ? localize ( 'thinking' , "Thinking\u2026" ) : '' ) ;
515
517
this . _ctxHasActiveRequest . set ( true ) ;
516
518
reply = await raceCancellationError ( Promise . resolve ( task ) , requestCts . token ) ;
517
-
518
519
if ( reply ?. type === 'message' ) {
519
520
response = new MarkdownResponse ( this . _activeSession . textModelN . uri , reply ) ;
520
521
} else if ( reply ) {
@@ -594,19 +595,23 @@ export class InlineChatController implements IEditorContribution {
594
595
const { response } = this . _activeSession . lastExchange ! ;
595
596
this . _showWidget ( false ) ;
596
597
598
+ let status : string | undefined ;
599
+
597
600
this . _ctxLastResponseType . set ( response instanceof EditResponse || response instanceof MarkdownResponse
598
601
? response . raw . type
599
602
: undefined ) ;
600
603
601
604
if ( response instanceof EmptyResponse ) {
602
605
// show status message
603
- this . _zone . value . widget . updateStatus ( localize ( 'empty' , "No results, please refine your input and try again" ) , { classes : [ 'warn' ] } ) ;
606
+ status = localize ( 'empty' , "No results, please refine your input and try again" ) ;
607
+ this . _zone . value . widget . updateStatus ( status , { classes : [ 'warn' ] } ) ;
604
608
return State . WAIT_FOR_INPUT ;
605
609
606
610
} else if ( response instanceof ErrorResponse ) {
607
611
// show error
608
612
if ( ! response . isCancellation ) {
609
- this . _zone . value . widget . updateStatus ( response . message , { classes : [ 'error' ] } ) ;
613
+ status = response . message ;
614
+ this . _zone . value . widget . updateStatus ( status , { classes : [ 'error' ] } ) ;
610
615
}
611
616
612
617
} else if ( response instanceof MarkdownResponse ) {
@@ -615,6 +620,7 @@ export class InlineChatController implements IEditorContribution {
615
620
this . _zone . value . widget . updateStatus ( '' ) ;
616
621
this . _zone . value . widget . updateMarkdownMessage ( renderedMarkdown . element ) ;
617
622
this . _zone . value . widget . updateToolbar ( true ) ;
623
+ status = renderedMarkdown . element ?. textContent ?? '' ;
618
624
this . _activeSession . lastExpansionState = this . _zone . value . widget . expansionState ;
619
625
620
626
} else if ( response instanceof EditResponse ) {
@@ -626,10 +632,13 @@ export class InlineChatController implements IEditorContribution {
626
632
if ( ! canContinue ) {
627
633
return State . ACCEPT ;
628
634
}
629
-
635
+ // TODO: summarize proposed changes
636
+ status = 'navigate to the diff editor to review proposed changes.' ;
630
637
await this . _strategy . renderChanges ( response ) ;
631
638
}
632
639
640
+ this . _chatAccessibilityService . acceptResponse ( status ) ;
641
+
633
642
return State . WAIT_FOR_INPUT ;
634
643
}
635
644
0 commit comments