我想使用 CodeMirror 的 AutoComplete,但出现错误:
未捕获的类型错误:无法读取未定义的属性“javascript”
CodeMirror.commands.autocomplete = function(cm) {
CodeMirror.showHint(cm, CodeMirror.hint.javascript); // Error Here
}
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
extraKeys: {"Ctrl-Space": "autocomplete"}
});