MyPsiPossibleTypes (@NotNull String languageId) { return myPsiPossibleTypes.computeIfAbsent(languageId, (_key) -> CachedValuesManager.getManager(myProject).createCachedValue(() -> { final var uastLanguagePlugin = ContainerUtil.find(UastLanguagePlugin.Companion.getInstances(), it -> languageId.equals(it.getLanguage().getID())); // drops cache on plugin dynamic reload return CachedValueProvider.Result .create(uastLanguagePlugin == null ? null : new MyPsiPossibleTypes(uastLanguagePlugin), NEVER_CHANGED); }) ).getValue(); }