-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Tern not respecting .tern-config in home directory. #2857
Comments
That's because we changed which working directory is used by Tern when a Honestly, I didn't think of that use case when implementing the changes in PR ycm-core/ycmd#875 (I thought the working directory didn't really matter when a |
So for this to work as I expect I just have to do this |
Rather |
Ah I see. Is this something that you guys will consider reverting? I use NODE_PATH in my projects which help to make imports easier since I don't have to do deep nested imports and it's a cleaner approach. |
Yes. See PR ycm-core/ycmd#886. We are even going to improve the behavior by handling the scenario where the user want to switch to another project without a
Users currently have to restart the ycmd server for this to work:
|
Ok that is great news. Thanks for the quick response! Looking forward to this PR being merged :) |
For those who are facing this issue and want a short NODE_PATH that is generic enough you can do something like this provided you open vim in the repo directory |
…puremourning [READY] Use current working directory in JavaScript completer Use the Client working directory instead of the home directory when no `.tern-project` file is found. If no working directory is given (no `working_dir` field in the request), we fall back to ycmd working directory. See issue ycm-core/YouCompleteMe#2857. Once this is merged, we'll update YCM to always include the working directory in the request as done in PR ycm-core/YouCompleteMe#2827. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/ycmd/886) <!-- Reviewable:end -->
Since the pull request fixing this issue has been merged I'm going to close this issue. Thanks @micbou |
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.
No auto complete is provided.
However when I use a local .tern-project.
Things work as usual.
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
The text was updated successfully, but these errors were encountered: