Skip to content

Commit 9e68f21

Browse files
author
Benjamin Pasero
committed
debt - a bit of strictPropertyInitialization (microsoft#78168)
1 parent 84d62bb commit 9e68f21

61 files changed

Lines changed: 175 additions & 172 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/vs/base/browser/ui/dropdown/dropdown.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class BaseDropdown extends ActionRunner {
2929
private boxContainer?: HTMLElement;
3030
private _label?: HTMLElement;
3131
private contents?: HTMLElement;
32-
private visible: boolean;
32+
private visible: boolean | undefined;
3333

3434
constructor(container: HTMLElement, options: IBaseDropdownOptions) {
3535
super();
@@ -109,7 +109,7 @@ export class BaseDropdown extends ActionRunner {
109109
}
110110

111111
isVisible(): boolean {
112-
return this.visible;
112+
return !!this.visible;
113113
}
114114

115115
protected onEvent(e: Event, activeElement: HTMLElement): void {
@@ -272,7 +272,7 @@ export class DropdownMenu extends BaseDropdown {
272272

273273
export class DropdownMenuActionViewItem extends BaseActionViewItem {
274274
private menuActionsOrProvider: any;
275-
private dropdownMenu: DropdownMenu;
275+
private dropdownMenu: DropdownMenu | undefined;
276276
private contextMenuProvider: IContextMenuProvider;
277277
private actionViewItemProvider?: IActionViewItemProvider;
278278
private keybindings?: (action: IAction) => ResolvedKeybinding | undefined;
@@ -281,7 +281,7 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem {
281281

282282
constructor(action: IAction, menuActions: ReadonlyArray<IAction>, contextMenuProvider: IContextMenuProvider, actionViewItemProvider: IActionViewItemProvider | undefined, actionRunner: IActionRunner, keybindings: ((action: IAction) => ResolvedKeybinding | undefined) | undefined, clazz: string | undefined, anchorAlignmentProvider?: () => AnchorAlignment);
283283
constructor(action: IAction, actionProvider: IActionProvider, contextMenuProvider: IContextMenuProvider, actionViewItemProvider: IActionViewItemProvider | undefined, actionRunner: IActionRunner, keybindings: ((action: IAction) => ResolvedKeybinding) | undefined, clazz: string | undefined, anchorAlignmentProvider?: () => AnchorAlignment);
284-
constructor(action: IAction, menuActionsOrProvider: any, contextMenuProvider: IContextMenuProvider, actionViewItemProvider: IActionViewItemProvider | undefined, actionRunner: IActionRunner, keybindings: ((action: IAction) => ResolvedKeybinding | undefined) | undefined, clazz: string | undefined, anchorAlignmentProvider?: () => AnchorAlignment) {
284+
constructor(action: IAction, menuActionsOrProvider: ReadonlyArray<IAction> | IActionProvider, contextMenuProvider: IContextMenuProvider, actionViewItemProvider: IActionViewItemProvider | undefined, actionRunner: IActionRunner, keybindings: ((action: IAction) => ResolvedKeybinding | undefined) | undefined, clazz: string | undefined, anchorAlignmentProvider?: () => AnchorAlignment) {
285285
super(null, action);
286286

287287
this.menuActionsOrProvider = menuActionsOrProvider;

src/vs/platform/clipboard/browser/clipboardService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiatio
1010

1111
export class BrowserClipboardService implements IClipboardService {
1212

13-
_serviceBrand: ServiceIdentifier<IClipboardService>;
13+
_serviceBrand!: ServiceIdentifier<IClipboardService>;
1414

1515
private _internalResourcesClipboard: URI[] | undefined;
1616

@@ -46,4 +46,4 @@ export class BrowserClipboardService implements IClipboardService {
4646
}
4747
}
4848

49-
registerSingleton(IClipboardService, BrowserClipboardService, true);
49+
registerSingleton(IClipboardService, BrowserClipboardService, true);

src/vs/platform/history/electron-main/historyMainService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class HistoryMainService implements IHistoryMainService {
4040

4141
private static readonly recentlyOpenedStorageKey = 'openedPathsList';
4242

43-
_serviceBrand: ServiceIdentifier<IHistoryMainService>;
43+
_serviceBrand!: ServiceIdentifier<IHistoryMainService>;
4444

4545
private _onRecentlyOpenedChange = new Emitter<void>();
4646
readonly onRecentlyOpenedChange: CommonEvent<void> = this._onRecentlyOpenedChange.event;
@@ -387,4 +387,4 @@ function indexOfFolder(arr: IRecent[], folderURI: ISingleFolderWorkspaceIdentifi
387387

388388
function indexOfFile(arr: IRecentFile[], fileURI: URI): number {
389389
return arrays.firstIndex(arr, f => areResourcesEqual(f.fileUri, fileURI));
390-
}
390+
}

src/vs/platform/ipc/electron-browser/mainProcessService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface IMainProcessService {
2121

2222
export class MainProcessService extends Disposable implements IMainProcessService {
2323

24-
_serviceBrand: ServiceIdentifier<any>;
24+
_serviceBrand!: ServiceIdentifier<any>;
2525

2626
private mainProcessConnection: Client;
2727

@@ -40,4 +40,4 @@ export class MainProcessService extends Disposable implements IMainProcessServic
4040
registerChannel(channelName: string, channel: IServerChannel<string>): void {
4141
this.mainProcessConnection.registerChannel(channelName, channel);
4242
}
43-
}
43+
}

src/vs/platform/ipc/electron-browser/sharedProcessService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface ISharedProcessService {
2323

2424
export class SharedProcessService implements ISharedProcessService {
2525

26-
_serviceBrand: ServiceIdentifier<any>;
26+
_serviceBrand!: ServiceIdentifier<any>;
2727

2828
private withSharedProcessConnection: Promise<Client<string>>;
2929

@@ -43,4 +43,4 @@ export class SharedProcessService implements ISharedProcessService {
4343
registerChannel(channelName: string, channel: IServerChannel<string>): void {
4444
this.withSharedProcessConnection.then(connection => connection.registerChannel(channelName, channel));
4545
}
46-
}
46+
}

src/vs/platform/issue/electron-browser/issueService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiatio
1010

1111
export class IssueService implements IIssueService {
1212

13-
_serviceBrand: ServiceIdentifier<any>;
13+
_serviceBrand!: ServiceIdentifier<any>;
1414

1515
private channel: IChannel;
1616

@@ -29,4 +29,4 @@ export class IssueService implements IIssueService {
2929
getSystemStatus(): Promise<string> {
3030
return this.channel.call('getSystemStatus');
3131
}
32-
}
32+
}

src/vs/platform/launch/electron-main/launchService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class LaunchChannel implements IServerChannel {
9494

9595
export class LaunchChannelClient implements ILaunchService {
9696

97-
_serviceBrand: ServiceIdentifier<ILaunchService>;
97+
_serviceBrand!: ServiceIdentifier<ILaunchService>;
9898

9999
constructor(private channel: IChannel) { }
100100

@@ -121,7 +121,7 @@ export class LaunchChannelClient implements ILaunchService {
121121

122122
export class LaunchService implements ILaunchService {
123123

124-
_serviceBrand: ServiceIdentifier<ILaunchService>;
124+
_serviceBrand!: ServiceIdentifier<ILaunchService>;
125125

126126
constructor(
127127
@ILogService private readonly logService: ILogService,

src/vs/platform/lifecycle/browser/lifecycleService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiatio
1111

1212
export class BrowserLifecycleService extends AbstractLifecycleService {
1313

14-
_serviceBrand: ServiceIdentifier<ILifecycleService>;
14+
_serviceBrand!: ServiceIdentifier<ILifecycleService>;
1515

1616
constructor(
1717
@ILogService readonly logService: ILogService
@@ -56,4 +56,4 @@ export class BrowserLifecycleService extends AbstractLifecycleService {
5656

5757
return null;
5858
}
59-
}
59+
}

src/vs/platform/lifecycle/common/lifecycleService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiatio
1313

1414
export abstract class AbstractLifecycleService extends Disposable implements ILifecycleService {
1515

16-
_serviceBrand: ServiceIdentifier<ILifecycleService>;
16+
_serviceBrand!: ServiceIdentifier<ILifecycleService>;
1717

1818
protected readonly _onBeforeShutdown = this._register(new Emitter<BeforeShutdownEvent>());
1919
readonly onBeforeShutdown: Event<BeforeShutdownEvent> = this._onBeforeShutdown.event;
@@ -72,4 +72,4 @@ export abstract class AbstractLifecycleService extends Disposable implements ILi
7272

7373
await barrier.wait();
7474
}
75-
}
75+
}

src/vs/platform/lifecycle/electron-browser/lifecycleService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class LifecycleService extends AbstractLifecycleService {
1818

1919
private static readonly LAST_SHUTDOWN_REASON_KEY = 'lifecyle.lastShutdownReason';
2020

21-
_serviceBrand: ServiceIdentifier<ILifecycleService>;
21+
_serviceBrand!: ServiceIdentifier<ILifecycleService>;
2222

2323
private shutdownReason: ShutdownReason;
2424

0 commit comments

Comments
 (0)