Skip to content

Commit 88c38d9

Browse files
committed
just pass in enabled
1 parent c0a289d commit 88c38d9

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsController.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class InlineCompletionsController extends Disposable {
5757
}
5858
));
5959
private readonly _enabledInConfig = observableFromEvent(this.editor.onDidChangeConfiguration, () => this.editor.getOption(EditorOption.inlineSuggest).enabled);
60-
private readonly _enabled = derived(this, reader => this._enabledInConfig.read(reader) && (!this._isScreenReaderEnabled.read(reader) || !this._editorDictationInProgress.read(reader)));
60+
private readonly _enabled = derived(this, reader => this._enabledInConfig.read(reader) && (!this._isScreenReaderEnabled.read(reader) || !this._editorDictationInProgress.read(reader)));
6161
private readonly _isScreenReaderEnabled = observableFromEvent(this._accessibilityService.onDidChangeScreenReaderOptimized, () => this._accessibilityService.isScreenReaderOptimized());
6262
private readonly _editorDictationInProgress = observableFromEvent(this._contextKeyService.onDidChangeContext, () => this._contextKeyService.getContext(this.editor.getDomNode()).getValue('editorDictation.inProgress') === true);
6363

@@ -129,9 +129,7 @@ export class InlineCompletionsController extends Disposable {
129129
observableFromEvent(editor.onDidChangeConfiguration, () => editor.getOption(EditorOption.suggest).preview),
130130
observableFromEvent(editor.onDidChangeConfiguration, () => editor.getOption(EditorOption.suggest).previewMode),
131131
observableFromEvent(editor.onDidChangeConfiguration, () => editor.getOption(EditorOption.inlineSuggest).mode),
132-
this._enabled,
133-
this._isScreenReaderEnabled,
134-
this._editorDictationInProgress
132+
this._enabled
135133
);
136134
this.model.set(model, tx);
137135
}

src/vs/editor/contrib/inlineCompletions/browser/inlineCompletionsModel.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ import { mapFindFirst } from 'vs/base/common/arraysFind';
88
import { itemsEquals } from 'vs/base/common/equals';
99
import { BugIndicatingError, onUnexpectedError, onUnexpectedExternalError } from 'vs/base/common/errors';
1010
import { Disposable } from 'vs/base/common/lifecycle';
11-
import { IObservable, IReader, ITransaction, autorun, derived, derivedHandleChanges, derivedOpts, observableSignal, observableValue, recomputeInitiallyAndOnChange, subtransaction, transaction } from 'vs/base/common/observable';
11+
import { IObservable, autorun, derived, derivedHandleChanges, derivedOpts, observableSignal, observableValue, recomputeInitiallyAndOnChange, transaction } from 'vs/base/common/observable';
1212
import { commonPrefixLength, splitLinesIncludeSeparators } from 'vs/base/common/strings';
1313
import { isDefined } from 'vs/base/common/types';
14-
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
1514
import { EditOperation } from 'vs/editor/common/core/editOperation';
1615
import { Position } from 'vs/editor/common/core/position';
1716
import { Range } from 'vs/editor/common/core/range';
@@ -60,8 +59,6 @@ export class InlineCompletionsModel extends Disposable {
6059
private readonly _suggestPreviewMode: IObservable<'prefix' | 'subword' | 'subwordSmart'>,
6160
private readonly _inlineSuggestMode: IObservable<'prefix' | 'subword' | 'subwordSmart'>,
6261
private readonly _enabled: IObservable<boolean>,
63-
private readonly _isScreenReaderEnabled: IObservable<boolean>,
64-
private readonly _editorDictationInProgress: IObservable<boolean>,
6562
@IInstantiationService private readonly _instantiationService: IInstantiationService,
6663
@ICommandService private readonly _commandService: ICommandService,
6764
@ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService,
@@ -109,7 +106,7 @@ export class InlineCompletionsModel extends Disposable {
109106
},
110107
}, (reader, changeSummary) => {
111108
this._forceUpdateExplicitlySignal.read(reader);
112-
const shouldUpdate = (this._enabled.read(reader) && (!this._isScreenReaderEnabled.read(reader) || !this._editorDictationInProgress.read(reader)) && this.selectedSuggestItem.read(reader)) || this._isActive.read(reader);
109+
const shouldUpdate = this._enabled.read(reader) && this.selectedSuggestItem.read(reader) || this._isActive.read(reader);
113110
if (!shouldUpdate) {
114111
this._source.cancelUpdate();
115112
return undefined;

0 commit comments

Comments
 (0)