Hacker News new | past | comments | ask | show | jobs | submit login

Xcode has handled this for years. In Xcode, when autocompletion is presented, hitting Tab will complete the longest unique prefixed subword for the currently-selected tab item. If this results in only having one completion option left, then it completes the whole thing (e.g. adding method arguments and whatnot). Similarly, hitting Return will just complete the whole entry instead of the longest unique prefixed subword.

By that I mean if you have 2 autocompletion options `addDefaultFoo()` and `addDefaultBar()`, and you type `add` to get those options, hitting Tab will fill in `addDefault`, and then hitting Tab again will fill in the rest of the selection.




*nix shells typically do something very similar, where hitting tab auto-completes up to the first forking character


After recently binge-watching The Good Place, this comment rattled me :)


Lol, I wasn't the only one!

Which is The Good Place of computer languages?


Lisp? Up front appears to be written with one thing in mind: Infuriate you with brackets.

Then, once you've worked out how to deal with the brackets, it's pretty forking sweet.


Never seen The Good Place so I'm just trying to figure out what the frak you all are taking about.


The longest-unique-prefixed-subword is the completion that bash (and tcsh and many other shells) have had for ~30 years now. The non-uniques are listed on the 2nd tab.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: