Local implementation of autocompletion