mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use as name for completion of import elements (PY-3672)
This commit is contained in:
@@ -128,9 +128,10 @@ public class VariantsProcessor implements PsiScopeProcessor {
|
||||
else if (element instanceof NameDefiner) {
|
||||
boolean handled_as_imported = false;
|
||||
if (element instanceof PyImportElement) {
|
||||
PyReferenceExpression ref = ((PyImportElement)element).getImportReference();
|
||||
final PyImportElement importElement = (PyImportElement)element;
|
||||
PyReferenceExpression ref = importElement.getImportReference();
|
||||
if (ref != null && ref.getQualifier() == null) {
|
||||
String name = ref.getName();
|
||||
String name = importElement.getAsName() != null ? importElement.getAsName() : ref.getName();
|
||||
if (name != null && nameIsAcceptable(name)) {
|
||||
PsiElement resolved = ref.getReference().resolve();
|
||||
if (resolved instanceof PsiNamedElement) {
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
import datetime as timedate
|
||||
timedate
|
||||
@@ -0,0 +1,2 @@
|
||||
import datetime as timedate
|
||||
timeda<caret>
|
||||
@@ -380,4 +380,8 @@ public class PythonCompletionTest extends PyLightFixtureTestCase {
|
||||
myFixture.completeBasic();
|
||||
myFixture.checkResultByFile("completion/exportedConstants/a.after.py");
|
||||
}
|
||||
|
||||
public void testAlias() { // PY-3672
|
||||
doTest();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user