ternjs / tern_for_sublime

Sublime Text package adding Tern support
MIT License
803 stars 54 forks source link

Request option to set default libs for tern #116

Closed ghost closed 8 years ago

ghost commented 8 years ago

I just switched from TernJs to this plugin, but autocomplete seems not working outside project. It require .tern-project file.

Is there any option to define default libs for all javascript files as TernJs ?

tansongyang commented 8 years ago

According to the docs, you should be able to specify a .tern-config file in your home directory with the same format as a .tern-project file. However, I just tried this and it doesn't seem to be working.

@marijnh I'm looking at tern.py, and I see that, in the project_dir function, we look for a .tern-project file and stop if we can't find it. Is this a bug? Should this code be replicating the logic in tern to pick a default config?

ghost commented 8 years ago

@tansongyang i got it, but it makes config fragmentation, i just switch back to TernJs, it can be config in ST3

tern_for_sublime check .tern-config in node tern bin folder.

marijnh commented 8 years ago

Is this a bug?

No. The server will read ~/.tern-config, the editor plugin doesn't need to know about this.

@ptcong Does using .tern-config help? Can this be closed?

ghost commented 8 years ago

Yes, it will be resolved, but it seems make config fragmentaion, why don't you make it as ST3 settings ?

marijnh commented 8 years ago

Because that would only work in Sublime Text.