re-rendering Markdown preview when updated extra configurations provided by extension

This commit is contained in:
Vitaliy Mazurenko
2019-04-01 10:52:23 +03:00
parent 8b01096845
commit e40d72b1b5
3 changed files with 14 additions and 2 deletions

View File

@@ -47,6 +47,11 @@ class TokenCache {
};
this.tokens = tokens;
}
public clean(): void {
this.cachedDocument = undefined;
this.tokens = undefined;
}
}
export class MarkdownEngine {
@@ -147,6 +152,10 @@ export class MarkdownEngine {
return this.tokenize(document, config, engine);
}
public cleanCache(): void {
this._tokenCache.clean();
}
private getConfig(resource: vscode.Uri): MarkdownItConfig {
const config = vscode.workspace.getConfiguration('markdown', resource);
return {