Code completion handling
Hello everyone. Thanks for great IDE and also very powerful open API.
But I can't understand, is it possible to handle code completions (any kind of completion, or at least per types) with something like TypedHandler? I Google'd a lot, but still doesn't figured it out.
Thank you again, hoping for a quick answer.
请先登录再写评论。
Sorry, I don't understand what you mean by "handle code completions".
I mean't that I interested in something like TypedHandler, but triggering on code completions, not keystrokes. Sorry for not clear wording.
CompletionContributor-s are invoked on every completion, but it really depends on the problem you're solving. What do you want to achieve by this?
I just trying to measure how much symbols were inserted by completions, like in your's productivity plugin.
Tracking what completion has inserted is quite nontrivial, because completions can vary a lot in how exactly they make modifications to the code. Unfortunately there's no public (or even private) API for that. For reference, this is done in com.intellij.codeInsight.completion.CompletionLookupArranger.StatisticsUpdate#addSparedChars.