Closed Raynos closed 11 years ago
git allows you to set a global gitignore file
Indeed. This is trivially solvable on the git side. Having the files makes it possible for different editor processes to share one Tern process, which I think is an advantage.
@jkroso I've found that all my repos have local .gitignore
files which don't ignore .tern-port
and thus ignore my higher up .gitignore
files.
@marijnh can we move the file somewhere else like in ~/.tern/
? One of my projects had 5 different .tern-port
files in various nested folders.
its a setting in your global .gitconfig file. $ git config --global core.excludesfile ~/.gitignore
should do it.
Yeah using a global gitignore does do the trick. It's still ugly to litter my code with files. We should find another way to achieve this
my editor allowed me to do the same trick so I don't even know they are there
hiding the problem doesnt solve them. My file system is not a place you can dump junk in.
SVN made the same mistake and Git got it right. :wink:
hiding the problem doesnt solve them. My file system is not a place you can dump junk in.
Taking this kind of confrontational approach here doesn't help at all. It makes people less motivated to help, and ruins the atmosphere.
The Tern server should delete the .tern-port file when it exits. If it's not doing that, that's a bug we should investigate. The fact that you're seeing several such files suggests that you didn't create a .tern-project file -- if you do, Tern will consider the directory holding that file to be the root of the project, and keep the port file there, reusing server instances if multiple editors are open for the project.
Using ~/.tern/port
does not work, as it is possible for multiple projects, and thus multiple servers, to be open at the same time.
See attached patch. The new code in the vim plugin that killed the server on exit was indeed preventing the server from cleaning up its port file.
If you're on windows, the problem might still exists, since I'm not really sure what happens to the process when taskkill is called on it.
Oh, wait, this is about Sublime, not Vim. Ignore my muttering about 'attached patch'. The Sublime mode simply lets the servers shut down on their own after 5 minutes of inactivity.
@marijnh the attitude doesn't help, sorry.
Can there be an option to opt-in to not using the tern file? I presume sharing only matters if you use multiple editor processes, my work flow generally only involves a single editor.
See commit b60b72c99bdcc6125b81ada40d973da6221bd1f0 and the past few commits in the Tern repository.
If you upgrade both tern_for_sublime and tern itself (delete tern_for_sublime/node_modules
and do npm install
again), you can set the option "tern_arguments": ["--no-port-file"]
to get rid of the port files.
Sweet! Am I correct in thinking that as long as I have only one instance of sublime open it only creates a single tern server per tern project?
Yes, the ST plugin will internally reuse the port.
@marijnh awesome! Thanks.
@marijnh Where does one set the option "tern_arguments": ["--no-port-file"]
?
If there was a way to not create .tern-port files it would make using this a lot easier.
It's annoying for my git flow to have git status filled with .tern-port files