Skip to content

Commit 120fe2e

Browse files
committed
debt - less WinJS.Promise usage
1 parent a3026ef commit 120fe2e

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

src/vs/workbench/parts/performance/electron-browser/actions.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
'use strict';
77

8-
import { TPromise } from 'vs/base/common/winjs.base';
98
import { Action } from 'vs/base/common/actions';
109
import { IWindowService } from 'vs/platform/windows/common/windows';
1110
import * as nls from 'vs/nls';
@@ -25,7 +24,6 @@ import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
2524
import { forEach } from 'vs/base/common/collections';
2625
import { mergeSort } from 'vs/base/common/arrays';
2726

28-
2927
class Info {
3028

3129
static getTimerInfo(metrics: IStartupMetrics, nodeModuleLoadTime?: number): { [name: string]: Info } {
@@ -158,7 +156,7 @@ export class ShowStartupPerformance extends Action {
158156
super(id, label);
159157
}
160158

161-
run(): TPromise<boolean> {
159+
run(): Promise<boolean> {
162160

163161
// Show dev tools
164162
this.windowService.openDevTools();
@@ -217,7 +215,7 @@ export class ShowStartupPerformance extends Action {
217215
console.groupEnd();
218216
});
219217

220-
return TPromise.as(true);
218+
return Promise.resolve(true);
221219
}
222220
}
223221

@@ -238,7 +236,7 @@ export class ReportPerformanceIssueAction extends Action {
238236
super(id, label);
239237
}
240238

241-
run(appendix?: string): TPromise<boolean> {
239+
run(appendix?: string): Promise<boolean> {
242240
Promise.all([
243241
this.timerService.startupMetrics,
244242
this.integrityService.isPure()
@@ -248,7 +246,7 @@ export class ReportPerformanceIssueAction extends Action {
248246
window.open(issueUrl);
249247
});
250248

251-
return TPromise.wrap(true);
249+
return Promise.resolve(true);
252250
}
253251

254252
private generatePerformanceIssueUrl(metrics: IStartupMetrics, baseUrl: string, name: string, version: string, _commit: string, _date: string, isPure: boolean, appendix?: string): string {

src/vs/workbench/parts/performance/electron-browser/startupProfiler.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import { dirname, join } from 'path';
99
import { basename } from 'vs/base/common/paths';
10-
import { TPromise } from 'vs/base/common/winjs.base';
1110
import { del, exists, readdir, readFile } from 'vs/base/node/pfs';
1211
import { localize } from 'vs/nls';
1312
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
@@ -80,7 +79,7 @@ class StartupProfiler implements IWorkbenchContribution {
8079
}).then(res => {
8180
if (res.confirmed) {
8281
const action = this._instantiationService.createInstance(ReportPerformanceIssueAction, ReportPerformanceIssueAction.ID, ReportPerformanceIssueAction.LABEL);
83-
TPromise.join<any>([
82+
Promise.all<any>([
8483
this._windowsService.showItemInFolder(join(dir, files[0])),
8584
action.run(`:warning: Make sure to **attach** these files from your *home*-directory: :warning:\n${files.map(file => `-\`${file}\``).join('\n')}`)
8685
]).then(() => {

0 commit comments

Comments
 (0)