File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/vs/workbench/contrib/chat/electron-sandbox/actions Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -796,7 +796,8 @@ export class KeywordActivationContribution extends Disposable implements IWorkbe
796
796
@IInstantiationService instantiationService : IInstantiationService ,
797
797
@ICodeEditorService private readonly codeEditorService : ICodeEditorService ,
798
798
@IEditorService private readonly editorService : IEditorService ,
799
- @IHostService private readonly hostService : IHostService
799
+ @IHostService private readonly hostService : IHostService ,
800
+ @IChatService private readonly chatService : IChatService
800
801
) {
801
802
super ( ) ;
802
803
@@ -811,6 +812,8 @@ export class KeywordActivationContribution extends Disposable implements IWorkbe
811
812
this . handleKeywordActivation ( ) ;
812
813
} ) ) ;
813
814
815
+ this . _register ( this . chatService . onDidRegisterProvider ( ( ) => this . updateConfiguration ( ) ) ) ;
816
+
814
817
this . _register ( this . speechService . onDidStartSpeechToTextSession ( ( ) => this . handleKeywordActivation ( ) ) ) ;
815
818
this . _register ( this . speechService . onDidEndSpeechToTextSession ( ( ) => this . handleKeywordActivation ( ) ) ) ;
816
819
@@ -826,8 +829,8 @@ export class KeywordActivationContribution extends Disposable implements IWorkbe
826
829
}
827
830
828
831
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
831
834
}
832
835
833
836
const registry = Registry . as < IConfigurationRegistry > ( Extensions . Configuration ) ;
You can’t perform that action at this time.
0 commit comments