Skip to content

Commit 4666f7d

Browse files
author
Benjamin Pasero
committed
"let's agree to one file, one style" (microsoft#5536)
1 parent a085dab commit 4666f7d

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

src/vs/workbench/services/lifecycle/electron-browser/lifecycleService.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ export class LifecycleService implements ILifecycleService {
2121
private _onShutdown = new Emitter<void>();
2222

2323
constructor(
24-
private _messageService: IMessageService,
24+
private messageService: IMessageService,
2525
private windowService: IWindowService
2626
) {
27-
this._registerListeners();
27+
this.registerListeners();
2828
}
2929

3030
public get onWillShutdown(): Event<ShutdownEvent> {
@@ -35,14 +35,12 @@ export class LifecycleService implements ILifecycleService {
3535
return this._onShutdown.event;
3636
}
3737

38-
private _registerListeners(): void {
39-
38+
private registerListeners(): void {
4039
const windowId = this.windowService.getWindowId();
4140

4241
// Main side indicates that window is about to unload, check for vetos
4342
ipc.on('vscode:beforeUnload', (event, reply: { okChannel: string, cancelChannel: string }) => {
44-
45-
this._onBeforeUnload().done(veto => {
43+
this.onBeforeUnload().done(veto => {
4644
if (veto) {
4745
ipc.send(reply.cancelChannel, windowId);
4846
} else {
@@ -53,8 +51,7 @@ export class LifecycleService implements ILifecycleService {
5351
});
5452
}
5553

56-
private _onBeforeUnload(): TPromise<boolean> {
57-
54+
private onBeforeUnload(): TPromise<boolean> {
5855
const vetos: (boolean | TPromise<boolean>)[] = [];
5956

6057
this._onWillShutdown.fire({
@@ -80,12 +77,11 @@ export class LifecycleService implements ILifecycleService {
8077
if (TPromise.is(valueOrPromise)) {
8178
promises.push(valueOrPromise.then(value => {
8279
if (value) {
83-
// veto, done
84-
lazyValue = true;
80+
lazyValue = true; // veto, done
8581
}
8682
}, err => {
8783
// error, treated like a veto, done
88-
this._messageService.show(Severity.Error, errors.toErrorMessage(err));
84+
this.messageService.show(Severity.Error, errors.toErrorMessage(err));
8985
lazyValue = true;
9086
}));
9187
}

0 commit comments

Comments
 (0)