ternjs / tern_for_sublime

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

Connection reuse error #153

Closed easyfrog closed 7 years ago

easyfrog commented 7 years ago

Make sublime into background(switch to other app) and wait a while. Go back to sublime and type some codes to invoke completion then give me a Error alert dialog.

If pressed "Cancel" it will shown every time I type "."
Must restart the sublime to resolve it.

reuse

karolyi commented 7 years ago

same here, can confirm.

it's the background process that dies for some reason. trying to start it in debug mode and post tracebacks here.

marijnh commented 7 years ago

The server intentionally shuts itself down after 5 minutes, by default. But the plugin should try to restart it before bothering the user with an error, which is apparently broken.

easyfrog commented 7 years ago

change tern.py line 268:

from : raise Req_Error((hasattr(error, "read") and error.read().decode("utf-8")) or error.reason) back to : raise Req_Error(error.read().decode("utf-8"))

just give me a time out alert dialog and close it could continue use. don't need restart sublime.

marijnh commented 7 years ago

change tern.py line 268:

That line doesn't look like that anymore in the current source code.

easyfrog commented 7 years ago

Right it is: raise Req_Error((hasattr(error, "read") and error.read().decode("utf-8")) or str(error.reason))

But how to avoid this issue?

marijnh commented 7 years ago

Could you try with patch b3c1b3a ?

easyfrog commented 7 years ago

Could you try with patch b3c1b3a ?

Yeah~ its just TIME OUT alert dialog now. do not need restart.

But this TIME OUT dialog is also annoying.