WTH doesn't autocomplete replace the full entity name?

I love autocomplete. It’s amazing. But it doesn’t work the way I would expect when I am trying to change an entity name from one thing to another.

Here’s an example. I have this code:

image

And now I want to change “living_room_front_door_status” to “living_room_sliding_door_status”. I click to highlight the word “front” and start typing in “slid…” At that point, the auto-complete kicks in and gives me the entity name I want. Cool!

I get excited. I click on the auto-complete option because I’m lazy and it’s faster than finishing typing out the full entity name.

But then, instead of replacing the entity i’m “typing in” with the auto-complete option, it crams the auto-complete option into the previous entity name, leaving me with the wrong entity name!

image

Arrrgh!

So basically, I have to select and delete the entire entity before trying to use auto-complete. It’s ok, but I feel it could be better.

I haven’t found an auto-complete in any IDE or coding language that doesn’t do this. Typically they have a function called “Rename” or something along those lines which gives the IDE the intention that you’re replacing the whole thing. Otherwise it has to guess what your intentions are.

ZSH shell allows autocomplete from the middle of the word (see the COMPLETE_IN_WORD part): Z-Shell Frequently-Asked Questions