@@ -57,8 +57,10 @@ export class InlineCompletionsController extends Disposable {
57
57
}
58
58
) ) ;
59
59
private readonly _enabled = observableFromEvent ( this . editor . onDidChangeConfiguration , ( ) => this . editor . getOption ( EditorOption . inlineSuggest ) . enabled ) ;
60
- private readonly _enabledForScreenReader = observableFromEvent ( this . _accessibilityService . onDidChangeScreenReaderOptimized , ( ) => ! this . _accessibilityService . isScreenReaderOptimized ( ) || this . _contextKeyService . getContextKeyValue ( 'voiceChatInProgress' ) === false ) ;
61
- private readonly _isEnabled = this . _enabled . get ( ) && this . _enabledForScreenReader . get ( ) ;
60
+ private readonly _isScreenReaderEnabled = observableFromEvent ( this . _accessibilityService . onDidChangeScreenReaderOptimized , ( ) => this . _accessibilityService . isScreenReaderOptimized ( ) ) ;
61
+ private readonly _voiceChatInProgress = observableFromEvent ( this . _contextKeyService . onDidChangeContext , ( ) => this . _contextKeyService . getContext ( this . editor . getDomNode ( ) ) . getValue ( 'voiceChatInProgress' ) === true ) ;
62
+
63
+ private readonly _isEnabled = this . _enabled . get ( ) && ( ! this . _isScreenReaderEnabled . get ( ) || ! this . _voiceChatInProgress . get ( ) ) ;
62
64
63
65
private readonly _fontFamily = observableFromEvent ( this . editor . onDidChangeConfiguration , ( ) => this . editor . getOption ( EditorOption . inlineSuggest ) . fontFamily ) ;
64
66
@@ -125,7 +127,8 @@ export class InlineCompletionsController extends Disposable {
125
127
observableFromEvent ( editor . onDidChangeConfiguration , ( ) => editor . getOption ( EditorOption . suggest ) . previewMode ) ,
126
128
observableFromEvent ( editor . onDidChangeConfiguration , ( ) => editor . getOption ( EditorOption . inlineSuggest ) . mode ) ,
127
129
this . _enabled ,
128
- this . _enabledForScreenReader
130
+ this . _isScreenReaderEnabled ,
131
+ this . _voiceChatInProgress
129
132
) ;
130
133
this . model . set ( model , tx ) ;
131
134
}
@@ -165,6 +168,7 @@ export class InlineCompletionsController extends Disposable {
165
168
this . _register ( editor . onDidType ( ( ) => transaction ( tx => {
166
169
/** @description InlineCompletionsController.onDidType */
167
170
this . updateObservables ( tx , VersionIdChangeReason . Other ) ;
171
+ console . log ( 'enabled' , this . _isEnabled ) ;
168
172
if ( this . _isEnabled ) {
169
173
this . model . get ( ) ?. trigger ( tx ) ;
170
174
}
0 commit comments