Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/markdown-language-features/src/commands/openImage.ts
3294 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import * as vscode from 'vscode';
7
import { Command } from '../commandManager';
8
import { MarkdownPreviewManager } from '../preview/previewManager';
9
10
export class OpenImageCommand implements Command {
11
public readonly id = '_markdown.openImage';
12
13
public constructor(
14
private readonly _webviewManager: MarkdownPreviewManager,
15
) { }
16
17
public execute(args: { resource: string; imageSource: string }) {
18
const source = vscode.Uri.parse(args.resource);
19
this._webviewManager.openDocumentLink(args.imageSource, source);
20
}
21
}
22
23