extensions/typescript-language-features/src/languageFeatures/tagClosing.ts/requireActiveDocumentSetting
function requireActiveDocumentSetting(
	selector: vscode.DocumentSelector,
	language: LanguageDescription,
) {
	return new Condition(
		() => {
			const editor = vscode.window.activeTextEditor;
			if (!editor || !vscode.languages.match(selector, editor.document)) {
				return false;
			}

			return !!vscode.workspace.getConfiguration(language.id, editor.document).get('autoClosingTags');
		},
		handler => {
			return vscode.Disposable.from(
				vscode.window.onDidChangeActiveTextEditor(handler),
				vscode.workspace.onDidOpenTextDocument(handler),
				vscode.workspace.onDidChangeConfiguration(handler));
		});
}