mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-04 10:22:17 +01:00
* Reduce recomputation of state in markdown extension - Use `getForDocument` more often to avoid refetching documents - Debounce `MdTableOfContentsWatcher`. We don't want this to trigger on every keystroke :) * Cache LinkDefinitionSet * Add test file change * Fix toc watcher for tests
22 lines
1.1 KiB
TypeScript
22 lines
1.1 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import * as vscode from 'vscode';
|
|
import { MarkdownItEngine } from '../markdownEngine';
|
|
import { MarkdownContributionProvider, MarkdownContributions } from '../markdownExtensions';
|
|
import { githubSlugifier } from '../slugify';
|
|
import { Disposable } from '../util/dispose';
|
|
import { nulLogger } from './nulLogging';
|
|
|
|
const emptyContributions = new class extends Disposable implements MarkdownContributionProvider {
|
|
readonly extensionUri = vscode.Uri.file('/');
|
|
readonly contributions = MarkdownContributions.Empty;
|
|
readonly onContributionsChanged = this._register(new vscode.EventEmitter<this>()).event;
|
|
};
|
|
|
|
export function createNewMarkdownEngine(): MarkdownItEngine {
|
|
return new MarkdownItEngine(emptyContributions, githubSlugifier, nulLogger);
|
|
}
|