Fix/markdown links (#11708)

* test changes

* maintain uri if it's not a file

* check file and path is string

* missed this

* Add SQL CARBON EDIT

Co-authored-by: chgagnon <chgagnon@microsoft.com>
This commit is contained in:
Maddy
2020-08-07 15:39:39 -07:00
committed by GitHub
parent 6440bad9bb
commit 3683aaaf2a

View File

@@ -10,6 +10,7 @@ import { Command } from '../commandManager';
import { MarkdownEngine } from '../markdownEngine';
import { TableOfContentsProvider } from '../tableOfContentsProvider';
import { isMarkdownFile } from '../util/file';
import { isString } from 'util'; // {{ SQL CARBON EDIT }}
export interface OpenDocumentLinkArgs {
@@ -58,7 +59,7 @@ export class OpenDocumentLinkCommand implements Command {
public static async execute(engine: MarkdownEngine, args: OpenDocumentLinkArgs) {
const fromResource = vscode.Uri.parse('').with(args.fromResource);
const targetResource = vscode.Uri.parse('').with(args.path);
const targetResource = fromResource.scheme === 'file' && isString(args.path) ? vscode.Uri.file(args.path) : vscode.Uri.parse('').with(args.path); // {{ SQL CARBON EDIT }} Fix markdown relative links https://github.com/microsoft/azuredatastudio/issues/11657
const column = this.getViewColumn(fromResource);
try {
return await this.tryOpen(engine, targetResource, args, column);