Skip to content

Tern & Tabris support

angelozerr edited this page Nov 28, 2014 · 13 revisions

tern-tabris provides the tabris Tern plugin which gives a support for tabris.js - native apps in JavaScript.

After installing and converting your project as Tern Project (see Tern-Eclipse-IDE), open Project Properties, click on Tern / Modules item and select the travis.js tern plugin (EcmaScript5 tern plugin must be selected too) :

Check Tabris Plugin

Completion

After that you can benefit with tabris.js - native apps in JavaScript completion :

Tabris Completion

The this of function listener is recognized as tabris widget :

Tabris this Completion

The widget get method waits a parameter name which returns a value. For instance

  • get('text') returns a string :

Tabris get text Completion

  • get('bounds') returns a bounds object :

Tabris get bounds Completion

Lint

You can validate your tabris code by using the tern plugin lint. After checking the lint plugin, you can see error :

  • for invalid argument:

Invalid argument lint

  • or unknown property:

Unknown property lint

Clone this wiki locally