Autocompletion in Diavolo, my source code editor, is almost done. It's as usual defined in an XML grammar, and it's smart enough so it can depend on the value of a previous token. Arrow and page keys allow to navigate in the popup, tab key or click selects the current option, escape closes the popup. See by yourself: