Customizing "Choose Declaration" dialog
Is there any way to customize "Choose Declaration" dialog for PsiElement with multipule declarations?
For now, we have that:

Would be really nice to have (or be able to customize that to) something like Find Usages dialog:

So, having just file name (without the path), line number and actual line contest in "Choose Declaration" dialog would be really helpful.
Please sign in to leave a comment.
You can implement NavigationItem in the PSI elements you resolve to, and return custom presentation from getPresentation method. It probably won't look like in Show Usages, but the same information can be shown, maybe arranged in a bit different way.
Works like a charm, Thank you!
Just would like to notice for those who will be looking for a solution. All PsiElements already implement NavigationItem (from ancestor PsiElementBase). So we just need to implement getPresentation() method somehow like that:
public static ItemPresentation getPresentation() {
return new ItemPresentation() {
@Override
public String getPresentableText() {
return // Your text for the first column
}
@Override
public String getLocationString() {
return // Your text for the second, shadowed column
}
@Override
public Icon getIcon(boolean open) {
return null; // Not used for dialog rendering :(
}
};
}