ternjs / tern_for_vim

Tern plugin for Vim
MIT License
1.83k stars 100 forks source link

Tern not respecting .tern-config in home directory. #190

Closed natealcedo closed 6 years ago

natealcedo commented 6 years ago

Tern does not provide auto completion with a custom NODE_PATH when loading a global .tern-config in the home directory. I just did a reinstall of my vim with and am using YouCompleteMe which uses tern. Previous to this installation, I was able to do something like this NODE_PATH=src vim . and I would be able to get auto completions and tern would be able to find files. If I do a :TernDef, the files are not found.

With this reisntall though this is no longer the case and I now have to copy over my .tern-config from my home directory into my project directory as .tern-project to get the same behaviour.

Take a look at these pictures. the Tern config points to the one in my home directory. global

No auto complete is provided. local-no-complete

However when I use a local .tern-project. local

Things work as usual. local-complete

I only noticed this behaviour because I had to setup my computer fresh. I usually save my dotfiles and have a script that copies them over. So on my other machine, everything works perfectly. But on a fresh install it doesnt work.

They are exactly the same file. I just copied it over doing something like this. cat ~/.tern-config >> .tern-project

This is what my current config file looks like

{
  "plugins": {
    "es_modules": {},
    "node": {},
    "modules": {}
  },
  "libs": [
    "ecma5",
    "ecma6",
    "browser"
    ],
    "ecmaVersion": 6
}
natealcedo commented 6 years ago

Realised this wasnt an issue with tern and more to do with YouCompleteMe. Closing.