mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
Allow extension authors to set valueSelection in a QuickPick/InputBox (#157022)
This commit is contained in:
@@ -555,6 +555,8 @@ export interface TransferInputBox extends BaseTransferQuickInput {
|
||||
|
||||
value?: string;
|
||||
|
||||
valueSelection?: Readonly<[number, number]>;
|
||||
|
||||
placeholder?: string;
|
||||
|
||||
password?: boolean;
|
||||
@@ -569,7 +571,7 @@ export interface TransferInputBox extends BaseTransferQuickInput {
|
||||
export interface IInputBoxOptions {
|
||||
title?: string;
|
||||
value?: string;
|
||||
valueSelection?: [number, number];
|
||||
valueSelection?: Readonly<[number, number]>;
|
||||
prompt?: string;
|
||||
placeHolder?: string;
|
||||
password?: boolean;
|
||||
|
||||
@@ -687,6 +687,7 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx
|
||||
|
||||
private _password = false;
|
||||
private _prompt: string | undefined;
|
||||
private _valueSelection: readonly [number, number] | undefined;
|
||||
private _validationMessage: string | InputBoxValidationMessage | undefined;
|
||||
|
||||
constructor(extension: IExtensionDescription, onDispose: () => void) {
|
||||
@@ -712,6 +713,15 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx
|
||||
this.update({ prompt });
|
||||
}
|
||||
|
||||
get valueSelection() {
|
||||
return this._valueSelection;
|
||||
}
|
||||
|
||||
set valueSelection(valueSelection: readonly [number, number] | undefined) {
|
||||
this._valueSelection = valueSelection;
|
||||
this.update({ valueSelection });
|
||||
}
|
||||
|
||||
get validationMessage() {
|
||||
return this._validationMessage;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user