Merge from vscode 4636be2b71c87bfb0bfe3c94278b447a5efcc1f1 (#8722)

* Merge from vscode 4636be2b71c87bfb0bfe3c94278b447a5efcc1f1

* remove tests that aren't working
This commit is contained in:
Anthony Dresser
2019-12-18 00:14:28 -08:00
committed by GitHub
parent 0fd870d156
commit 30d9e9c141
289 changed files with 5537 additions and 3039 deletions

View File

@@ -23,7 +23,7 @@ export function activate(context: vscode.ExtensionContext) {
const previewManager = new PreviewManager(extensionRoot, sizeStatusBarEntry, binarySizeStatusBarEntry, zoomStatusBarEntry);
context.subscriptions.push(vscode.window.registerWebviewEditorProvider(PreviewManager.viewType, previewManager));
context.subscriptions.push(vscode.window.registerWebviewCustomEditorProvider(PreviewManager.viewType, previewManager));
context.subscriptions.push(vscode.commands.registerCommand('imagePreview.zoomIn', () => {
previewManager.activePreview?.zoomIn();

View File

@@ -13,7 +13,7 @@ import { BinarySizeStatusBarEntry } from './binarySizeStatusBarEntry';
const localize = nls.loadMessageBundle();
export class PreviewManager implements vscode.WebviewEditorProvider {
export class PreviewManager implements vscode.WebviewCustomEditorProvider {
public static readonly viewType = 'imagePreview.previewEditor';
@@ -28,10 +28,10 @@ export class PreviewManager implements vscode.WebviewEditorProvider {
) { }
public async resolveWebviewEditor(
input: { readonly resource: vscode.Uri, },
resource: vscode.Uri,
webviewEditor: vscode.WebviewPanel,
): Promise<vscode.WebviewEditorCapabilities> {
const preview = new Preview(this.extensionRoot, input.resource, webviewEditor, this.sizeStatusBarEntry, this.binarySizeStatusBarEntry, this.zoomStatusBarEntry);
): Promise<void> {
const preview = new Preview(this.extensionRoot, resource, webviewEditor, this.sizeStatusBarEntry, this.binarySizeStatusBarEntry, this.zoomStatusBarEntry);
this._previews.add(preview);
this.setActivePreview(preview);
@@ -44,8 +44,6 @@ export class PreviewManager implements vscode.WebviewEditorProvider {
this.setActivePreview(undefined);
}
});
return {};
}
public get activePreview() { return this._activePreview; }