Questions tagged [tern]

11 questions
11
votes
1 answer

How to navigate a JavaScript project?

I'm currently working on a JavaScript project using Backbone.js and I wonder how can I navigate between files, based on method and object definitions. For example, I keep references to some of my views in the global object App.Views, and I would…
caisah
  • 4,056
  • 1
  • 23
  • 43
3
votes
2 answers

Refactoring javascript

How can I rename functions project wide? I am using spacemacs and also with tern, and it look like tern can only rename variables.
zer09
  • 185
  • 2
  • 7
3
votes
1 answer

Cannot jump to definition in js2-mode or Tern

I am performing Nodejs development in emacs, but my environment seems incorrect. For example, when I run ac-js2-jump-to-definition, I get "no jump location found" in the minibuffer. Also when I run 'tern-find-definition`, I get "No definition…
modulitos
  • 2,432
  • 1
  • 18
  • 36
3
votes
1 answer

Receive error when trying to use tern mode

I have installed tern use npm and install tern.el from melpa. I put the path of tern.el in my init file as per instructions on the emacs section of the tern homepage. However when I enable tern mode and try to run a command such as jump to…
user2522280
  • 939
  • 2
  • 7
  • 13
2
votes
1 answer

how to hook tern and web mode on certain files

I would like for tern to work only on React related files and Tern to only activate when working on React files with Web Mode turned on. Currently, I have tern generally set up with Web Mode, but the issue is that when I edit, let's say, a php file,…
user20304
2
votes
1 answer

How to set project-specific javscript indentation using js2-mode

I have several Javascript projects, where some projects use 2 spaces for indentation and other projects use 4 spaces for indentation. Is there a project-specific way to set the indentation? I am able to manually resolve this issue for each project…
modulitos
  • 2,432
  • 1
  • 18
  • 36
2
votes
1 answer

M-. and M-, in evil-mode

In normal mode I can't jump to definition with ternjs or cider modes. I have to go to insert then hit M-. Is that the evil way? Should I have M-. bound to another function that checks what mode you are in and does the proper thing accordingly?
Justin Thomas
  • 245
  • 1
  • 8
1
vote
1 answer

ELDoc and company-tern are not working properly in JS2-mode (.js buffer in node) and Javascript, in Emacs

In my Emacs configuration for JavaScript/ JS2-mode, specifically .js buffer in node: (1) company-tern and ELDoc are NOT working properly. For eg. when I type 'console.l', 'log' does not pop up, rather 'let' alone pops up (2) When opening the…
tom_kp
  • 81
  • 4
1
vote
1 answer

Tern stopped working! Request failed: ((wrong-type-argument url nil))

I just upgraded yesterday emacs from version 25.2 to 27.0.5. Now I am encountering this problem, any idea of how to fix it? This happens in some tern functions I try to use: tern-get-docs, tern-ac-complete...
user3347359
  • 327
  • 2
  • 7
0
votes
1 answer

How do I enable a mode, when another mode runs?

All I want to do is enable tern-mode, when I enter js-mode. I know that a hook called js-mode is run when I open a javascript file but for some reason tern-mode is not enabled. In my init.el file I have: (add-hook 'js2-mode-hook (lambda ()…
Startec
  • 1,354
  • 1
  • 13
  • 30
0
votes
1 answer

Angular and Tern.js - ReferenceError in angular.js

I'm trying to configure Emacs with Tern.js to use AngularJS in it. When add angular to .tern-project like: { "plugins": { "node": { }, "angular": { } } } and type app.| I get ReferenceError in Angular itself printed in…
foki
  • 886
  • 8
  • 22