Skip to content

Using template-hint.js with current CodeMirror? #10

@JanWielemaker

Description

@JanWielemaker

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions