提交 e30a954d 编写于 作者: J Johannes Rieken

debt - less WinJS.Promise#done usage, #57695

上级 5c9d1c4c
......@@ -4,10 +4,10 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { basename, dirname, join } from 'path';
import { onUnexpectedError } from 'vs/base/common/errors';
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
import { TPromise } from 'vs/base/common/winjs.base';
import { join, basename, dirname } from 'path';
import { readdir, rimraf, stat } from 'vs/base/node/pfs';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import product from 'vs/platform/node/product';
......@@ -74,7 +74,7 @@ export class NodeCachedDataCleaner {
return TPromise.join(deletes);
}).done(undefined, onUnexpectedError);
}).then(undefined, onUnexpectedError);
}, 30 * 1000);
......
......@@ -274,9 +274,9 @@ class Controller extends WorkbenchTreeController {
private _expandCollapse(tree: tree.ITree, element: any): boolean {
if (tree.isExpanded(element)) {
tree.collapse(element).done(null, onUnexpectedError);
tree.collapse(element).then(null, onUnexpectedError);
} else {
tree.expand(element).done(null, onUnexpectedError);
tree.expand(element).then(null, onUnexpectedError);
}
return true;
}
......
......@@ -239,7 +239,7 @@ export class SuggestController implements IEditorContribution {
} else {
// exec command, done
this._commandService.executeCommand(suggestion.command.id, ...suggestion.command.arguments).done(undefined, onUnexpectedError);
this._commandService.executeCommand(suggestion.command.id, ...suggestion.command.arguments).then(undefined, onUnexpectedError);
this._model.cancel();
}
......
......@@ -5,19 +5,19 @@
'use strict';
import { localize } from 'vs/nls';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IMenu, MenuItemAction, IMenuActionOptions, ICommandAction, SubmenuItemAction } from 'vs/platform/actions/common/actions';
import { IAction } from 'vs/base/common/actions';
import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle';
import { ActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar';
import { addClasses, createCSSRule, removeClasses } from 'vs/base/browser/dom';
import { domEvent } from 'vs/base/browser/event';
import { ActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar';
import { IAction } from 'vs/base/common/actions';
import { Emitter } from 'vs/base/common/event';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IdGenerator } from 'vs/base/common/idGenerator';
import { createCSSRule, addClasses, removeClasses } from 'vs/base/browser/dom';
import { dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { isLinux, isWindows } from 'vs/base/common/platform';
import { localize } from 'vs/nls';
import { ICommandAction, IMenu, IMenuActionOptions, MenuItemAction, SubmenuItemAction } from 'vs/platform/actions/common/actions';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { isWindows, isLinux } from 'vs/base/common/platform';
// The alternative key on all platforms is alt. On windows we also support shift as an alternative key #44136
class AlternativeKeyEmitter extends Emitter<boolean> {
......@@ -177,7 +177,7 @@ export class MenuItemActionItem extends ActionItem {
}
this.actionRunner.run(this._commandAction)
.done(undefined, err => this._notificationService.error(err));
.then(undefined, err => this._notificationService.error(err));
}
render(container: HTMLElement): void {
......@@ -284,6 +284,6 @@ export class ContextAwareMenuItemActionItem extends MenuItemActionItem {
event.stopPropagation();
this.actionRunner.run(this._commandAction, this._context)
.done(undefined, err => this._notificationService.error(err));
.then(undefined, err => this._notificationService.error(err));
}
}
......@@ -168,7 +168,7 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape {
this._activeSearches[requestId] = search;
const onDone = () => delete this._activeSearches[requestId];
search.done(onDone, onDone);
search.then(onDone, onDone);
return search;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册