How to firstly suggest own list of annotations on after typing @ before java field
已回答
Hi community!
I want to have in a completion list my platform annotations first after typing '@' symbol before java field. They are already in the completion list by some out-of-the-box logic.
How can I change priority of my annotations on the suggestion list?
Thank you in advance!
请先登录再写评论。
I found the solution in extending of com.intellij.psi.util.proximity.ProximityWeigher class. It allows to set weight of suggestion based on element and location.
Note that completion also "learns" from usage over time.
Do you mean I need to implement com.intellij.codeInsight.completion.CompletionConfidence?
No, that EP is unrelated to “sorting”. Your solution will work - most probably. Unless some other
Weigheracts against it.Got it, thank you very much!