by jps on Thu Jun 04, 2009 12:13 pm
I don't think the prefix should matter: The callback is given a view, and a position within the view, so it can inspect as much of the buffer as it wishes to generate the completions. The prefix passed in is just an informative item identifying what text will be removed before the completion is inserted (i.e., it should generally be the case that all returned completions will start with the prefix).
My tentative plan is to have the completion callback return a tuple of (display, command) strings, instead of the single string it does presently: the 'display' value is what's shown in the menu, and the 'command' value is the command that will be run, which will allow using insertInlineSnippet.
This isn't quite as flexible as allowing callback functions to be associated with each completion, but does ensure that undo groups will be setup properly, and that repeat, macros etc will work with the selected entry.