Preventing duplication when auto-completing (like in Atom)
Imagine you have `myOwnService` written somewhere, and you want to change it to `someOtherService` and that the auto-completion knows about someOtherService.
What I'll often do in this case, is put my cursor like this: "myOwn|Service" and then remove the part that needs to change: "|Service". Next, I'll start typing the replacement part: "some|Service". At that point, the auto-completion will suggest someOtherService, but if I select it, I'll get "someOtherService|Service".
Atom is smarter about this. It sees that the last part is a postfix of the auto-completion, and it eats it up, leaving me with exactly what I want: "someOtherService". Sometimes this leads to it removing something I still needed, but because it only does it if the text is a postfix of the auto-completed term, this is rare enough. And it has actually saved me a ton of keystrokes in Atom.
Is there some way to get this Atom-like behavior in IntelliJ?
Please sign in to leave a comment.
Hello,
Please try to use "Tab" to choose item from completion list.
Thanks, that's a good suggestion!
I just rebound enter from "Choose lookup item" to "Choose lookup item replace" to get that when I use enter as well. It's not as good as the context-aware version that Atom has, but it's a large step in the right direction. (Well, "Choose lookup item replace" is, the rebinding is just my personal preference.)