Questions tagged [tern]

Tern is a JavaScript code analyzer that is intended to improve the support a text editor has for JavaScript coding. Use this tag for questions about its function or how to add tern to the editor of your choice.

Tern is a JavaScript code analyzer which may be installed as a plugin to various text editors such as and and . It is designed to allow for added functions such as code completion and automatic refactoring when editing JavaScript.

More information is available at http://ternjs.net, and its source is available from https://github.com/marijnh/tern.

56 questions
19
votes
2 answers

Ternjs for nodejs autocomplete

I am trying to print autocompletion of a js file using nodejs and tern. Ternjs has the worst documentation i have ever seen. var tern = require("tern") var ternServer = new tern.Server({}) var requestDetails = { "query": { …
Abhishek Sharma
  • 1,415
  • 16
  • 30
16
votes
1 answer

Figuring out JavaScript libraries for Vim autocompletion with TernJS in .tern_project file

I love vim and want to keep using it to do web development although I am struggling setting up my .tern_project file with the correct libraries I need to do autocompletion. I am relatively new to JavaScript but what I have so far is making it a lot…
11
votes
1 answer

How to auto-generate Tern project files based on bower/npm?

I just integrated Tern with my editor of choice, and the experience has been pretty incredible so far. One thing that would make the experience all the more intuitive, however, would be the ability to tap into my existing front- and back-end…
user456584
  • 79,881
  • 11
  • 69
  • 105
9
votes
2 answers

Sublime Text - plugin_host exited unexpectedly after installing sublime_tern

I have installed sublime_tern package to help me with my MeteorJS development. After installing this package, any time I start Sublime I get: plugin_host exited unexpectedly. What can I do to troubleshoot this?
Eugene Goldberg
  • 11,384
  • 15
  • 81
  • 138
7
votes
1 answer

EcmaScript 6 - Tern IDE for Eclipse validation errors

I am using Eclipse Mars with the Tern IDE für ES6 support on version 1.1.0 (the snapshot). I get validation errors on arrow functions and const-exports as can be seen in this screenshot: I worked through these descriptions but the errors won't…
Ahab
  • 619
  • 1
  • 7
  • 15
5
votes
0 answers

How to setup tern-vim in my project?

I want to setup tern-vim in my project and followed this link https://github.com/ternjs/tern_for_vim/blob/master/doc/tern.txt. After installation, I created a .tern-project file under the root directory of my project as below. { "libs": [ …
Joey Yi Zhao
  • 23,254
  • 37
  • 138
  • 276
5
votes
1 answer

Using tern_for_vim plugin in HTML files

I'm trying to set up tern_for_vim plugin to have nice autocompletion in JavaScript. While editing ".js" files, "Ctrl+X Ctrl+O" gives nice semantic results, picking up the "backbone.js" and other libraries. However, when I'm editing a JS block inside…
dmytro
  • 1,215
  • 9
  • 20
4
votes
2 answers

Vim modeline in a JSON file

I'm trying to add the following vim modeline to my global .tern-config file: // vim: set ft=json: { plugins: { ... However, the Tern server fails to start, giving the following error: Failed to start server: Bad JSON in…
camden
  • 1,338
  • 14
  • 18
4
votes
1 answer

Emacs + tern plugin on mac os x "no such file or directory: tern"

I am using Mac Os X 10.11, I have a fresh installation of Emacs(Emacsformacosx.com), and I am trying to install tern plugin for javascript. I follow the simple commands: -npm install tern -g with el-get i install auto-complete and tern I copy the…
GDG612
  • 131
  • 1
  • 10
4
votes
2 answers

How to disable Tern synchronization in Eclipse Luna?

I use Eclipse Luna SP2 for Java EE for some JavaScript development. Every now and then (mostly on .js file open but also on some timer) I get the following popup error An internal error occurred during: "Synchronizing script resources with Tern…
Sergey
  • 1,292
  • 2
  • 16
  • 26
3
votes
3 answers

Tern: Synchronizing script resources with tern server

In JBoss Devstudio, I am getting this new "error" with Tern: Synchronizing script resources with tern server. It's not really an error, but it's a process that occurs every single time I click in a JavaScript file. It's just spinning and freezes…
UltraSonja
  • 881
  • 17
  • 30
3
votes
1 answer

Tern Autocomplete with Express

I'm using the tern_for_vim plugin for developing node applications. Currently various functions aren't displaying and I'm unsure why. For example: none of the html verb functions appear in the autocompletion list app.get (after assigning var app =…
tjenks
  • 236
  • 4
  • 12
3
votes
2 answers

CodeMirror with Tern - Custom "Types" with Javascript Intellisense

I am using tern to give some enhanced intellisense to a window that runs with CodeMirror, and it works fine, but I am having an issue where I would like to add some custom "types", so to speak, so that there can be icons next to them in the drop…
Ciel
  • 3,930
  • 8
  • 42
  • 103
3
votes
2 answers

ternJS - Generate JSON type definition file

ternJS have several. JSON files defs which contains the definition of librarys. Can someone explain to me how I can best generate my own to my javascript libraries / or only definition objects? I can not see that there is no common procedure for…
eriksv88
  • 3,260
  • 3
  • 25
  • 49
3
votes
2 answers

Could not start Tern server in Emacs

I have the latest version of Emacs and Tern but I have a problem with using the plugin. When I use any Tern-related commands I get this command from editor: Wrong type argument: listp, "Could not start Tern server env: node: No such file or…
Afshin Mehrabani
  • 28,405
  • 26
  • 117
  • 186
1
2 3 4