mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Added PyQualifiedReference.isQualified() that potentially doesn't require AST access
This commit is contained in:
@@ -58,7 +58,7 @@ public interface NameDefiner extends PsiElement {
|
||||
for (PyElement elt : it) {
|
||||
if (elt != null) {
|
||||
// qualified refs don't match by last name, and we're not checking FQNs here
|
||||
if (elt instanceof PyQualifiedExpression && ((PyQualifiedExpression)elt).getQualifier() != null) continue;
|
||||
if (elt instanceof PyQualifiedExpression && ((PyQualifiedExpression)elt).isQualified()) continue;
|
||||
if (name.equals(elt.getName())) { // plain name matches
|
||||
ret = elt;
|
||||
break;
|
||||
|
||||
@@ -30,6 +30,13 @@ public interface PyQualifiedExpression extends PyExpression {
|
||||
@Nullable
|
||||
PyExpression getQualifier();
|
||||
|
||||
/**
|
||||
* Checks if the expression is qualified.
|
||||
*
|
||||
* Unlike {@link #getQualifier()}, it may not require AST access.
|
||||
*/
|
||||
boolean isQualified();
|
||||
|
||||
/**
|
||||
* Returns the name to the right of the qualifier.
|
||||
*
|
||||
|
||||
@@ -57,6 +57,4 @@ public interface PyTargetExpression extends PyQualifiedExpression, PsiNamedEleme
|
||||
|
||||
@Nullable
|
||||
PyClass getContainingClass();
|
||||
|
||||
boolean isQualified();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user