New and Noteworthy 0.10.0 - angelozerr/tern.java GitHub Wiki

Here's a list of the most noteworthy things in the tern.java 0.10.0 release which is available for download since 18/06/2015. You can see issues for 0.10.0

Icon for completion & hover

Completion & hover icon is generated at runtime by merging the origin module (YUI, Node, etc) and the JavaScript type (Sting, Number, Boolean, Array, Function) :

YUI submodules completion

Multi types support

ternjs is now available to support multiple types. For instance String#replace have a pattern parameter which can have 2 types :

  • string
  • or RegExp

Hover

The hover displays the multiple types :

Tern hover multi types

Guess parameter types

tern-guess-types was improved to support multiple type. If you open tern completion for string and select replace :

Tern completion multi types

When you apply completion, tern guess types gives the capability to retrieve variables, functions for each function parameters. Here a screenshot which shows a list of variable with string type for the pattern type argument :

Tern guess types multi types

JSDoc Support options

JSDoc Support can be configured with 2 options :

  • strong : can be set to true to assign a higher-than-default weight to the types it finds in comments, and thus overrides inferred types.
  • fulldocs : can be set to true to return the full comment text instead of the first sentence.

YUI & AlloyUI improvement

YUI & AlloyUI modules

YUI and AlloyUI tern plugins supports now completion and validation for both modules (eg : aui-tree) and submodules (eg : aui-tree-data) :

YUI submodules completion

YUI Class extension & mix

Anim class extends Base which provides none methods/properties but which uses several classes like BaseCore, AttributeCore. The tern plugin is able to mix BaseCore, AttributeCore methods/properties in Base to provide for instance addAttr:

AlloyUI Anim & Mix

A.Node Augments

AlloyUI A.Node augments the YUI3 Node with more util methods. The tern plugin is able to mix YUI3 node with AlloyUI A.Node to provide for instance ancestorsByClassName:

AlloyUI augments node

Dojo 1.10

Dojo 1.10 support is now available. Completion on AMD module is available :

Dojo AMD module

jQuery UI

Add a support for jQuery UI :

jQuery UI Completion

For more information, please read jQuery UI.

jQuery Mobile

Add a support for jQuery Mobile :

jQuery Mobile Completion

For more information, please read jQuery Mobile.

QUnit

Add a support for QUnit :

QUnit Completion

For more information, please read QUnit.

Bootstrap

Add a support for Bootstrap :

Bootstrap Completion

For more information, please read Bootstrap.

Google Charts

Add a support for Google Charts :

three.js Completion

For more information, please read Google Charts.

three.js

Add a support for three.js :

three.js Completion

For more information, please read three.js.

Chrome Extension API

Add a support for Chrome Extension API :

Chrome Extension API Completion

For more information, please read Chrome Extension API.

Appcelerator Titanium

Add a basic support for Appcelerator Titanium :

Titanium Completion

For more information, please read Titanium.

Completion guess

Your project uses somes tern modules. For instance if you use browser support and you execute the completion like this :

Completion guess true

You can see methods of getElement of DOM node in the completion although the a variable is not a DOM node, why? It's because default guess of completion :

When completing a property and no completions are found, 
Tern will use some heuristics to try and return some properties anyway. 
Set this to false to turn that off.

Now you can change the guess value with Tern / Completion project properties :

Completion guess true

If you execute completion, you will see none result :

Completion guess false