Don't repeat markdown link validation (#149169)

We currently validate each link in a markdown file individually. This means that if there are multiple links to the same file, we check if that file exists multiple times

With this change, we instead will check that the file exists once and then use this to add diagnostics for all the links to it. This is done by introducing a new `FileLinkMap` which maps file paths to links within that file
This commit is contained in:
Matt Bierner
2022-05-10 09:14:40 -07:00
committed by GitHub
parent a9fc85ff47
commit 9e42783398
2 changed files with 84 additions and 46 deletions

View File

@@ -87,7 +87,7 @@ function getWorkspaceFolder(document: SkinnyTextDocument) {
|| vscode.workspace.workspaceFolders?.[0]?.uri;
}
interface MdLinkSource {
export interface MdLinkSource {
readonly text: string;
readonly resource: vscode.Uri;
readonly hrefRange: vscode.Range;