Merge remote-tracking branch 'upstream/master' into pty_bug

This commit is contained in:
Konstantin Solomatov
2019-11-18 14:39:49 -08:00
58 changed files with 1446 additions and 1172 deletions

View File

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

View File

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

View File

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