提交 273b6974 编写于 作者: J Johannes Rieken

debt - remove TPromise from ExtHostQuickOpenShape#$validateInput

上级 4631bf96
......@@ -116,7 +116,7 @@ export interface IInputOptions {
/**
* an optional function that is used to validate user input.
*/
validateInput?: (input: string) => TPromise<string>;
validateInput?: (input: string) => Thenable<string>;
}
export interface IQuickInput {
......
......@@ -854,7 +854,7 @@ export interface ExtHostLanguageFeaturesShape {
export interface ExtHostQuickOpenShape {
$onItemSelected(handle: number): void;
$validateInput(input: string): TPromise<string>;
$validateInput(input: string): Thenable<string>;
$onDidChangeActive(sessionId: number, handles: number[]): void;
$onDidChangeSelection(sessionId: number, handles: number[]): void;
$onDidAccept(sessionId: number): void;
......
......@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import { asWinJsPromise, wireCancellationToken } from 'vs/base/common/async';
import { wireCancellationToken, asThenable } from 'vs/base/common/async';
import { CancellationToken } from 'vs/base/common/cancellation';
import { Emitter } from 'vs/base/common/event';
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
......@@ -134,9 +134,9 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape {
return wireCancellationToken(token, promise, true);
}
$validateInput(input: string): TPromise<string> {
$validateInput(input: string): Thenable<string> {
if (this._validateInput) {
return asWinJsPromise(_ => this._validateInput(input));
return asThenable(() => this._validateInput(input));
}
return undefined;
}
......@@ -591,4 +591,4 @@ class ExtHostInputBox extends ExtHostQuickInput implements InputBox {
this._validationMessage = validationMessage;
this.update({ validationMessage });
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册