extensions/emmet/src/util.ts/getEmmetMode
export function getEmmetMode(language: string, mappedModes: Record<string, string>, excludedLanguages: string[]): string | undefined {
	if (!language || excludedLanguages.includes(language)) {
		return;
	}

	if (language === 'jsx-tags') {
		language = 'javascriptreact';
	}

	if (mappedModes[language]) {
		language = mappedModes[language];
	}

	if (/\b(typescriptreact|javascriptreact|jsx-tags)\b/.test(language)) { // treat tsx like jsx
		language = 'jsx';
	}
	else if (language === 'sass-indented') { // map sass-indented to sass
		language = 'sass';
	}
	else if (language === 'jade' || language === 'pug') {
		language = 'pug';
	}

	const syntaxes = getSyntaxes();
	if (syntaxes.markup.includes(language) || syntaxes.stylesheet.includes(language)) {
		return language;
	}
	return;
}