You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is the thing:
When creating/loading the a javascript file, YCM/Tern does not look for .tern-project in the current working dir, but in the initial dir (in which vim started). This is annoying when working with multiple projects that need different Tern configurations.
System: Windows 7 x64, GVIM 8.01272 x64 (tux), python 3.6 x64, YCM latest (fresh reinstall, just in case)
(Haven't tested on linux)
Steps to reproduce on Windows:
Make sure gvim starts in a folder other than the javascript project's. (Right-click on gvim shortcut -> "Properties" -> "Start in:").
Create a folder testproject and put a .tern-project file in it.
From gvim :cd testproject and :e testfile.js (a new file). See the error message:
Warning: Unable to detect a .tern-project file in the hierarchy before C:\path\to\our\initial_folder and no global .tern-config file was found. This is required for accurate JavaScript completion. Please see the User Guide for details.
This error should not occur. YCM/tern tries to find .tern-project in our initial directory (the one gvim was started in - as seen from the error message), even though we :cd'd into another dir containing .tern-project file.
The error is sometimes swallowed by vim, but still present in YCM errlog. When this happens, I confirm that Tern could not locate the .tern-project file (by feeding a .tern-project with non-existing library on purpose, and checking for an error in Tern's log - normally it would be there).
Also found a workaround: :YcmResartServer after :cd'ing.
Attached are all the logs/info files as requested in the prelude.
Thanks for the report. The documentation was mentioning the following:
Multiple Tern servers, are not supported. To switch to a different JavaScript project, you can do one of the following:
start a new instance of Vim from the new project's directory
change Vim's working directory (:cd /path/to/new/project) and restart the ycmd server (:YcmRestartServer)
change Vim's working directory (:cd /path/to/new/project), open a JavaScript file (or set filetype to JavaScript) and restart the Tern server using YCM completer subcommand :YcmCompleter RestartServer.
but the second method was not working. We fixed that in PR ycm-core/ycmd#875 as well as the issue you reported and updated the docs. Can you confirm it is now working as expected (after updating YCM)?
I confirm it now works exactly as expected (and described in docs), including searching the parent directories for .tern-project file and not being dependent on vim's initial starting dir.
Thank you very much for the fix!
Again, great job!
Issue Prelude
[x] Tick to all the boxes
The issue itself
Hi guys! First of all big thanks for your code!
Here is the thing:
When creating/loading the a javascript file, YCM/Tern does not look for
.tern-project
in the current working dir, but in the initial dir (in which vim started). This is annoying when working with multiple projects that need different Tern configurations.System: Windows 7 x64, GVIM 8.01272 x64 (tux), python 3.6 x64, YCM latest (fresh reinstall, just in case)
(Haven't tested on linux)
Steps to reproduce on Windows:
Make sure gvim starts in a folder other than the javascript project's. (Right-click on gvim shortcut -> "Properties" -> "Start in:").
Create a folder
testproject
and put a.tern-project
file in it.From gvim
:cd testproject
and:e testfile.js
(a new file). See the error message:Warning: Unable to detect a .tern-project file in the hierarchy before C:\path\to\our\initial_folder and no global .tern-config file was found. This is required for accurate JavaScript completion. Please see the User Guide for details.
This error should not occur. YCM/tern tries to find
.tern-project
in our initial directory (the one gvim was started in - as seen from the error message), even though we:cd
'd into another dir containing.tern-project
file.The error is sometimes swallowed by vim, but still present in YCM errlog. When this happens, I confirm that Tern could not locate the .tern-project file (by feeding a
.tern-project
with non-existing library on purpose, and checking for an error in Tern's log - normally it would be there).Also found a workaround:
:YcmResartServer
after:cd
'ing.Attached are all the logs/info files as requested in the prelude.
Minimal _vimrc:
ycmd_50433_stdout_rj_qxqvq.log
ycmdebuginfo.txt
tern_50447_stdout_rcs9z95a.log
vim-version.txt
ycm_1c013g7g.log
ycmd_50433_stderr_4d6ezzd_.log
dot_tern-project.txt
The text was updated successfully, but these errors were encountered: