Codemirror autocompletion breaks at dot

I use Codemirror to autocomplete some predefined words separated by dot charachters e.g. “user.payment” or “user.job.location”. The autocompletion feature works fine if I don’t use a dot a charachter, but it breaks when I type for example “user.”. How can I make it work?

I use show-hint.js and I modified the python-hint.js to define the predefined words.

Thank you.

You’re probably tokenizing the words to complete incorrectly. python-hint.js isn’t in the distribution anymore (since it was buggy and not doing anything that hintWords doesn’t already do). Maybe simply try defining hint words for your language:

CodeMirror.registerHelper("hintWords", "your/mime-type", ["user.payment", "user.job.location"])

But you’ll also have to ensure that your mode treats dot-separated words as a single token, since the hintWords hinter also uses the mode tokens.

Thank You for the quick answer. I’ll try to do it.