add ignoreFocusOut
option to showInputBox and showQuickPick, #9918
This commit is contained in:
parent
5f67ddcaf0
commit
cfbf71725c
12
src/vs/vscode.d.ts
vendored
12
src/vs/vscode.d.ts
vendored
|
@ -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.
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue