Javascript - Lint + Hint with Tern demo
This demo shows in action the lint feature and a powerfull hint with Javascript by using
Tern
. If you press Ctrl+Space a hint panel show the code suggest. It uses 3 CodeMirror addons :
"Official CodeMirror" addon/tern/tern.js
is a CodeMirror addon to use Tern (completion about variables, methodes etc).
addon/hint/tern/tern-extension.js
extends the CodeMirror Tern addon to display/insert signature functions.
addon/hint/javascript/javascript-templates.js
is a CodeMirror addon to manage javascript (Eclipse like) templates completions (snippets).
addon/hint/tern/tern-hover.js
is a CodeMirror addon to manage javascript text hover.
var arr = []; arr. // do Ctrl+Space here to open completion with array method. It uses the CodeMirror Tern addon for // do Ctrl+Space here to open templates (snippet). It uses the CodeMirror Javascript templates addon var i = 0, j = 10, s1 = ""; s1.cha