Custom name for Find Usages of symbol
I've implemented com.intellij.lang.findUsages.FindUsagesProvider and com.intellij.openapi.application.QueryExecutorBase<PsiReference, ReferencesSearch.SearchParameters> for finding usages of LeafPsiElement - value element of YAMLKeyValue (YAML plugin). I want to provide symbol name for popup title in Find Usages - actually popup title looks like this:
and I would like to have it like this one:
How can I change symbol name in this title?
Please sign in to leave a comment.
Hi,
you can register a custom com.intellij.psi.ElementDescriptionProvider.
Here match the getElementDescription method calls where the location is instanceOf com.intellij.usageView.UsageViewLongNameLocation and provide the string that you prefer.
Something like:
This should do the job
Hmm,
I've implemented that interface like this:
Method is called and my value is returned but title is still without this text. Even in Show Usages tab there is still "<anonymous>". It is used as description of searched element but not in the title.
I've added location check as you suggested and put breakpoint at return point but it is never stops there now - location is not instance of UsageViewLongNameLocation. Probably this works only for Java symbols but I'm looking for unclassified usages of non java symbol.