Allow extension authors to set valueSelection in a QuickPick/InputBox (#157022)

This commit is contained in:
Tomer Chachamu
2022-10-19 14:05:01 +01:00
committed by GitHub
parent 40e7185033
commit 3bd2b70f4a
4 changed files with 32 additions and 6 deletions

View File

@@ -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;

View File

@@ -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;
}