diff --git a/packages/language-server/src/plugins/typescript/module-loader.ts b/packages/language-server/src/plugins/typescript/module-loader.ts index b681978bf..412bf2da1 100644 --- a/packages/language-server/src/plugins/typescript/module-loader.ts +++ b/packages/language-server/src/plugins/typescript/module-loader.ts @@ -64,8 +64,11 @@ class ModuleResolutionCache { const fileNameWithoutEnding = getLastPartOfPath(this.getCanonicalFileName(path)).split('.').shift() || ''; this.cache.forEach((val, key) => { + if (val) { + return; + } const [containingFile, moduleName = ''] = key.split(CACHE_KEY_SEPARATOR); - if (!val && moduleName.includes(fileNameWithoutEnding)) { + if (moduleName.includes(fileNameWithoutEnding)) { this.cache.delete(key); this.pendingInvalidations.add(containingFile); }