No definition found when issuing "TernDef" command
Hi All, I installed this plugin as it's mentioned in the tutorial. (Using Vundle to load,running npm install in .vim/bundle/tern_for_vim/) and below is my .tern-project configuration file. but i got No definition error while running TernDef for a function inside a javascript file. Any ideas? Thanks in advance. { "libs": [ "browser", "jquery", "ecma5", "underscore" ], "plugins": { "requirejs": { "baseURL": "./", "paths": {} } } }
isn't it .tern-project and not .tern_project?
Thank u @shawndumas . it's typo. I did use .tern-project.
Can you show us an example of a file (plus the point where you're trying to get the definition) that fails?
Thanks @marijnh . they are just two normal javascript files like foo.js and bar.js. In foo.js, there is a function fun1 that references fun2 defined in bar.js. When i am trying to jump to fun2 from fun1, i got "no definition found". I tested, it could jump to symbol definition correctly within one file, but didn't work across multiple files. I also added loadEagerly in .tern-project to load all the related javascript files, but still with no luck.
Works for me. Which is why I asked you to provide the actual files. Here are mine:
foo.js
function a() {
b();
}
bar.js
function b() {
return 10;
}
.tern-project
{
"loadEagerly": ["foo.js", "bar.js"]
}
I used the exactly the same files as you provided above. see my screenshot attached. always got no definition found. I opened two files in vim and add them to .tern-project to make sure they are loaded by tern. but it didn't work anyhow.
Hi @marijnh , I added a log in respond function of tern script and found that data returned is undefined which is supposed to be an object for above query. any suggestion to troubleshoot the problems? thanks
Which version of Tern are you using?
I am using tern 0.5.0 and my node version is v0.10.24