mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 01:29:04 +01:00
Clean up structure of markdown extension (#161148)
- Move things related to the client under `client` - Remove extra abstractions that are no longer used - Add MdLanguageClient type
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { BaseLanguageClient } from 'vscode-languageclient';
|
||||
import * as proto from '../protocol';
|
||||
import { MdLanguageClient } from '../client/client';
|
||||
import * as proto from '../client/protocol';
|
||||
|
||||
enum OpenMarkdownLinks {
|
||||
beside = 'beside',
|
||||
@@ -15,15 +15,15 @@ enum OpenMarkdownLinks {
|
||||
export class MdLinkOpener {
|
||||
|
||||
constructor(
|
||||
private readonly client: BaseLanguageClient,
|
||||
private readonly client: MdLanguageClient,
|
||||
) { }
|
||||
|
||||
public async resolveDocumentLink(linkText: string, fromResource: vscode.Uri): Promise<proto.ResolvedDocumentLinkTarget> {
|
||||
return this.client.sendRequest(proto.resolveLinkTarget, { linkText, uri: fromResource.toString() });
|
||||
return this.client.resolveLinkTarget(linkText, fromResource);
|
||||
}
|
||||
|
||||
public async openDocumentLink(linkText: string, fromResource: vscode.Uri, viewColumn?: vscode.ViewColumn): Promise<void> {
|
||||
const resolved = await this.client.sendRequest(proto.resolveLinkTarget, { linkText, uri: fromResource.toString() });
|
||||
const resolved = await this.client.resolveLinkTarget(linkText, fromResource);
|
||||
if (!resolved) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user