void (@NotNull Project project, @NotNull VirtualFile fileOrDir, @NotNull LanguageLevel level) { LanguageLevel oldLanguageLevel = KEY.getPersistentValue(fileOrDir); boolean changed = KEY.setPersistentValue(fileOrDir, level); if (!changed) return; if (!areLanguageLevelsCompatible(oldLanguageLevel, level) || !ProjectFileIndex.getInstance(project).isInContent(fileOrDir)) { PushedFilePropertiesUpdater.getInstance(project).filePropertiesChanged(fileOrDir, PythonLanguageLevelPusher::isPythonFile); } for (VirtualFile child : fileOrDir.getChildren()) { if (!child.isDirectory() && isPythonFile(child)) { clearSdkPathCache(child); } } }