Skip to content

Tern & CordovaJS support

angelozerr edited this page Dec 10, 2014 · 16 revisions

tern-cordovajs provides the cordovajs Tern plug-in which gives a support for Cordova.js. (we hope that the official tern.js whill host this plugin).

After installing and converting your project as Tern Project (see Tern-Eclipse-IDE), open Project Properties, click on Tern / Modules item and select the cordovajs tern plugin :

Check CordovaJS Plugin

After that you can benefit with cordova.js completion for cordova object as well as on other variables and methods provided by CordovaJS:

Completion For Cordova Object

Tern is able to provide the the content assist on cordova object's members:

Completion on Cordova Object

CordovaJS & Web Browser

tern.js can be used inside a WebBrowser. It exists a CodeMirror Addon which is enable to plug tern with CodeMirror.

If you wish to see in action CordovaJS & CodeMirror, you can play with the online demo at http://codemirror-java.opensagres.eu.cloudbees.net/codemirror-JavaScript/demo/cordovajs.html

Here a screenshot of CordovaJS completion with CodeMirror :

Completion with CodeMirror

Clone this wiki locally