@@ -55,6 +55,7 @@ import { EditorExtensionsRegistry } from 'vs/editor/browser/editorExtensions';
55
55
import { ICodeEditorWidgetOptions } from 'vs/editor/browser/widget/codeEditor/codeEditorWidget' ;
56
56
import { SnippetController2 } from 'vs/editor/contrib/snippet/browser/snippetController2' ;
57
57
import { SuggestController } from 'vs/editor/contrib/suggest/browser/suggestController' ;
58
+ import { IChatService } from 'vs/workbench/contrib/chat/common/chatService' ;
58
59
59
60
60
61
export interface InlineChatWidgetViewState {
@@ -145,8 +146,6 @@ export class InlineChatWidget {
145
146
private _isLayouting : boolean = false ;
146
147
147
148
private _followUpDisposables = this . _store . add ( new DisposableStore ( ) ) ;
148
-
149
-
150
149
constructor (
151
150
location : ChatAgentLocation ,
152
151
options : IInlineChatWidgetConstructionOptions ,
@@ -157,6 +156,7 @@ export class InlineChatWidget {
157
156
@IConfigurationService private readonly _configurationService : IConfigurationService ,
158
157
@IAccessibleViewService private readonly _accessibleViewService : IAccessibleViewService ,
159
158
@ITextModelService protected readonly _textModelResolverService : ITextModelService ,
159
+ @IChatService private readonly _chatService : IChatService ,
160
160
) {
161
161
// Share hover delegates between toolbars to support instant hover between both
162
162
// TODO@jrieken move into chat widget
@@ -165,6 +165,9 @@ export class InlineChatWidget {
165
165
this . _store . add ( this . _configurationService . onDidChangeConfiguration ( e => {
166
166
if ( e . affectsConfiguration ( AccessibilityVerbositySettingId . InlineChat ) ) {
167
167
this . _updateAriaLabel ( ) ;
168
+ // TODO@jrieken FIX THIS
169
+ // this._chatWidget.ariaLabel = this._accessibleViewService.getOpenAriaHint(AccessibilityVerbositySettingId.InlineChat);
170
+ this . _elements . followUps . ariaLabel = this . _accessibleViewService . getOpenAriaHint ( AccessibilityVerbositySettingId . InlineChat ) ;
168
171
}
169
172
} ) ) ;
170
173
@@ -285,11 +288,9 @@ export class InlineChatWidget {
285
288
286
289
this . _elements . statusLabel . tabIndex = 0 ;
287
290
288
- this . _store . add ( this . _configurationService . onDidChangeConfiguration ( e => {
289
- if ( e . affectsConfiguration ( AccessibilityVerbositySettingId . InlineChat ) ) {
290
- // TODO@jrieken FIX THIS
291
- // this._chatWidget.ariaLabel = this._accessibleViewService.getOpenAriaHint(AccessibilityVerbositySettingId.InlineChat);
292
- this . _elements . followUps . ariaLabel = this . _accessibleViewService . getOpenAriaHint ( AccessibilityVerbositySettingId . InlineChat ) ;
291
+ this . _store . add ( this . _chatService . onDidPerformUserAction ( e => {
292
+ if ( e . sessionId === this . _chatWidget . viewModel ?. model . sessionId && e . action . kind === 'vote' ) {
293
+ this . updateStatus ( 'Thank you for your feedback!' , { resetAfter : 1250 } ) ;
293
294
}
294
295
} ) ) ;
295
296
@@ -432,6 +433,10 @@ export class InlineChatWidget {
432
433
return tail ( requests ) . response ?. response . asString ( ) ;
433
434
}
434
435
436
+ getChatModel ( ) : IChatModel {
437
+ return this . _chatWidget . viewModel ?. model ?? this . _defaultChatModel ;
438
+ }
439
+
435
440
setChatModel ( chatModel : IChatModel ) {
436
441
this . _chatWidget . setModel ( chatModel , { inputValue : undefined } ) ;
437
442
}
@@ -605,8 +610,9 @@ export class EditorBasedInlineChatWidget extends InlineChatWidget {
605
610
@IConfigurationService configurationService : IConfigurationService ,
606
611
@IAccessibleViewService accessibleViewService : IAccessibleViewService ,
607
612
@ITextModelService textModelResolverService : ITextModelService ,
613
+ @IChatService chatService : IChatService ,
608
614
) {
609
- super ( ChatAgentLocation . Editor , options , instantiationService , contextKeyService , keybindingService , accessibilityService , configurationService , accessibleViewService , textModelResolverService ) ;
615
+ super ( ChatAgentLocation . Editor , options , instantiationService , contextKeyService , keybindingService , accessibilityService , configurationService , accessibleViewService , textModelResolverService , chatService ) ;
610
616
611
617
// preview editors
612
618
this . _previewDiffEditor = new Lazy ( ( ) => this . _store . add ( instantiationService . createInstance ( EmbeddedDiffEditorWidget , this . _elements . previewDiff , {
0 commit comments