Turn off auto-select completion element when inside LiveTemplate

Autoselecting the best completion match is almost always a good thing. However, I'm using templates in several places and when I'm editing a template, autocompletion is not what I want when I press Tab. See for instance below, where I just want to type the variable "i" but the completion of the live template "if" comes in the way. The only solution is to press ESC when the completion window pops up. I believe this will annoy my users.

Is there a way to turn off the auto-selection when I'm inside a template? 

Btw, in Java this happens too, but it almost never gets in the way with the user's intentions because the IDE knows too much in such a structured (and typed) language. Any suggestions?

Official comment

There's CompletionPreselectionBehaviourProvider that can disable this preselection. But I'd suggest to only use it as a last resort, trying to avoid showing unnecessary variants if possible at all. The lack of preselection might annoy your users, too, if the suggestions are relevant.

You might also want to look into TemplateCompletionProcessor extension, where you can override if the next live template variable should be chosen when a completion item is selected.

you could implement liveTemplateContext extension point..


Please sign in to leave a comment.