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
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
  • 33,262
  • 29
  • 136
  • 201
2
votes
1 answer

tern.js not loading three.js plugin

Problem I'm currently trying to build a 3D web app based on three.js. I'm using neovim as my development environment and YouCompleteMe as a completion system. I installed tern to complete JS, and I added .tern-project file like this. { "libs":…
sohnryang
  • 725
  • 2
  • 13
  • 27
2
votes
0 answers

Visual Studio Code Type Inference Linter

Is there any way to get Tern-Lint like functionality in VSCode for type warnings without having to write Typings for all of my code? Its already detecting what the param types of arguments should be & inferring types, but no warnings are thrown when…
ryanswrt
  • 21
  • 2
2
votes
0 answers

Get Tern type using its name

Tl;dr version: Using TernJS for autocompletion purposes, I want to use a rule on a function, that taking a string as parameter, in order to return a type with the name same with the param given, for example: foo("TypeA") returns +TypeA foo("TypeB")…
Nick Louloudakis
  • 5,856
  • 4
  • 41
  • 54
2
votes
1 answer

TernJS for Vim loading EmberJS

I am trying to use ternJS to autocomplete the ember library. I want to be able to do Ember. and see a list of all the functions and or properties. Here is what I have in my .tern-project file { "libs": [ "browser", "underscore", …
jrock2004
  • 3,229
  • 5
  • 40
  • 73
2
votes
1 answer

Tern JS for Vim using NVM

I'm trying to get Tern JS working in Vim on OSX 10.10.x. I'm currently using NVM and as the Tern JS documentation states you can't use NVM. Caution: Because the node process is not run using your standard shell, >the NVM version of node.js won't…
Jonte
  • 41
  • 2
2
votes
1 answer

tern auto-complete gives ac-show-menu (wrong-type-argument stringp nil)

I'm trying to get tern autocomplete working. I'm on OSX 10.10 Stacktrace: http://pastebin.com/FDSc2Ymv I found this link maybe regarding this issue: https://github.com/auto-complete/auto-complete/issues/309 My version of popup is latest (0.5.1) Here…
sangm
  • 81
  • 1
  • 7
2
votes
1 answer

CodeMirror - styling Tern intellisense labels

I'm using the Tern plugin for CodeMirror, which adds intellisense features to the editor (i.e. pops up inline hint-labels). I want to change the hint-labels style, how to do so?
Ciel
  • 4,290
  • 8
  • 51
  • 110
2
votes
4 answers

Tern auto-complete won't start automatically

When I enter "pars" in Emacs js-mode buffer and type tern-ac-complete, I get the desired result: list of completion candidates + the documentation next to the candidate. However, I cannot get Tern completion to be triggered automatically. The…
1
vote
0 answers

Ace tern editor. Make own autocomplete properties for unknown value

i have default.json file with properties. Example, { "!name": "test", "Commit": { "!doc": "test", "!type": "fn(connectionName: string, k: string) -> object" "default": { "!doc": "test", …
1
vote
0 answers

Tern function parameters: how do I specify an object with keys?

I have a Button function that accepts a few paramaters (name, label, onClick). I can set Button !type to be fn(name: string, label: string, onClick: fn()), but really it should be something like fn(config: {name: string, label: string, onClick:…
Jon Doe
  • 2,172
  • 1
  • 18
  • 35
1
vote
1 answer

Tern Fails to use JSDoc Type Information

I'm trying to use Tern to perform type inference on some Javascript code. However, the type inference doesn't seem to be using the JSDoc comments alongside the code. I'm using the code /** @type {Foo} */ let x; as an example of the problem. On the…
hkk
  • 2,069
  • 1
  • 23
  • 48
1
vote
0 answers

How to understand the ternjs framework

I am going to create a language specific tool to support hight-lighting, code completion etc and found ternjs is a good framework to use. I read the document from http://ternjs.net/doc/ but not quite understand how it works. Based on that document…
Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523
1
vote
0 answers

Eclipse Neon Tern on Ubuntu 16.04 javascript context assist only works after saving file

I have a javascript project converted to a tern project. Content assist was working fine until very recently. Now if I Ctrl-Space it still brings up the correct choices but when I press enter the screen scrolls downwards just past my current line…
reg1965
  • 147
  • 3
  • 8
1
vote
1 answer

Customizing ternjs for sublime text 3

I've installed tern_for_sublime for sublime text 3 following steps in github readme page of the project and autocomplete for core javascript functions like string functions are working.But browser DOM specific autocompletion is not available.I was…
socket_var
  • 1,063
  • 2
  • 11
  • 18