diff --git a/packages/language-server/lib/hybridModeProject.ts b/packages/language-server/lib/hybridModeProject.ts index f4b3f04f71..efe274987e 100644 --- a/packages/language-server/lib/hybridModeProject.ts +++ b/packages/language-server/lib/hybridModeProject.ts @@ -108,7 +108,10 @@ export function createHybridModeProject( serviceEnv: LanguageServiceEnvironment, languagePlugins: LanguagePlugin[], ) { - const language = createLanguage(languagePlugins, createUriMap(), uri => { + const language = createLanguage([ + { getLanguageId: uri => server.documents.get(server.getSyncedDocumentKey(uri) ?? uri.toString())?.languageId }, + ...languagePlugins, + ], createUriMap(), uri => { const documentKey = server.getSyncedDocumentKey(uri); const document = documentKey ? server.documents.get(documentKey) : undefined; if (document) {