diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 00111f5fc8a..2d29266d818 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -1661,7 +1661,7 @@ declare module 'vscode' { * @return A human readable string which is presented as diagnostic message. * Return `undefined`, `null`, or the empty string when 'value' is valid. */ - validateInput?(value: string): string | undefined | null; + validateInput?(value: string): string | undefined | null | Thenable; } /** diff --git a/src/vs/workbench/api/node/extHostQuickOpen.ts b/src/vs/workbench/api/node/extHostQuickOpen.ts index 75acd008704..3f68011720b 100644 --- a/src/vs/workbench/api/node/extHostQuickOpen.ts +++ b/src/vs/workbench/api/node/extHostQuickOpen.ts @@ -5,7 +5,7 @@ 'use strict'; import { TPromise } from 'vs/base/common/winjs.base'; -import { wireCancellationToken } from 'vs/base/common/async'; +import { wireCancellationToken, asWinJsPromise } from 'vs/base/common/async'; import { CancellationToken } from 'vs/base/common/cancellation'; import { QuickPickOptions, QuickPickItem, InputBoxOptions, WorkspaceFolderPickOptions, WorkspaceFolder } from 'vscode'; import { MainContext, MainThreadQuickOpenShape, ExtHostQuickOpenShape, MyQuickPickItems, IMainContext } from './extHost.protocol'; @@ -21,7 +21,7 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape { private _commands: ExtHostCommands; private _onDidSelectItem: (handle: number) => void; - private _validateInput: (input: string) => string; + private _validateInput: (input: string) => string | Thenable; constructor(mainContext: IMainContext, workspace: ExtHostWorkspace, commands: ExtHostCommands) { this._proxy = mainContext.get(MainContext.MainThreadQuickOpen); @@ -120,7 +120,7 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape { $validateInput(input: string): TPromise { if (this._validateInput) { - return TPromise.as(this._validateInput(input)); + return asWinJsPromise(_ => this._validateInput(input)); } return undefined; }