[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/eglot d6a6de7 03/69: Fix test failure introduced by pre
From: |
João Távora |
Subject: |
[elpa] externals/eglot d6a6de7 03/69: Fix test failure introduced by previous commit |
Date: |
Sun, 20 Oct 2019 08:21:41 -0400 (EDT) |
branch: externals/eglot
commit d6a6de75558f3ffa940735d5a4ece59b45f2ef4e
Author: João Távora <address@hidden>
Commit: João Távora <address@hidden>
Fix test failure introduced by previous commit
Remove the hack of unsetting eldoc-last-message in
eglot--eldoc-message. This allows any subsequent eglot-eldoc-function
calls (prompted by simple cursor movement) to return it immediately,
thus refreshing the help buffer with the same contents. For this to
work, we also have to set eglot--eldoc-hint globally in
eglot-eldoc-function.
An alternative to making the test pass would be to keep the hack of
unsetting eldoc-last-message only in the case that we actually get to
display the help buffer. This would actually be more efficient, but
potentially more hacky.
The bottom line here is that eldoc doesn't have a good API to deal
with asynchronous docstring fetching. See this thread:
https://lists.gnu.org/archive/html/emacs-devel/2018-05/msg00151.html
* eglot.el (eglot--eldoc-message): Don't unset eldoc-last-message.
(eglot-eldoc-function): Set eglot--eldoc-hint for synchronous
operation too.
---
eglot.el | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/eglot.el b/eglot.el
index fb002b8..a7740e5 100644
--- a/eglot.el
+++ b/eglot.el
@@ -2068,12 +2068,12 @@ Buffer is displayed with `display-buffer', which obeys
(erase-buffer)
(insert string)
(goto-char (point-min))
- (setq eldoc-last-message nil)
- (if eglot-auto-display-eldoc-extra-buffer
- (display-buffer (current-buffer))
- (unless (get-buffer-window (current-buffer))
- (eglot--message "Help for %s in in %s buffer" eglot--eldoc-hint
- (buffer-name eglot--help-buffer))))
+ (cond (eglot-auto-display-eldoc-extra-buffer
+ (display-buffer (current-buffer)))
+ (t
+ (unless (get-buffer-window (current-buffer))
+ (eglot--message "Help for %s is in %s buffer"
eglot--eldoc-hint
+ (buffer-name eglot--help-buffer)))))
(help-mode)
t)))))
@@ -2085,6 +2085,7 @@ If SKIP-SIGNATURE, don't try to send
textDocument/signatureHelp."
(position-params (eglot--TextDocumentPositionParams))
sig-showing
(thing-at-point (thing-at-point 'symbol)))
+ (setq eglot--eldoc-hint thing-at-point)
(cl-macrolet ((when-buffer-window
(&body body) ; notice the exception when testing with `ert'
`(when (or (get-buffer-window buffer) (ert-running-test))
- [elpa] externals/eglot updated (35597d2 -> 33a4f86), João Távora, 2019/10/20
- [elpa] externals/eglot 4398934 01/69: Fix #198: prevent Eldoc flicker when moving around, João Távora, 2019/10/20
- [elpa] externals/eglot d6a6de7 03/69: Fix test failure introduced by previous commit,
João Távora <=
- [elpa] externals/eglot e69cca9 06/69: * README.md: Remove funny UTF character., João Távora, 2019/10/20
- [elpa] externals/eglot 9377988 02/69: Per #198: Show large docs in help buffer instead of echo are by default, João Távora, 2019/10/20
- [elpa] externals/eglot e5e5125 04/69: Rename new defcustoms with friendlier names, João Távora, 2019/10/20
- [elpa] externals/eglot cba3987 07/69: README.md: minor cosmetic tweaks, João Távora, 2019/10/20
- [elpa] externals/eglot dc371b8 08/69: Display truncated docstring if too large for echo area, João Távora, 2019/10/20
- [elpa] externals/eglot 17ec29b 14/69: Per #177: consider mode derivation when guessing servers, João Távora, 2019/10/20
- [elpa] externals/eglot fcb8ab6 11/69: Per #121: fix bug introduced by commit fixing this issue, João Távora, 2019/10/20
- [elpa] externals/eglot 5fc7ecc 10/69: Add built-in support for Dart's dart_language_server, João Távora, 2019/10/20
- [elpa] externals/eglot 1671dc4 12/69: Fix #209: protect against null messages from eldoc, João Távora, 2019/10/20
- [elpa] externals/eglot dbf2dd2 20/69: * eglot.el (xref-backend-references): Don't use return-from., João Távora, 2019/10/20