If you do not specify a hint function, the show-hint addon will take the hint helper function defined for the local mode at which the completion happens, so that will be CodeMirror.hint.javascript
in JavaScript
code, and CodeMirror.hint.html
in HTML.
If you need to add your own completion logic, you can replace (or wrap) these functions by simply overwriting them with your own code.
Here is a crude example hack that always adds "bozo" to JavaScript completions:
var orig = CodeMirror.hint.javascript;
CodeMirror.hint.javascript = function(cm) {
var inner = orig(cm) || {from: cm.getCursor(), to: cm.getCursor(), list: []};
inner.list.push("bozo");
return inner;
};