Skip to content

Commit

Permalink
fix(python): restore PythonCore plugin and simplify PsiUtil check
Browse files Browse the repository at this point in the history
Restore the `PythonCore` plugin in `gradle-241.properties` and simplify the null check logic in `PythonPsiUtil.kt` for better readability.
  • Loading branch information
phodal committed Dec 27, 2024
1 parent bbad1d0 commit 63f73e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions gradle-241.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ pluginUntilBuild = 243.*

# 3rd party plugins
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
#platformPlugins = PythonCore:241.14494.240,PlantUML integration:7.10.1-IJ2023.2,com.intellij.mermaid:0.0.22+IJ.232
platformPlugins = PlantUML integration:7.10.1-IJ2023.2,com.intellij.mermaid:0.0.22+IJ.232
platformPlugins = PythonCore:241.14494.240,PlantUML integration:7.10.1-IJ2023.2,com.intellij.mermaid:0.0.22+IJ.232
#platformPlugins = PlantUML integration:7.10.1-IJ2023.2,com.intellij.mermaid:0.0.22+IJ.232
pythonPlugins = PythonCore:241.14494.240
goPlugin=org.jetbrains.plugins.go:241.14494.240
plantUmlPlugin = PlantUML integration:7.10.1-IJ2023.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,8 @@ object PythonPsiUtil {
}

private fun addResolvedElement(declarationName: String, element: PsiElement?) {
if (element == null || ProjectFileIndex.getInstance(element.project)
.isInLibrary(element.containingFile.virtualFile)
) return
if (element == null) return
if (ProjectFileIndex.getInstance(element.project).isInLibrary(element.containingFile.virtualFile)) return

val resolvedElement = if (PyUtil.isInitOrNewMethod(element)) {
PsiTreeUtil.getParentOfType(element, PyClass::class.java, false)
Expand Down

0 comments on commit 63f73e5

Please sign in to comment.