Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
You can see the online tern demo which uses tern in Web Browser with CodeMirror.
If you want to use :
- AngularJS please install AngularJS Eclipse which is based on tern.java.
Tern IDE is developped/tested with Eclipse 4.5 (Mars). It is advised to use this Eclipse version (even if Tern IDE could work with older version of Eclipse).
To install Tern IDE, please read Installation - Update Site section.
When you will use Tern IDE update site you will see that:
You must select:
- Tern - Embed Node.js if you have not node.js installed on your computer. Node.js is required to execute tern.js.
- Tern IDE to use tern with Eclipse IDE.
- Tern - Tooling if you want to generate tern plugin, JSON Type Definition or Web Browser editor (CodeMirror, Ace, Orion) with tern. For more information please read Tern Toolings
Now you must convert your project to Tern Project :
This section is about "global preferences" dialog that you open with Window/Preferences.
- use your installed node.js. For that, you must select the "Native node" install type and select the well node file :
when the native node is selected, it searches node binary in default folders installation (ex : "C:\Program Files\nodejs\node.exe" for Windows) and if it doesn't find, it searches in your node in your "PATH" environment.
If you wish to download and install node.js, it's important to restart your computer before using Tern IDE in order to your OS update correctly your "PATH" environment with your installed node.js.
- use an embed node. For that you must install the well embed node.js according your OS :
This section is about "project properties" dialog which is available if you select your project and use "Properties" menu item of the contextual menu (or Alt/Enter).
Here a list of available tern modules :
- Dojo Toolkit
- JSDoc Support
- YUI Library
- Linter (Validator)
You can select a tern module by clicking on the Tern / Modules item :
For more information, please read Tern Script Path
Tern IDE provides several linter like ESLint, JSHint. Please read Tern Linter section for more information.
At this step we have finished to configure Tern IDE Eclipse, now it's time to check that everything works (tern with node.js is well configured).
var arr = ["a", "b"]; arr.
and try to open completion after dot of arr variable. It must show completion items for array :
This feature is managed by tern, if it doesn't work, see Troubleshooting section.
- Error log view.
- Tern console
Error log view
You can trace the start of node.js server and the request/response of the tern server by using the Eclipse console.
To do that, you must active the tern console for your project:
If you retry to execute completion for instance to use tern server, you will see the node.js command and the error in the console:
When you will have not problem, you can see the JSON request/response of the tern server when it is use it:
See Tern Console for more information.
If you have again, problem, please create an issue here.