mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
return non-null descriptive name for elements that don't have a name (PY-1552)
This commit is contained in:
@@ -46,12 +46,13 @@ public class PythonFindUsagesProvider implements FindUsagesProvider {
|
||||
@NotNull
|
||||
public String getDescriptiveName(@NotNull PsiElement element) {
|
||||
if (element instanceof PsiNamedElement) {
|
||||
return ((PsiNamedElement)element).getName();
|
||||
final String name = ((PsiNamedElement)element).getName();
|
||||
return name == null ? "<unnamed>" : name;
|
||||
}
|
||||
if (element instanceof PyReferenceExpression) {
|
||||
String referencedName = ((PyReferenceExpression)element).getReferencedName();
|
||||
if (referencedName == null) {
|
||||
return "";
|
||||
return "<unnamed>";
|
||||
}
|
||||
return referencedName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user