uplus / deoplete-solargraph

deoplete.nvim source for Ruby with solargraph.
MIT License
74 stars 6 forks source link

Fix stale solargraph server processes issue and some minor changes. #3

Closed halftan closed 6 years ago

halftan commented 6 years ago
iovis commented 6 years ago

Does this PR solve the orphan server processes problem? That's the thing preventing me from using this plugin!

halftan commented 6 years ago

@iovis9 yes. It's stated as 'stale solargraph server process'. The problem is resolved by adding a __del__ method to the Source class which just calls server.stop() to kill the server process.

The original intent to kill server processes is implemented by capturing and responding to a SIGTERM signal (see here), which is not feasible due to the async plugin architecture used by neovim/deoplete, the signal simply won't be sent to the python process that holds our deoplete source class. I guess we can use neovim's job control mechanism but it's more complicated to implement so I just used the destructor method.

uplus commented 6 years ago

Thank you for sending PR! Sorry for the late review.

It tried the same solution before, but it did not solve it in my environment. Python does not guarantee to call __del__ when the interpreter exits.

In my environment the following PR solved the problem. https://github.com/uplus/solargraph-utils.py/pull/2 Please pip install --upgrade solargraph-utils.py.

iovis commented 6 years ago

Would it still make sense to consolidate the python code into the plugin? I'd love it if it didn't need an external dependency!

uplus commented 6 years ago

This PR contains multiple fix. I do not want to merge it. Please split and send PR individually.

Issue made about external package dependency.

6