CodeMirror-XQuery icon indicating copy to clipboard operation
CodeMirror-XQuery copied to clipboard

Using template-hint.js with current CodeMirror?

Open JanWielemaker opened this issue 11 years ago • 0 comments

I'm trying to use the template-hint.js in an arbitrary mode (prolog). I'm still pretty much new to the CodeMirror code base. I have the impression though that template-hint.js does not work with the current CodeMirror as hinting tools are now registered using registerHelper(). Stepping through CodeMirror.showHint(), shows it steps through the helpers, cannot find the template helper and gives up.

All I do is simply load template-hint.js and the css files, bind Ctrl-Space to "autohint" and define this as

CodeMirror.commands.autohint = function(cm) {
    CodeMirror.showHint(cm, CodeMirror.templateHint, {async:true});
}

Anything trivial I'm missing, or does template-hint.js need rewriting?

P.s. appears that hinters are functions that return an object holding a list of completions, and the from and to locations of what is completed. Is this a fundamentally different interface?

I think this post is relevant: https://groups.google.com/forum/#!topic/codemirror/cOc0xvUUEUU

JanWielemaker avatar Oct 21 '14 13:10 JanWielemaker