add ignoreFocusOut option to showInputBox and showQuickPick, #9918

This commit is contained in:
Johannes Rieken 2016-08-15 13:05:25 +02:00
parent 5f67ddcaf0
commit cfbf71725c
5 changed files with 19 additions and 3 deletions

12
src/vs/vscode.d.ts vendored
View file

@ -1362,6 +1362,11 @@ declare namespace vscode {
*/
placeHolder?: string;
/**
* Set to `true` to keep the picker open when focus moves to another part of the editor or to another window.
*/
ignoreFocusOut?: boolean;
/**
* An optional function that is invoked whenever an item is selected.
*/
@ -1411,10 +1416,15 @@ declare namespace vscode {
placeHolder?: string;
/**
* Set to true to show a password prompt that will not show the typed value.
* Set to `true` to show a password prompt that will not show the typed value.
*/
password?: boolean;
/**
* Set to `true` to keep the input box open when focus moves to another part of the editor or to another window.
*/
ignoreFocusOut?: boolean;
/**
* An optional function that will be called to valide input and to give a hint
* to the user.

View file

@ -35,7 +35,8 @@ export class ExtHostQuickOpen extends ExtHostQuickOpenShape {
autoFocus: { autoFocusFirstEntry: true },
placeHolder: options && options.placeHolder,
matchOnDescription: options && options.matchOnDescription,
matchOnDetail: options && options.matchOnDetail
matchOnDetail: options && options.matchOnDetail,
ignoreFocusLost: options && options.ignoreFocusOut
});
const promise = itemsPromise.then(items => {

View file

@ -83,6 +83,7 @@ export class MainThreadQuickOpen extends MainThreadQuickOpenShape {
inputOptions.placeHolder = options.placeHolder;
inputOptions.prompt = options.prompt;
inputOptions.value = options.value;
inputOptions.ignoreFocusLost = options.ignoreFocusOut;
}
if (validateInput) {

View file

@ -133,7 +133,7 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
// open quick pick with just one choice. we will recurse whenever
// the validation/success message changes
this.doPick(TPromise.as([{ label: currentPick }]), {
ignoreFocusLost: false,
ignoreFocusLost: options.ignoreFocusLost,
autoFocus: { autoFocusFirstEntry: true },
password: options.password,
placeHolder: options.placeHolder,

View file

@ -46,6 +46,8 @@ export interface IPickOptions {
* an optional flag to include the detail when filtering the picks
*/
matchOnDetail?: boolean;
ignoreFocusLost?: boolean;
}
export interface IInputOptions {
@ -70,6 +72,8 @@ export interface IInputOptions {
*/
password?: boolean;
ignoreFocusLost?: boolean;
/**
* an optional function that is used to validate user input.
*/