Skip to content

Commit f5d895a

Browse files
authored
VS Code Speech does not warn when no chat providers are found. (fix microsoft#203241) (microsoft#203365)
1 parent 2d2f5bd commit f5d895a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,8 @@ export class KeywordActivationContribution extends Disposable implements IWorkbe
796796
@IInstantiationService instantiationService: IInstantiationService,
797797
@ICodeEditorService private readonly codeEditorService: ICodeEditorService,
798798
@IEditorService private readonly editorService: IEditorService,
799-
@IHostService private readonly hostService: IHostService
799+
@IHostService private readonly hostService: IHostService,
800+
@IChatService private readonly chatService: IChatService
800801
) {
801802
super();
802803

@@ -811,6 +812,8 @@ export class KeywordActivationContribution extends Disposable implements IWorkbe
811812
this.handleKeywordActivation();
812813
}));
813814

815+
this._register(this.chatService.onDidRegisterProvider(() => this.updateConfiguration()));
816+
814817
this._register(this.speechService.onDidStartSpeechToTextSession(() => this.handleKeywordActivation()));
815818
this._register(this.speechService.onDidEndSpeechToTextSession(() => this.handleKeywordActivation()));
816819

@@ -826,8 +829,8 @@ export class KeywordActivationContribution extends Disposable implements IWorkbe
826829
}
827830

828831
private updateConfiguration(): void {
829-
if (!this.speechService.hasSpeechProvider) {
830-
return; // these settings require a speech provider
832+
if (!this.speechService.hasSpeechProvider || this.chatService.getProviderInfos().length === 0) {
833+
return; // these settings require a speech and chat provider
831834
}
832835

833836
const registry = Registry.as<IConfigurationRegistry>(Extensions.Configuration);

0 commit comments

Comments
 (0)