@@ -29,6 +29,7 @@ import { IModelService } from 'vs/editor/common/services/model';
29
29
import { ITextModelService } from 'vs/editor/common/services/resolverService' ;
30
30
import { InlineCompletionsController } from 'vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController' ;
31
31
import { localize } from 'vs/nls' ;
32
+ import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility' ;
32
33
import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
33
34
import { IContextKey , IContextKeyService } from 'vs/platform/contextkey/common/contextkey' ;
34
35
import { IInstantiationService , ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' ;
@@ -163,6 +164,7 @@ export class InteractiveEditorController implements IEditorContribution {
163
164
@ITextModelService private readonly _textModelService : ITextModelService ,
164
165
@INotebookEditorService private readonly _notebookEditorService : INotebookEditorService ,
165
166
@IContextKeyService contextKeyService : IContextKeyService ,
167
+ @IAccessibilityService private readonly _accessibilityService : IAccessibilityService
166
168
167
169
) {
168
170
this . _ctxHasActiveRequest = CTX_INTERACTIVE_EDITOR_HAS_ACTIVE_REQUEST . bindTo ( contextKeyService ) ;
@@ -182,7 +184,14 @@ export class InteractiveEditorController implements IEditorContribution {
182
184
}
183
185
184
186
private _getMode ( ) : EditMode {
185
- return this . _configurationService . getValue ( 'interactiveEditor.editMode' ) ;
187
+ let editMode : EditMode = this . _configurationService . getValue ( 'interactiveEditor.editMode' ) ;
188
+ const isDefault = editMode === EditMode . LivePreview ;
189
+ if ( this . _accessibilityService . isScreenReaderOptimized ( ) && isDefault ) {
190
+ // By default, use preview mode for screen reader users
191
+ editMode = EditMode . Preview ;
192
+ this . _configurationService . updateValue ( 'interactiveEditor.editMode' , EditMode . Preview ) ;
193
+ }
194
+ return editMode ;
186
195
}
187
196
188
197
private get _activeSession ( ) : Session | undefined {
0 commit comments