Autocomplete hints for phrases with white space


#1

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 :

Untitled1

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

Untitled

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.


#2

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


#3

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


#4

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.