[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/elpa ac9239b 46/71: Fix small problems around Eglot's h
From: |
João Távora |
Subject: |
[elpa] externals/elpa ac9239b 46/71: Fix small problems around Eglot's help buffer |
Date: |
Wed, 16 Dec 2020 11:42:23 -0500 (EST) |
branch: externals/elpa
commit ac9239bed5e3bfbf057382d1a75cdfa23f2caddd
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Fix small problems around Eglot's help buffer
Specifically:
- correctly format the message shown to the user about doc being truncated
- don't show message if the buffer is showing in some frame's window
- correctly name the help buffer switched to with `C-h .'.
This is still not ideal:
- When the `C-h .' suggestion is shown to the user, typing that keybinding
shouldn't result in a new LSP request to fetch probably the same info;
- All this functionality belongs in eldoc.el.
* eglot.el (eglot-help-at-point): Fix buffer name.
(eglot--update-doc): Provide more help.
---
eglot.el | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/eglot.el b/eglot.el
index 4b25368..733b69c 100644
--- a/eglot.el
+++ b/eglot.el
@@ -2270,12 +2270,12 @@ is not active."
(jsonrpc-request (eglot--current-server-or-lose) :textDocument/hover
(eglot--TextDocumentPositionParams))
(let ((blurb (and (not (seq-empty-p contents))
- (eglot--hover-info contents range))))
+ (eglot--hover-info contents range)))
+ (hint (thing-at-point 'symbol)))
(if blurb
(with-current-buffer (eglot--help-buffer)
(with-help-window (current-buffer)
- (rename-buffer (format "*eglot-help for %s*"
- (thing-at-point 'symbol)))
+ (rename-buffer (format "*eglot-help for %s*" hint))
(with-current-buffer standard-output (insert blurb))
(setq-local nobreak-char-display nil)))
(display-local-help)))))
@@ -2350,16 +2350,18 @@ documentation. Honour `eglot-put-doc-in-help-buffer',
(erase-buffer)
(insert string)
(goto-char (point-min)))
- (if eglot-auto-display-help-buffer
- (display-buffer (current-buffer))
- (unless (get-buffer-window (current-buffer))
- ;; This prints two lines. Should it print 1? Or
- ;; honour max-mini-window-height?
- (eglot--message
- "%s\n(...truncated. Full help is in `%s')"
- (eglot--truncate-string string 1 (- (frame-width) 8))
- (buffer-name eglot--help-buffer))))
- (help-mode))))
+ (help-mode)))
+ (if eglot-auto-display-help-buffer
+ (display-buffer eglot--help-buffer)
+ (unless (get-buffer-window eglot--help-buffer t)
+ ;; Hand-tweaked to print two lines. Should it print
+ ;; 1? Or honour max-mini-window-height?
+ (eglot--message
+ "%s\n(Truncated, %sfull help in buffer %s)"
+ (eglot--truncate-string string 1 (- (frame-width) 9))
+ (if-let (key (car (where-is-internal 'eglot-help-at-point)))
+ (format "use %s to see " (key-description key)) "")
+ (buffer-name eglot--help-buffer)))))
((eq eldoc-echo-area-use-multiline-p t)
(if-let ((available (eglot-doc-too-large-for-echo-area string)))
(eldoc-message (eglot--truncate-string string available))
- [elpa] externals/elpa 9efe207 05/71: Make curl invocation fail more explicitly in .travis.yml, (continued)
- [elpa] externals/elpa 9efe207 05/71: Make curl invocation fail more explicitly in .travis.yml, João Távora, 2020/12/16
- [elpa] externals/elpa 73bc752 11/71: Close #441: shield tests from some user customizations, João Távora, 2020/12/16
- [elpa] externals/elpa b6519a5 16/71: Per #446: Add tests for eglot-server-programs, João Távora, 2020/12/16
- [elpa] externals/elpa 9bc58df 17/71: Fix #446: unbreak eglot--guess-contact for host-and-port case, João Távora, 2020/12/16
- [elpa] externals/elpa 197984c 27/71: Remove trailing whitespaces, João Távora, 2020/12/16
- [elpa] externals/elpa a0249c8 23/71: Per #437: remap display-local-help (C-h .) to eglot-help-at-point, João Távora, 2020/12/16
- [elpa] externals/elpa ee87519 41/71: Replace uses of project-roots with project-root, João Távora, 2020/12/16
- [elpa] externals/elpa 3b01561 39/71: Close #459: rework computation of string given to Eldoc (again), João Távora, 2020/12/16
- [elpa] externals/elpa bf75312 35/71: Require Xref, Project and Eldoc from GNU ELPA, João Távora, 2020/12/16
- [elpa] externals/elpa 2b16952 44/71: Try to make hover-multiline-doc-locus test pass on Travis, João Távora, 2020/12/16
- [elpa] externals/elpa ac9239b 46/71: Fix small problems around Eglot's help buffer,
João Távora <=
- [elpa] externals/elpa 433779d 49/71: * eglot.el (Package-Requires): Require Flymake 1.0.9 and eldoc 1.2.0, João Távora, 2020/12/16
- [elpa] externals/elpa e3ce64a 54/71: Fix #510: use a hash-table for storing resolved completions, João Távora, 2020/12/16
- [elpa] externals/elpa e5fefc7 56/71: Really unbreak eldoc-related tests, João Távora, 2020/12/16
- [elpa] externals/elpa 2172641 65/71: Fix #558: Don't force eglot-strict-mode completely in eglot--dcase, João Távora, 2020/12/16
- [elpa] externals/elpa f9a11fe 63/71: Per #300: Don't send JSON null (Elisp nil) down the wire, João Távora, 2020/12/16
- [elpa] externals/elpa b19b294 64/71: Close #558: handle LSP 3.15's isPreferred code action property, João Távora, 2020/12/16
- [elpa] externals/elpa c34e2f6 50/71: Really install latest dependencies, João Távora, 2020/12/16
- [elpa] externals/elpa 5a2cde9 59/71: Close #511: add built-int support for Godot Engine, João Távora, 2020/12/16
- [elpa] externals/elpa 38971d3 66/71: Fix #367: don't let M-x fill-paragraph break didChange, João Távora, 2020/12/16
- [elpa] externals/elpa 8dd0a15 67/71: Fix #367: Robustify previous fix of onChange breakage, João Távora, 2020/12/16