extensions/markdown-language-features/src/languageFeatures/diagnostics.ts/DiagnosticManager/constructor
class DiagnosticManager:	constructor(
		private readonly workspace: IMdWorkspace,
		private readonly computer: DiagnosticComputer,
		private readonly configuration: DiagnosticConfiguration,
		private readonly reporter: DiagnosticReporter,
		private readonly referencesProvider: MdReferencesProvider,
		tocProvider: MdTableOfContentsProvider,
		private readonly logger: ILogger,
		delay = 300,
	) {
		super();

		this.diagnosticDelayer = this._register(new Delayer(delay));

		this._register(this.configuration.onDidChange(() => {
			this.rebuild();
		}));

		this._register(workspace.onDidCreateMarkdownDocument(doc => {
			this.triggerDiagnostics(doc.uri);
			// Links in other files may have become valid
			this.triggerForReferencingFiles(doc.uri);
		}));

		this._register(workspace.onDidChangeMarkdownDocument(doc => {
			this.triggerDiagnostics(doc.uri);
		}));

		this._register(workspace.onDidDeleteMarkdownDocument(uri => {
			this.triggerForReferencingFiles(uri);
		}));

		this._register(vscode.workspace.onDidCloseTextDocument(({ uri }) => {
			this.pendingDiagnostics.delete(uri);
			this.inFlightDiagnostics.cancel(uri);
			this.linkWatcher.deleteDocument(uri);
			this.reporter.delete(uri);
		}));

		this._register(this.linkWatcher.onDidChangeLinkedToFile(changedDocuments => {
			for (const resource of changedDocuments) {
				const doc = vscode.workspace.textDocuments.find(doc => doc.uri.toString() === resource.toString());
				if (doc && isMarkdownFile(doc)) {
					this.triggerDiagnostics(doc.uri);
				}
			}
		}));

		this.tableOfContentsWatcher = this._register(new MdTableOfContentsWatcher(workspace, tocProvider, delay / 2));
		this._register(this.tableOfContentsWatcher.onTocChanged(e => {
			return this.triggerForReferencingFiles(e.uri);
		}));

		this.ready = this.rebuild();
	}