mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 08:38:56 +01:00
Add diagnostics for markdown links (#148578)
* Initial work on md link diagnostics
* Adding settings to enable/disable validation
* Add delay for recomputing diagnostics
* 💄
* Split test on diagnostics compute vs management
* Validate on file open
* Remove dianostics on file close
* Allow paths to folders
* Add validation configuration option
This commit is contained in:
@@ -222,7 +222,7 @@ export class MdLinkProvider implements vscode.DocumentLinkProvider {
|
||||
document: SkinnyTextDocument,
|
||||
token: vscode.CancellationToken
|
||||
): Promise<vscode.DocumentLink[]> {
|
||||
const allLinks = await this.getAllLinks(document);
|
||||
const allLinks = await this.getAllLinks(document, token);
|
||||
if (token.isCancellationRequested) {
|
||||
return [];
|
||||
}
|
||||
@@ -256,8 +256,12 @@ export class MdLinkProvider implements vscode.DocumentLinkProvider {
|
||||
}
|
||||
}
|
||||
|
||||
public async getAllLinks(document: SkinnyTextDocument): Promise<MdLink[]> {
|
||||
public async getAllLinks(document: SkinnyTextDocument, token: vscode.CancellationToken): Promise<MdLink[]> {
|
||||
const codeInDocument = await findCode(document, this.engine);
|
||||
if (token.isCancellationRequested) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return Array.from([
|
||||
...this.getInlineLinks(document, codeInDocument),
|
||||
...this.getReferenceLinks(document, codeInDocument),
|
||||
|
||||
Reference in New Issue
Block a user