carlitux / deoplete-ternjs

deoplete.nvim source for javascript
MIT License
277 stars 24 forks source link

Does .tern-project file have to be open? #60

Closed ctaylo21 closed 6 years ago

ctaylo21 commented 6 years ago

I've has some issues getting this plugin to work. It worked initially when I set it up, then stopped working later. I just got it working again by opening up the .tern-project file (and not changing anything). My tern project file is very custom as it defines a requirejs config setup. This was confusing until I saw this in the docs:

If no .tern-project file is found in the current buffer's directory that is being edited or its ancestors, deoplete-ternjs will start the ternjs server in the current working directory:

Does this mean the .tern-project file will have to be open in Vim for deoplete to work? Is that by design?

carlitux commented 6 years ago

No, .tern-project should be in projects' root directory. If vim crashes or closed dirty tern has not clean stop so the file .tern-port is not removed by tern.

You have to remove the file by hand other wise will use the port in that file. This is required because some users use tern_for_vim and this source tries to use same tern instance server.

Also ternjs could late depending on the config and some files are not completing. There days for me jest test files were not completing.

ctaylo21 commented 6 years ago

Thanks for the quick response. I guess I'm just seeing a lot of finicky behavior that is odd. It could just be issues with Tern. When I opened up my editor today, it's auto-completing the object's methods correctly now. Yet other methods don't work like I expect they would. I will close this issue.