I happen to use slightly less fancy and expensive GPT-2 based autocomplete, and it's amazing. https://tabnine.com
let lo = 0;
let hi = vec.len();
let mid = lo + (hi
will autocomplete to `(hi - lo) / 2` as the second autocomplete option (so I'd hit tab twice). If you were to "score" it based on top-5 it'd probably be pretty bad at guessing my intent, but then again, I get to _opt-in_ to suggestions so it just needs to be right often enough, as it doesn't bother me much to keep typing.