Skip to content

Tern & Tabris support

Angelo edited this page Sep 9, 2015 · 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, go at [Tern project property](Tern-Eclipse-IDE#tern-project-properties, click on Tern / Modules item and select the tabris.js tern plugin (ECMAScript 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

tabris#create

Completion provides methods of tabris like create method :

Tabris Completion Create

Completion provides Widget and Action type :

Tabris Completion Create

tabris Widget

Completion provides methods of Widget like on method :

Tabris Completion Widget

this

The this of function listener is recognized as tabris widget :

Tabris this Completion

properties

Completion provides available properties for get method :

Tabris Completion Properties

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

Hover

Tabris hover

Web Browser

You can play with online demo which uses CodeMirror (inside Web Browser).

Clone this wiki locally