mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-07 04:39:37 +00:00
Eglot: again fix positions of coinciding inlay hint overlays (bug#64101)
This bug originated from the previous fix, and is reproducible on non Mac OS platforms, as long as the very latest version (at time of writing) of the rust-analyzer server is used. * lisp/progmodes/eglot.el (eglot--update-hints-1): Reverse priorities when pegging overlays after (i.e. when before-string is used).
This commit is contained in:
parent
a24e9e3fee
commit
6f211bc57b
1 changed files with 4 additions and 4 deletions
|
@ -3644,7 +3644,7 @@ If NOERROR, return predicate, else erroring function."
|
||||||
(if peg-after-p
|
(if peg-after-p
|
||||||
(make-overlay (point) (1+ (point)) nil t)
|
(make-overlay (point) (1+ (point)) nil t)
|
||||||
(make-overlay (1- (point)) (point) nil nil nil)))
|
(make-overlay (1- (point)) (point) nil nil nil)))
|
||||||
(do-it (label lpad rpad i)
|
(do-it (label lpad rpad i n)
|
||||||
(let* ((firstp (zerop i))
|
(let* ((firstp (zerop i))
|
||||||
(tweak-cursor-p (and firstp peg-after-p))
|
(tweak-cursor-p (and firstp peg-after-p))
|
||||||
(ov (make-ov))
|
(ov (make-ov))
|
||||||
|
@ -3657,18 +3657,18 @@ If NOERROR, return predicate, else erroring function."
|
||||||
(1 'eglot-type-hint-face)
|
(1 'eglot-type-hint-face)
|
||||||
(2 'eglot-parameter-hint-face)
|
(2 'eglot-parameter-hint-face)
|
||||||
(_ 'eglot-inlay-hint-face))))
|
(_ 'eglot-inlay-hint-face))))
|
||||||
(overlay-put ov 'priority i)
|
(overlay-put ov 'priority (if peg-after-p i (- n i)))
|
||||||
(overlay-put ov 'eglot--inlay-hint t)
|
(overlay-put ov 'eglot--inlay-hint t)
|
||||||
(overlay-put ov 'evaporate t)
|
(overlay-put ov 'evaporate t)
|
||||||
(overlay-put ov 'eglot--overlay t))))
|
(overlay-put ov 'eglot--overlay t))))
|
||||||
(if (stringp label) (do-it label left-pad right-pad 0)
|
(if (stringp label) (do-it label left-pad right-pad 0 1)
|
||||||
(cl-loop
|
(cl-loop
|
||||||
for i from 0 for ldetail across label
|
for i from 0 for ldetail across label
|
||||||
do (eglot--dbind ((InlayHintLabelPart) value) ldetail
|
do (eglot--dbind ((InlayHintLabelPart) value) ldetail
|
||||||
(do-it value
|
(do-it value
|
||||||
(and (zerop i) left-pad)
|
(and (zerop i) left-pad)
|
||||||
(and (= i (1- (length label))) right-pad)
|
(and (= i (1- (length label))) right-pad)
|
||||||
i)))))))))
|
i (length label))))))))))
|
||||||
(jsonrpc-async-request
|
(jsonrpc-async-request
|
||||||
(eglot--current-server-or-lose)
|
(eglot--current-server-or-lose)
|
||||||
:textDocument/inlayHint
|
:textDocument/inlayHint
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue