mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-27 05:37:45 +00:00
This change reduces the number of times we retokenize a markdown file by doing the following: - Use `MdTableOfContentsProvider` in more places - Introduce a `IMarkdownParser` interface that lets us drop in a caching version of the tokenizer
23 lines
846 B
TypeScript
23 lines
846 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import { Command } from '../commandManager';
|
|
import { MarkdownItEngine } from '../markdownEngine';
|
|
import { MarkdownPreviewManager } from '../preview/previewManager';
|
|
|
|
export class RefreshPreviewCommand implements Command {
|
|
public readonly id = 'markdown.preview.refresh';
|
|
|
|
public constructor(
|
|
private readonly webviewManager: MarkdownPreviewManager,
|
|
private readonly engine: MarkdownItEngine
|
|
) { }
|
|
|
|
public execute() {
|
|
this.engine.cleanCache();
|
|
this.webviewManager.refresh();
|
|
}
|
|
}
|