Merge from vscode e0762af258c0b20320ed03f3871a41967acc4421 (#7404)

* Merge from vscode e0762af258c0b20320ed03f3871a41967acc4421

* readd svgs
This commit is contained in:
Anthony Dresser
2019-09-27 11:13:19 -07:00
committed by GitHub
parent 6385443a4c
commit 07109617b5
348 changed files with 4219 additions and 4307 deletions

View File

@@ -8,7 +8,6 @@ import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
import { isWeb } from 'vs/base/common/platform';
import { startsWith } from 'vs/base/common/strings';
import { URI, UriComponents } from 'vs/base/common/uri';
import { generateUuid } from 'vs/base/common/uuid';
import * as modes from 'vs/editor/common/modes';
import { localize } from 'vs/nls';
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
@@ -151,7 +150,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews
webview.setName(value);
}
public $setState(handle: WebviewPanelHandle, state: modes.WebviewEditorState): void {
public $setState(handle: WebviewPanelHandle, state: modes.WebviewContentState): void {
const webview = this.getWebviewEditorInput(handle);
if (webview instanceof CustomFileEditorInput) {
webview.setState(state);
@@ -173,6 +172,11 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews
webview.webview.contentOptions = reviveWebviewOptions(options as any /*todo@mat */);
}
public $setExtension(handle: WebviewPanelHandle, extensionId: ExtensionIdentifier, extensionLocation: UriComponents): void {
const webview = this.getWebviewEditorInput(handle);
webview.webview.extension = { id: extensionId, location: URI.revive(extensionLocation) };
}
public $reveal(handle: WebviewPanelHandle, showOptions: WebviewPanelShowOptions): void {
const webview = this.getWebviewEditorInput(handle);
if (webview.isDisposed()) {
@@ -250,7 +254,7 @@ export class MainThreadWebviews extends Disposable implements MainThreadWebviews
return webviewEditorInput.getTypeId() !== WebviewInput.typeId && webviewEditorInput.viewType === viewType;
},
resolveWebview: async (webview) => {
const handle = generateUuid();
const handle = webview.id;
this._webviewEditorInputs.add(handle, webview);
this.hookupWebviewEventDelegate(handle, webview);