From 175e3373f9da0c390aa584c4ed91f02ad5c7bc18 Mon Sep 17 00:00:00 2001 From: Nikolay Chashnikov Date: Tue, 31 Jan 2023 14:20:29 +0100 Subject: [PATCH] [python] get rid of usage of DirectoryIndex class (IDEA-276394) This class is going to be deprecated. GitOrigin-RevId: 22c6e53b26ff795bf4834116afcbc7a049fb90ef --- .../jetbrains/python/psi/impl/PythonLanguageLevelPusher.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java index 45cfb0b6bae2..6fe61a181a9c 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java @@ -18,8 +18,6 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectManager; import com.intellij.openapi.projectRoots.Sdk; import com.intellij.openapi.roots.*; -import com.intellij.openapi.roots.impl.DirectoryIndex; -import com.intellij.openapi.roots.impl.DirectoryInfo; import com.intellij.openapi.roots.impl.FilePropertyPusher; import com.intellij.openapi.roots.impl.PushedFilePropertiesUpdater; import com.intellij.openapi.util.Key; @@ -341,8 +339,7 @@ public final class PythonLanguageLevelPusher implements FilePropertyPusher { if (myProject.isDisposed() || !myRoot.isValid()) return null; - DirectoryInfo info = DirectoryIndex.getInstance(myProject).getInfoForFile(myRoot); - Module module = info.getModule(); + Module module = ProjectFileIndex.getInstance(myProject).getModuleForFile(myRoot, false); if (module == null) return null; return ModuleRootManager.getInstance(module).getFileIndex(); });