From: "João Távora" <joaotavora@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Krzysztof Klimonda <kklimonda@syntaxhighlighted.com>,
64101@debbugs.gnu.org
Subject: bug#64101: 29.0.91; Eglot inlay hints rendered out of order
Date: Sat, 17 Jun 2023 10:39:32 +0100 [thread overview]
Message-ID: <877cs28m23.fsf@gmail.com> (raw)
In-Reply-To: <83r0qar07l.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 17 Jun 2023 10:56:30 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
> João, are you looking into this?
I looked at a very similar issue: https://github.com/joaotavora/eglot/discussions/1239
There, Milan Jovanovic , reports something very similar,
if not completely identical, for Emacs 29. I asked
Milan to send mail here. Maybe Krzystof and Milan are
related, or this is just a coincidence?
Anyway, I tried to reproduce the problem on both Emacs 29
and 30 and couldn't.
The problem also doesn't happen on Emacs 28. So I don't know what is up
and the "recent overlay rewrite" (when?) doesn't seem to have an effect.
I don't have a Mac OS machine to test.
> Should the overlays created for the
> inlay hints be forced to be sorted in some particular order?
Maybe, and there is definitely an order they should be sorted.
But as far as I can personally observe, there is no problem yet,
so it would be best to first understand the problem.
But maybe Milan/Krzystof can try this patch:
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index a65795f1dfc..0c000f72ec7 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -3755,8 +3755,9 @@ eglot--update-hints-1
(if peg-after-p
(make-overlay (point) (1+ (point)) nil t)
(make-overlay (1- (point)) (point) nil nil nil)))
- (do-it (label lpad rpad firstp)
- (let* ((tweak-cursor-p (and firstp peg-after-p))
+ (do-it (label lpad rpad i)
+ (let* ((firstp (zerop i))
+ (tweak-cursor-p (and firstp peg-after-p))
(ov (make-ov))
(text (concat lpad label rpad)))
(when tweak-cursor-p (put-text-property 0 1 'cursor 1 text))
@@ -3767,17 +3768,18 @@ eglot--update-hints-1
(1 'eglot-type-hint-face)
(2 'eglot-parameter-hint-face)
(_ 'eglot-inlay-hint-face))))
+ (overlay-put ov 'priority i)
(overlay-put ov 'eglot--inlay-hint t)
(overlay-put ov 'evaporate t)
(overlay-put ov 'eglot--overlay t))))
- (if (stringp label) (do-it label left-pad right-pad t)
+ (if (stringp label) (do-it label left-pad right-pad 0)
(cl-loop
for i from 0 for ldetail across label
do (eglot--dbind ((InlayHintLabelPart) value) ldetail
(do-it value
(and (zerop i) left-pad)
(and (= i (1- (length label))) right-pad)
- (zerop i))))))))))
+ i)))))))))
(jsonrpc-async-request
(eglot--current-server-or-lose)
:textDocument/inlayHint
next prev parent reply other threads:[~2023-06-17 9:39 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-15 21:23 bug#64101: 29.0.91; Eglot inlay hints rendered out of order Krzysztof Klimonda
2023-06-17 7:56 ` Eli Zaretskii
2023-06-17 9:39 ` João Távora [this message]
2023-06-17 10:41 ` Eli Zaretskii
2023-06-17 12:19 ` João Távora
2023-06-17 13:17 ` Eli Zaretskii
2023-06-17 13:26 ` João Távora
2023-06-17 14:12 ` Eli Zaretskii
2023-06-17 14:29 ` João Távora
2023-06-17 15:50 ` Eli Zaretskii
2023-06-17 16:45 ` João Távora
2023-06-17 12:26 ` Krzysztof Klimonda
2023-06-17 19:02 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-17 22:25 ` João Távora
2023-06-18 0:45 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-18 8:47 ` João Távora
2023-06-18 14:18 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-18 14:22 ` João Távora
2023-06-18 14:29 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-18 14:36 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-18 15:20 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-19 16:17 ` Milan Jovanovic
2023-06-19 16:34 ` João Távora
2023-06-19 18:06 ` Milan Jovanovic
2023-06-19 19:08 ` João Távora
2023-06-19 21:05 ` Milan Jovanovic
2023-06-19 22:38 ` João Távora
2023-06-20 11:10 ` Eli Zaretskii
2023-06-20 11:32 ` Milan Jovanovic
2023-06-20 12:01 ` Eli Zaretskii
2023-06-20 13:34 ` Milan Jovanovic
2023-06-20 13:46 ` Eli Zaretskii
2023-06-20 13:50 ` João Távora
2023-06-17 20:54 ` Milan Jovanovic
2023-06-17 22:35 ` João Távora
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877cs28m23.fsf@gmail.com \
--to=joaotavora@gmail.com \
--cc=64101@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=kklimonda@syntaxhighlighted.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.