diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index d967fa78f54eb..da08b876e4487 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1063,7 +1063,7 @@ declare module 'vscode' { */ group?: string; - /** + /** * Controls whether the terminal is closed after executing the task. */ close?: boolean; @@ -1101,6 +1101,11 @@ declare module 'vscode' { * An optional flag to sort the final results by index of first query match in label. Defaults to true. */ sortByLabel: boolean; + + /* + * An optional flag that can be set to true to maintain the scroll position of the quick pick when the quick pick items are updated. Defaults to false. + */ + keepScrollPosition?: boolean; } //#endregion diff --git a/src/vs/workbench/api/common/extHostQuickOpen.ts b/src/vs/workbench/api/common/extHostQuickOpen.ts index a04f27fc3dedd..5e735c8c1ec29 100644 --- a/src/vs/workbench/api/common/extHostQuickOpen.ts +++ b/src/vs/workbench/api/common/extHostQuickOpen.ts @@ -516,6 +516,7 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx private _matchOnDescription = true; private _matchOnDetail = true; private _sortByLabel = true; + private _keepScrollPosition = false; private _activeItems: T[] = []; private readonly _onDidChangeActiveEmitter = new Emitter(); private _selectedItems: T[] = []; @@ -602,6 +603,15 @@ export function createExtHostQuickOpen(mainContext: IMainContext, workspace: IEx this.update({ sortByLabel }); } + get keepScrollPosition() { + return this._keepScrollPosition; + } + + set keepScrollPosition(keepScrollPosition: boolean) { + this._keepScrollPosition = keepScrollPosition; + this.update({ keepScrollPosition }); + } + get activeItems() { return this._activeItems; }