Skip to content

Commit 2eebf34

Browse files
authored
fix(language-core): any in templates if first checked file was not root (#4526)
1 parent 73ba476 commit 2eebf34

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/language-core/lib/languageModule.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ export function createVueLanguagePlugin<T>(
9696
createVirtualCode(scriptId, languageId, snapshot) {
9797
if (languageId === 'vue' || languageId === 'markdown' || languageId === 'html') {
9898
const fileName = asFileName(scriptId);
99-
if (!pluginContext.globalTypesHolder && getProjectVersion() !== canonicalRootFileNamesVersion) {
99+
if (getProjectVersion() !== canonicalRootFileNamesVersion) {
100100
canonicalRootFileNamesVersion = getProjectVersion();
101-
if (isRootFile(fileName)) {
102-
pluginContext.globalTypesHolder = fileName;
103-
}
101+
}
102+
if (!pluginContext.globalTypesHolder && isRootFile(fileName)) {
103+
pluginContext.globalTypesHolder = fileName;
104104
}
105105
const fileRegistry = getFileRegistry(pluginContext.globalTypesHolder === fileName);
106106
const code = fileRegistry.get(fileName);

0 commit comments

Comments
 (0)