提交 0f965d5b 编写于 作者: S Sandeep Somavarapu

#53442 Avoid async and winjs promise

上级 aa75fbd6
......@@ -434,7 +434,7 @@ class PreferencesRenderersController extends Disposable {
}
}
private async _onEditableContentDidChange(): TPromise<void> {
private async _onEditableContentDidChange(): Promise<void> {
await this.localFilterPreferences(this._lastQuery, true);
await this.remoteSearchPreferences(this._lastQuery, true);
}
......@@ -511,11 +511,11 @@ class PreferencesRenderersController extends Disposable {
return TPromise.join(searchPs).then(() => { });
}
private searchSettingsTarget(query: string, provider: ISearchProvider, target: SettingsTarget, groupId: string, groupLabel: string, groupOrder: number): TPromise<void> {
private searchSettingsTarget(query: string, provider: ISearchProvider, target: SettingsTarget, groupId: string, groupLabel: string, groupOrder: number): Promise<void> {
if (!query) {
// Don't open the other settings targets when query is empty
this._onDidFilterResultsCountChange.fire({ target, count: 0 });
return TPromise.wrap(null);
return Promise.resolve(null);
}
return this.getPreferencesEditorModel(target).then(model => {
......@@ -532,7 +532,7 @@ class PreferencesRenderersController extends Disposable {
});
}
private async getPreferencesEditorModel(target: SettingsTarget): TPromise<ISettingsEditorModel | null> {
private async getPreferencesEditorModel(target: SettingsTarget): Promise<ISettingsEditorModel | null> {
const resource = target === ConfigurationTarget.USER ? this.preferencesService.userSettingsResource :
target === ConfigurationTarget.WORKSPACE ? this.preferencesService.workspaceSettingsResource :
target;
......
......@@ -492,14 +492,15 @@ export class ReplaceAllInFolderAction extends AbstractSearchAndReplaceAction {
super(Constants.ReplaceAllInFolderActionId, appendKeyBindingLabel(ReplaceAllInFolderAction.LABEL, keyBindingService.lookupKeybinding(Constants.ReplaceAllInFolderActionId), keyBindingService), 'action-replace-all');
}
public async run(): TPromise<any> {
public run(): TPromise<any> {
let nextFocusElement = this.getElementToFocusAfterRemoved(this.viewer, this.folderMatch);
await this.folderMatch.replaceAll();
if (nextFocusElement) {
this.viewer.setFocus(nextFocusElement);
}
this.viewer.domFocus();
return this.folderMatch.replaceAll()
.then(() => {
if (nextFocusElement) {
this.viewer.setFocus(nextFocusElement);
}
this.viewer.domFocus();
});
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册