Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No definition found when issuing "TernDef" command #45

Open
larryhe opened this issue Oct 29, 2013 · 9 comments
Open

No definition found when issuing "TernDef" command #45

larryhe opened this issue Oct 29, 2013 · 9 comments

Comments

@larryhe
Copy link

larryhe commented Oct 29, 2013

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": {}
}
}
}

@shawndumas
Copy link

isn't it .tern-project and not .tern_project?

@larryhe
Copy link
Author

larryhe commented Oct 29, 2013

Thank u @shawndumas . it's typo. I did use .tern-project.

@marijnh
Copy link
Member

marijnh commented Nov 11, 2013

Can you show us an example of a file (plus the point where you're trying to get the definition) that fails?

@larryhe
Copy link
Author

larryhe commented Jan 27, 2014

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.

@marijnh
Copy link
Member

marijnh commented Feb 13, 2014

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"]
}

@larryhe
Copy link
Author

larryhe commented Feb 13, 2014

screen shot 2014-02-13 at 10 25 36 am
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.

@larryhe
Copy link
Author

larryhe commented Feb 13, 2014

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

@marijnh
Copy link
Member

marijnh commented Feb 14, 2014

Which version of Tern are you using?

@larryhe
Copy link
Author

larryhe commented Feb 14, 2014

I am using tern 0.5.0 and my node version is v0.10.24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants