Skip to content

Replace WinJS.Promise.join with Promise.all #64598

@jrieken

Description

@jrieken

Time to finish to tackle the last WinJS.Promise usages. Please use all instead of join. ❗️ be aware of runtime differences even for promises that created via these factory functions.

@bpasero

src/vs/workbench/test/workbenchTestServices.ts
  811,19:		return TPromise.join(toResolve.map(resourceAndOption => this.resolveFile(resourceAndOption.resource, resourceAndOption.options))).then(stats => stats.map(stat => ({ stat, success: true })));

@bpasero

src/vs/workbench/services/textfile/test/textFileEditorModel.test.ts
  410,19:		return TPromise.join([firstRes, secondRes, thirdRes]).then(() => {

@bpasero

src/vs/workbench/services/textfile/common/textFileService.ts
  793,24:					return TPromise.join(dirtyTargetModels.map(dirtyTargetModel => this.backupFileService.discardResourceBackup(dirtyTargetModel)))
  789,24:					return TPromise.join(dirtyTargetModels.map(dirtyTargetModel => this.models.loadOrCreate(dirtyTargetModel))).then(() => void 0);
  755,41:handleDirtySourceModels = TPromise.join(dirtySourceModels.map(sourceModel => {
  739,19:		return TPromise.join(waitForPromises).then(() => {
  676,19:		return TPromise.join(fileModels.map(model => {
  501,19:		return TPromise.join(dirtyFileModels.map(model => {
  478,20:			return TPromise.join(untitledSaveAsPromises).then(() => {
  247,21:				return TPromise.join(untitledBackupPromises).then(() => void 0);
  242,20:			return TPromise.join(untitledModelPromises).then(untitledModels => {
  235,19:		return TPromise.join(dirtyFileModels.map(model => this.backupFileService.backupResource(model.getResource(), model.createSnapshot(), model.getVersionId()))).then(results => {

@bpasero

src/vs/workbench/services/editor/browser/editorService.ts
  369,19:		return TPromise.join(result);

@Tyriar

src/vs/workbench/services/backup/node/backupFileService.ts
  209,20:			return TPromise.join(readPromises);
  58,20:			return TPromise.join(backupSchemas.map(backupSchema => {

@chrmarti

src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts
  484,16:						TPromise.join(extensionSuggestion.isKeymap ? extensions.filter(extension => isKeymapExtension(this.tipsService, extension) && extension.globallyEnabled)

@alexr00

src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts
  2318,26:let entries = TPromise.join(stats).then((stats) => {
  1527,20:			return TPromise.join(promises).then((values) => {
  1332,19:		return TPromise.join([this.extensionService.activateByEvent('onCommand:workbench.action.tasks.runTask'), TaskDefinitionRegistry.onReady()]).then(() => {

@roblourens @ramya-rao-a

src/vs/workbench/parts/experiments/test/electron-browser/experimentService.test.ts
  731,19:		return TPromise.join([custom, prompt]);
  644,19:		return TPromise.join(tests).then(results => {
  557,19:		return TPromise.join([disabledExperiment, deletedExperiment]).then(() => {
  133,19:		return TPromise.join(tests).then(results => {

@roblourens @ramya-rao-a

src/vs/workbench/parts/experiments/node/experimentService.ts
  274,20:			return TPromise.join(promises).then(() => {

@bpasero

src/vs/code/node/cliProcessMain.ts
  262,19:		return TPromise.join([envService.appSettingsHome, envService.extensionsPath].map(p => mkdirp(p))).then(() => {

@bpasero

src/vs/code/electron-main/app.ts
  488,12:		TPromise.join(windows.map(window => window.ready())).then(() => {

@jrieken

src/vs/base/common/winjs.polyfill.promise.ts
  26,43:PolyfillPromise(WinJSPromise.join(thenables).then(null, values => {

@jrieken

src/vs/base/common/winjs.base.d.ts
  24,16:	public static join<T>(promises: (T | PromiseLike<T>)[]): Promise<T[]>;
  23,16:	public static join<T1, T2>(promises: [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]): Promise<[T1, T2]>;

Metadata

Metadata

Labels

debtCode quality issuesengineeringVS Code - Build / issue tracking / etc.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions