mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-38364 - IAE: PsiTreeUtil.isAncestor
This commit is contained in:
@@ -173,7 +173,7 @@ public class PythonReferenceImporter implements ReferenceImporter {
|
||||
PyFileImpl importSourceFile = (PyFileImpl)sourceFile;
|
||||
PsiElement res = importSourceFile.findExportedName(refText);
|
||||
// allow importing from this source if it either declares the name itself or represents a higher-level package that reexports the name
|
||||
if (res != null && !(res instanceof PyFile) && !(res instanceof PyImportElement) &&
|
||||
if (res != null && !(res instanceof PyFile) && !(res instanceof PyImportElement) && res.getContainingFile() != null &&
|
||||
PsiTreeUtil.isAncestor(source, res.getContainingFile(), false)) {
|
||||
existingImportFile = importSourceFile;
|
||||
fix.addImport(res, importSourceFile, importElement);
|
||||
|
||||
Reference in New Issue
Block a user