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) :
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 :
Guess parameter types
tern-guess-types was improved to support multiple type. If you open tern completion for string
and select replace
:
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 :
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 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:
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:
Dojo 1.10
Dojo 1.10 support is now available. Completion on AMD module is available :
jQuery UI
Add a support for jQuery UI :
For more information, please read jQuery UI.
jQuery Mobile
Add a support for jQuery Mobile :
For more information, please read jQuery Mobile.
QUnit
Add a support for QUnit :
For more information, please read QUnit.
Bootstrap
Add a support for Bootstrap :
For more information, please read Bootstrap.
Google Charts
Add a support for Google Charts :
For more information, please read Google Charts.
three.js
Add a support for three.js :
For more information, please read three.js.
Chrome Extension API
Add a support for Chrome Extension API :
For more information, please read Chrome Extension API.
Appcelerator Titanium
Add a basic support for Appcelerator Titanium :
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 :
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 :
If you execute completion, you will see none result :