Autocomplete hints for phrases with white space

I’m trying to implement a custom hint function where I pass my own list of keywords etc. to be shown in autocomplete window. However I also have some keywords(eg. “First Name”) with white spaces between them and I want them to appear in this dropdown. This seems to work at start :


However, when I type after white space there’s no match :


This is probably because of the way hinting picks the token at current cursor(doesn’t include white spaces). Are there any APIs available to by-pass this behavior and include white space phrases in autocomplete list. Any related examples that might help are also appreciated.

Which hint source are you using? The one that uses hintWords helper values does indeed assume you’re working with single words.

I currently using the hinting in sql-hint.js.
Are there any hinting logics in api that don’t assume only single words?

I’m not aware of an example, but the hint source is free to select a region bigger than a single word to complete (it has direct access to the editor, doesn’t need to look at just a single token). You might also have to change the closeCharacters setting to the show-hint addon to allow typing spaces without closing the widget.