check for input box options, fixes #7013

This commit is contained in:
Johannes Rieken
2016-05-30 10:54:10 +02:00
parent 6e366f56ff
commit 45a797bec1
3 changed files with 11 additions and 3 deletions

View File

@@ -232,7 +232,9 @@ export class ExtHostAPIImplementation {
showQuickPick: (items: any, options: vscode.QuickPickOptions) => {
return extHostQuickOpen.show(items, options);
},
showInputBox: extHostQuickOpen.input.bind(extHostQuickOpen),
showInputBox(options?: vscode.InputBoxOptions) {
return extHostQuickOpen.input(options);
},
createStatusBarItem(position?: vscode.StatusBarAlignment, priority?: number): vscode.StatusBarItem {
return extHostStatusBar.createStatusBarEntry(<number>position, priority);

View File

@@ -101,8 +101,8 @@ export class ExtHostQuickOpen {
// ---- input
input(options?: InputBoxOptions): Thenable<string> {
this._validateInput = options.validateInput;
return this._proxy.$input(options, typeof options.validateInput === 'function');
this._validateInput = options && options.validateInput;
return this._proxy.$input(options, options && typeof options.validateInput === 'function');
}
$validateInput(input: string): TPromise<string> {