mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fixed wrong resolve to submodule instead of function with the same name (PY-6866)
This commit is contained in:
@@ -91,7 +91,7 @@ public class PyFileImpl extends PsiFileBase implements PyFile, PyExpression {
|
||||
}
|
||||
if (PyNames.INIT_DOT_PY.equals(getName())) {
|
||||
final PyQualifiedName qName = fromImportStatement.getImportSourceQName();
|
||||
if (qName != null) {
|
||||
if (qName != null && !localDeclarations.containsKey(qName.toString())) {
|
||||
localDeclarations.put(qName.getLastComponent(), fromImportStatement);
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import p1
|
||||
p1.m1
|
||||
# <ref>
|
||||
@@ -0,0 +1 @@
|
||||
from m1 import m1
|
||||
@@ -0,0 +1,2 @@
|
||||
def m1():
|
||||
pass
|
||||
@@ -381,6 +381,11 @@ public class PyMultiFileResolveTest extends PyResolveTestCase {
|
||||
assertResolvesTo(PyFile.class, "m2.py");
|
||||
}
|
||||
|
||||
// PY-6866
|
||||
public void testFunctionAndSubmoduleNamedIdentically() {
|
||||
assertResolvesTo(PyFunction.class, "m1");
|
||||
}
|
||||
|
||||
private void prepareTestDirectory() {
|
||||
final String testName = getTestName(true);
|
||||
myFixture.copyDirectoryToProject(testName, "");
|
||||
|
||||
Reference in New Issue
Block a user