]> git.eshelyaron.com Git - emacs.git/commit
New "deferred requests" that wait until server is ready
authorJoão Távora <joaotavora@gmail.com>
Wed, 9 May 2018 21:41:37 +0000 (22:41 +0100)
committerJoão Távora <joaotavora@gmail.com>
Wed, 9 May 2018 22:12:42 +0000 (23:12 +0100)
commitd76cc9aea9c0e77bac28385050f14acff4b4e25f
tree82dc7a21ca56862c8c39ada9740fae0a5328b4da
parent0a9c14efad60e29ba7604e19f5822757e0c066d6
New "deferred requests" that wait until server is ready

Calling textDocument/hover or textDocument/documentHighlight before
the server has had a chance to process a textDocument/didChange is
normally useless. The matter is worse for servers like RLS which only
become ready much later and send a special notif for it (see
https://github.com/rust-lang-nursery/rls/issues/725).

So, keeping the same coding style add a DEFERRED arg to eglot--request
that makes it maybe not run the function immediately. Add a bunch of
logic for probing readiness of servers.

* README.md: Update

* eglot.el (eglot--deferred-actions): New process-local var.
(eglot--process-filter): Call deferred actions.
(eglot--request): Rewrite.
(eglot--sync-request): Rewrite.
(eglot--call-deferred, eglot--ready-predicates)
(eglot--server-ready-p): New helpers.
(eglot--signal-textDocument/didChange): Set spinner and call
deferred actions.
(eglot-completion-at-point): Pass DEFERRED to eglot-sync-request.
(eglot-eldoc-function): Pass DEFERRED to eglot-request
(eglot--rls-probably-ready-for-p): New helper.
(rust-mode-hook): Add eglot--setup-rls-idiosyncrasies
(eglot--setup-rls-idiosyncrasies): New helper.
lisp/progmodes/eglot.el