-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to autoshutdown after killing last buffer #309
Conversation
This should close issue joaotavora#217, also cf. joaotavora#270. * eglot.el: New defcustom `eglot-autoshutdown' (default t). (eglot--managed-mode): Signal didClose before possibly triggering autoshutdown. (eglot--managed-mode-onoff): Shutdown if so configured and no managed buffers left.
Didn't know about that. But I would advise against closing your own PR, even if you think it's somehow "wrong". Just let it be and you can always rewrite the commtis of the branch. For me the PR is the idea. The implementation is a separate thing. |
Yeah, good advice, will heed that in the future. |
In all these years, it's the first time I see an actual use for the "depth" arg to The PR looks reasonably clean. You've obviously investigated enough, and this is one of the trickiest, if not the trickiest, part of Eglot. Two things:
|
Same here :) Relating that to your second point, I chose the depth argument on purpose, to make the order explicit from the call itself. Otherwise one has to think "backwards" (as in "this is added later, so it is prepended to the hook, so it runs first"). If you think re-ordering is clearer, go ahead, of course. As for your first item: Yes, that is my understanding. AFAICS, the This is a great example of the intricacies that I mentioned in the old PR: it's a bit tough to follow the logic, b/c the cache and the hash lose sync unnecessarily. As I said there, stuff for another PR. Regarding tests: if you spend time on the testing setup, a mock language server (in elisp, preferably) would be great. This way, we could test Anyway, |
You have a point, but we'll see. The
Oh I missed that last part, which makes sense. So I think this PR could be split into two commits bugfix/optimization + the new feature itself.
The onoff is a bit hacky, indeed. It is mostly there to reuse code but it could be broken off. Don't see an enormous need for it, though.
This is a good idea, but still so many things happen off-spec that I don't think it would be enough to abandon server-specific tests. Nevertheless, you'll find in
This is much appreciated! |
Sure. What would you consider the bugfix, the re-ordering in
My goal would be to get rid of it entirely (without code duplication). If I can do that (I think I know how), there'll be a PR for that soon.. |
yes. |
Ok, which solution do you prefer: depth or re-ordering (with comment)? If it's the same to you, I would keep it as posted. |
Come to think of it, re-ordering is better, else the didClose will usually go to the start of the hook and might be separated from onoff call.. |
This should close issue joaotavora#217, also cf. joaotavora#270. * eglot.el: New defcustom `eglot-autoshutdown' (default t). (eglot--managed-mode-onoff): Shutdown if so configured and no managed buffers left.
I prefer reorderning, but if you feel strongly about the
The thing is there is some subtletly to the |
…otavora#309) This should close issue joaotavora#217, also cf. joaotavora#270. * eglot.el (eglot-autoshutdown): New defcustom. (eglot--managed-mode-onoff): Shutdown if so configured and no managed buffers left. Co-authored-by: João Távora <[email protected]>
7efcf6b
to
1a180d3
Compare
It used to be the reverse way around, which doesn't make sense. * eglot.el (eglot-managed-mode): Fix order in `kill-buffer-hook' Co-authored-by: João Távora <[email protected]>
…otavora#309) This should close issue joaotavora#217, also cf. joaotavora#270. * eglot.el (eglot-autoshutdown): New defcustom. (eglot--managed-mode-onoff): Shutdown if so configured and no managed buffers left. Co-authored-by: João Távora <[email protected]>
* eglot-tests.el (auto-shutdown): New test.
1a180d3
to
6ad9e4d
Compare
This should close issue #217, also cf. #270. * eglot.el (eglot-autoshutdown): New defcustom. (eglot--managed-mode-onoff): Shutdown if so configured and no managed buffers left. Co-authored-by: João Távora <[email protected]>
Merged after some housekeeping. Crucially, kept the default. If you can gather the votes again from the other issue and come um with a tally, then we can make another commit to set the default value. |
On Sat, Oct 05 2019 01:52 (-0700), João Távora wrote:
Merged after some housekeeping. Crucially, kept the default. If you
can gather the votes again from the other issue and come um with a
tally, then we can make another commit to set the default value.
Awesome, thanks!
|
This should close issue #217, also cf. #270. * eglot.el (eglot-autoshutdown): New defcustom. (eglot--managed-mode-onoff): Shutdown if so configured and no managed buffers left. Co-authored-by: João Távora <[email protected]> (#309: joaotavora/eglot#309 #217: joaotavora/eglot#217 #270: joaotavora/eglot#270
This should close issue joaotavora/eglot#217, also cf. joaotavora/eglot#270. * eglot.el (eglot-autoshutdown): New defcustom. (eglot--managed-mode-onoff): Shutdown if so configured and no managed buffers left. Co-authored-by: João Távora <[email protected]> GitHub-reference: joaotavora/eglot#309
This got messy, sorry.. rewriting a branch prevents reopening the PR, so here's a new one.
The old discussion is at #305.