ternjs / tern_for_sublime

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

Auto completion for unsaved buffers #132

Closed idiotWu closed 7 years ago

idiotWu commented 8 years ago

Currently this plugin only works if the file has been saved on disk. It would be helpful for it to work on unsaved buffers.

marijnh commented 8 years ago

You mean buffers without a filename associated with them? The issue is that the plugin has no way where to look for a project config file, and how to divide such files into projects. Of course, it could spawn a default, per-file Tern server in that case. If you want to work on this, a pull request that implements such a thing (taking care to clean up such temporary servers when the file is saved) would be welcome.

idiotWu commented 8 years ago
  1. The plugin has no way where to look for a project config file

In my case I created a ~/.tern-config file so the plugin will use it as default config. So I wonder if we could search in HOME directory when dealing with these buffers?

  1. How to divide such files into projects

I think firing up a per-file server will be OK :)

However I know little about python, it would be hard for me to modify the codes 😅

idiotWu commented 7 years ago

@marijnh hey bro, I think this issue has been resolved in #141. Now it works like a charm!