be3e823608
git-subtree-dir: lib/vscode git-subtree-split: e5a624b788d92b8d34d1392e4c4d9789406efe8f
36 lines
1.6 KiB
TypeScript
36 lines
1.6 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import * as vscode from 'vscode';
|
|
import { BinarySizeStatusBarEntry } from './binarySizeStatusBarEntry';
|
|
import { PreviewManager } from './preview';
|
|
import { SizeStatusBarEntry } from './sizeStatusBarEntry';
|
|
import { ZoomStatusBarEntry } from './zoomStatusBarEntry';
|
|
|
|
export function activate(context: vscode.ExtensionContext) {
|
|
const sizeStatusBarEntry = new SizeStatusBarEntry();
|
|
context.subscriptions.push(sizeStatusBarEntry);
|
|
|
|
const binarySizeStatusBarEntry = new BinarySizeStatusBarEntry();
|
|
context.subscriptions.push(binarySizeStatusBarEntry);
|
|
|
|
const zoomStatusBarEntry = new ZoomStatusBarEntry();
|
|
context.subscriptions.push(zoomStatusBarEntry);
|
|
|
|
const previewManager = new PreviewManager(context.extensionUri, sizeStatusBarEntry, binarySizeStatusBarEntry, zoomStatusBarEntry);
|
|
|
|
context.subscriptions.push(vscode.window.registerCustomEditorProvider(PreviewManager.viewType, previewManager, {
|
|
supportsMultipleEditorsPerDocument: true,
|
|
}));
|
|
|
|
context.subscriptions.push(vscode.commands.registerCommand('imagePreview.zoomIn', () => {
|
|
previewManager.activePreview?.zoomIn();
|
|
}));
|
|
|
|
context.subscriptions.push(vscode.commands.registerCommand('imagePreview.zoomOut', () => {
|
|
previewManager.activePreview?.zoomOut();
|
|
}));
|
|
}
|