mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 04:23:32 +01:00
Merge remote-tracking branch 'upstream/master' into pty_bug
This commit is contained in:
@@ -476,6 +476,8 @@ export interface TransferQuickPick extends BaseTransferQuickInput {
|
||||
matchOnDescription?: boolean;
|
||||
|
||||
matchOnDetail?: boolean;
|
||||
|
||||
sortByLabel?: boolean;
|
||||
}
|
||||
|
||||
export interface TransferInputBox extends BaseTransferQuickInput {
|
||||
@@ -592,6 +594,7 @@ export interface ExtHostWebviewsShape {
|
||||
$resolveWebviewEditor(resource: UriComponents, newWebviewHandle: WebviewPanelHandle, viewType: string, title: string, position: EditorViewColumn, options: modes.IWebviewOptions & modes.IWebviewPanelOptions): Promise<void>;
|
||||
$undoEdits(handle: WebviewPanelHandle, edits: string[]): void;
|
||||
$redoEdits(handle: WebviewPanelHandle, edits: string[]): void;
|
||||
$onSave(handle: WebviewPanelHandle): Promise<void>;
|
||||
}
|
||||
|
||||
export interface MainThreadUrlsShape extends IDisposable {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -485,6 +485,7 @@ class ExtHostQuickPick<T extends QuickPickItem> extends ExtHostQuickInput implem
|
||||
private _canSelectMany = false;
|
||||
private _matchOnDescription = true;
|
||||
private _matchOnDetail = true;
|
||||
private _sortByLabel = true;
|
||||
private _activeItems: T[] = [];
|
||||
private readonly _onDidChangeActiveEmitter = new Emitter<T[]>();
|
||||
private _selectedItems: T[] = [];
|
||||
@@ -550,6 +551,15 @@ class ExtHostQuickPick<T extends QuickPickItem> extends ExtHostQuickInput implem
|
||||
this.update({ matchOnDetail });
|
||||
}
|
||||
|
||||
get sortByLabel() {
|
||||
return this._sortByLabel;
|
||||
}
|
||||
|
||||
set sortByLabel(sortByLabel: boolean) {
|
||||
this._sortByLabel = sortByLabel;
|
||||
this.update({ sortByLabel });
|
||||
}
|
||||
|
||||
get activeItems() {
|
||||
return this._activeItems;
|
||||
}
|
||||
|
||||
@@ -256,6 +256,10 @@ export class ExtHostWebviewEditor extends Disposable implements vscode.WebviewPa
|
||||
assertIsDefined(this._capabilities).editingCapability?.applyEdits(edits);
|
||||
}
|
||||
|
||||
async _onSave(): Promise<void> {
|
||||
await assertIsDefined(this._capabilities).editingCapability?.save();
|
||||
}
|
||||
|
||||
private assertNotDisposed() {
|
||||
if (this._isDisposed) {
|
||||
throw new Error('Webview is disposed');
|
||||
@@ -459,6 +463,11 @@ export class ExtHostWebviews implements ExtHostWebviewsShape {
|
||||
panel._redoEdits(edits);
|
||||
}
|
||||
|
||||
async $onSave(handle: WebviewPanelHandle): Promise<void> {
|
||||
const panel = this.getWebviewPanel(handle);
|
||||
return panel?._onSave();
|
||||
}
|
||||
|
||||
private getWebviewPanel(handle: WebviewPanelHandle): ExtHostWebviewEditor | undefined {
|
||||
return this._webviewPanels.get(handle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user