mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-CR-49176: fixed exception when invoking inline on import (PY-36484)
GitOrigin-RevId: e67643b18f410f3f6a92405ffe128f5e987ebb7d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
72e24eef45
commit
05f36652c9
@@ -90,8 +90,9 @@ class PyInlineFunctionProcessor(project: Project,
|
||||
override fun findUsages(): Array<UsageInfo> {
|
||||
if (myInlineThis) {
|
||||
val element = myReference!!.element as PyReferenceExpression
|
||||
val import = PyResolveUtil.resolveLocally(ScopeUtil.getScopeOwner(element)!!, element.name!!).firstOrNull { it is PyImportElement }
|
||||
return if (import != null) arrayOf(UsageInfo(element), UsageInfo(import)) else arrayOf(UsageInfo(element))
|
||||
val isImport = PsiTreeUtil.getParentOfType(element, PyImportStatementBase::class.java) != null
|
||||
val localImport = PyResolveUtil.resolveLocally(ScopeUtil.getScopeOwner(element)!!, element.name!!).firstOrNull { it is PyImportElement }
|
||||
return if (!isImport && localImport != null) arrayOf(UsageInfo(element), UsageInfo(localImport)) else arrayOf(UsageInfo(element))
|
||||
}
|
||||
|
||||
return ReferencesSearch.search(myFunction, myRefactoringScope).asSequence()
|
||||
|
||||
Reference in New Issue
Block a user