Skip to content

Commit cb807ec

Browse files
Fix a few property call patterns (#243109)
ref #243049
1 parent 2c19ac0 commit cb807ec

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

src/vs/platform/quickinput/browser/quickInputController.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ import { Disposable, DisposableStore, dispose } from '../../../base/common/lifec
1717
import Severity from '../../../base/common/severity.js';
1818
import { isString } from '../../../base/common/types.js';
1919
import { localize } from '../../../nls.js';
20-
import { IInputBox, IInputOptions, IKeyMods, IPickOptions, IQuickInput, IQuickInputButton, IQuickNavigateConfiguration, IQuickPick, IQuickPickItem, IQuickWidget, QuickInputHideReason, QuickPickInput, QuickPickFocus } from '../common/quickInput.js';
20+
import { IInputBox, IInputOptions, IKeyMods, IPickOptions, IQuickInput, IQuickInputButton, IQuickNavigateConfiguration, IQuickPick, IQuickPickItem, IQuickWidget, QuickInputHideReason, QuickPickInput, QuickPickFocus, QuickInputType } from '../common/quickInput.js';
2121
import { QuickInputBox } from './quickInputBox.js';
2222
import { QuickInputUI, Writeable, IQuickInputStyles, IQuickInputOptions, QuickPick, backButton, InputBox, Visibilities, QuickWidget, InQuickInputContextKey, QuickInputTypeContextKey, EndOfQuickInputBoxContextKey, QuickInputAlignmentContextKey } from './quickInput.js';
2323
import { ILayoutService } from '../../layout/browser/layoutService.js';
2424
import { mainWindow } from '../../../base/browser/window.js';
2525
import { IInstantiationService } from '../../instantiation/common/instantiation.js';
2626
import { QuickInputTree } from './quickInputTree.js';
27-
import { IContextKeyService } from '../../contextkey/common/contextkey.js';
27+
import { IContextKey, IContextKeyService } from '../../contextkey/common/contextkey.js';
2828
import './quickInputActions.js';
2929
import { autorun, observableValue } from '../../../base/common/observable.js';
3030
import { StandardMouseEvent } from '../../../base/browser/mouseEvent.js';
@@ -75,18 +75,23 @@ export class QuickInputController extends Disposable {
7575
private viewState: QuickInputViewState | undefined;
7676
private dndController: QuickInputDragAndDropController | undefined;
7777

78-
private readonly inQuickInputContext = InQuickInputContextKey.bindTo(this.contextKeyService);
79-
private readonly quickInputTypeContext = QuickInputTypeContextKey.bindTo(this.contextKeyService);
80-
private readonly endOfQuickInputBoxContext = EndOfQuickInputBoxContextKey.bindTo(this.contextKeyService);
78+
private readonly inQuickInputContext: IContextKey<boolean>;
79+
private readonly quickInputTypeContext: IContextKey<QuickInputType>;
80+
private readonly endOfQuickInputBoxContext: IContextKey<boolean>;
8181

8282
constructor(
8383
private options: IQuickInputOptions,
8484
@ILayoutService private readonly layoutService: ILayoutService,
8585
@IInstantiationService private readonly instantiationService: IInstantiationService,
86-
@IContextKeyService private readonly contextKeyService: IContextKeyService,
86+
@IContextKeyService contextKeyService: IContextKeyService,
8787
@IStorageService private readonly storageService: IStorageService
8888
) {
8989
super();
90+
91+
this.inQuickInputContext = InQuickInputContextKey.bindTo(contextKeyService);
92+
this.quickInputTypeContext = QuickInputTypeContextKey.bindTo(contextKeyService);
93+
this.endOfQuickInputBoxContext = EndOfQuickInputBoxContextKey.bindTo(contextKeyService);
94+
9095
this.idPrefix = options.idPrefix;
9196
this._container = options.container;
9297
this.styles = options.styles;
@@ -911,18 +916,19 @@ class QuickInputDragAndDropController extends Disposable {
911916
private readonly _controlsOnLeft: boolean;
912917
private readonly _controlsOnRight: boolean;
913918

914-
private _quickInputAlignmentContext = QuickInputAlignmentContextKey.bindTo(this._contextKeyService);
919+
private _quickInputAlignmentContext: IContextKey<'center' | 'top' | undefined>;
915920

916921
constructor(
917922
private _container: HTMLElement,
918923
private readonly _quickInputContainer: HTMLElement,
919924
private _quickInputDragAreas: { node: HTMLElement; includeChildren: boolean }[],
920925
initialViewState: QuickInputViewState | undefined,
921926
@ILayoutService private readonly _layoutService: ILayoutService,
922-
@IContextKeyService private readonly _contextKeyService: IContextKeyService,
927+
@IContextKeyService contextKeyService: IContextKeyService,
923928
@IConfigurationService private readonly configurationService: IConfigurationService
924929
) {
925930
super();
931+
this._quickInputAlignmentContext = QuickInputAlignmentContextKey.bindTo(contextKeyService);
926932
const customWindowControls = getWindowControlsStyle(this.configurationService) === WindowControlsStyle.CUSTOM;
927933

928934
// Do not allow the widget to overflow or underflow window controls.

src/vs/workbench/services/authentication/browser/authenticationExtensionsService.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,8 @@ export class AuthenticationExtensionsService extends Disposable implements IAuth
4242
private _onDidAccountPreferenceChange: Emitter<{ providerId: string; extensionIds: string[] }> = this._register(new Emitter<{ providerId: string; extensionIds: string[] }>());
4343
readonly onDidChangeAccountPreference = this._onDidAccountPreferenceChange.event;
4444

45-
private _inheritAuthAccountPreferenceParentToChildren: Record<string, string[]> = this._productService.inheritAuthAccountPreference || {};
46-
private _inheritAuthAccountPreferenceChildToParent = Object.entries(this._inheritAuthAccountPreferenceParentToChildren).reduce<{ [extensionId: string]: string }>((acc, [parent, children]) => {
47-
children.forEach((child: string) => {
48-
acc[child] = parent;
49-
});
50-
return acc;
51-
}, {});
45+
private _inheritAuthAccountPreferenceParentToChildren: Record<string, string[]>;
46+
private _inheritAuthAccountPreferenceChildToParent: { [extensionId: string]: string };
5247

5348
constructor(
5449
@IActivityService private readonly activityService: IActivityService,
@@ -61,6 +56,13 @@ export class AuthenticationExtensionsService extends Disposable implements IAuth
6156
@IAuthenticationAccessService private readonly _authenticationAccessService: IAuthenticationAccessService
6257
) {
6358
super();
59+
this._inheritAuthAccountPreferenceParentToChildren = this._productService.inheritAuthAccountPreference || {};
60+
this._inheritAuthAccountPreferenceChildToParent = Object.entries(this._inheritAuthAccountPreferenceParentToChildren).reduce<{ [extensionId: string]: string }>((acc, [parent, children]) => {
61+
children.forEach((child: string) => {
62+
acc[child] = parent;
63+
});
64+
return acc;
65+
}, {});
6466
this.registerListeners();
6567
}
6668

0 commit comments

Comments
 (0)