Fix auto-detection of extractors that aren't languages

This commit is contained in:
Henry Mercer
2025-08-07 21:09:22 +01:00
parent afbbdf51df
commit 5794ffcb4a
9 changed files with 51 additions and 7 deletions

View File

@@ -310,7 +310,13 @@ export async function getSupportedLanguageMap(
const supportedLanguages: Record<string, string> = {};
// Populate canonical language names
for (const extractor of Object.keys(resolveResult.extractors)) {
supportedLanguages[extractor] = extractor;
// Require the language to be a known language.
// This is a temporary workaround since we have extractors that are not
// supported languages, such as `csv`, `html`, `properties`, `xml`, and
// `yaml`. We should replace this with a more robust solution in the future.
if (KnownLanguage[extractor] !== undefined) {
supportedLanguages[extractor] = extractor;
}
}
// Populate language aliases
if (resolveResult.aliases) {