Eglot: do more orthodox use of progress reporters (bug#81514)

The progress reporters on recent Emacs has backward incompatible
changes, but our use of them wasn't too correct either.

* lisp/progmodes/eglot.el (eglot-handle-notification): Call
progress-reporter-done.
This commit is contained in:
João Távora 2026-08-01 10:54:10 +01:00
parent 0b8d2acdd2
commit cf98d9d725

View file

@ -2872,7 +2872,8 @@ return it back to the server. :null is returned if the list was empty."
(if (eq eglot-report-progress 'messages)
(make-progress-reporter
(format "[eglot] %s %s: %s"
(eglot-project-nickname server) token title))
(eglot-project-nickname server) token title)
0 100)
(list 'eglot--mode-line-reporter token title)))
(upd (pcnt msg &optional
(pr (gethash token (eglot--progress-reporters server))))
@ -2880,7 +2881,10 @@ return it back to the server. :null is returned if the list was empty."
((eq (car pr) 'eglot--mode-line-reporter)
(setcdr (cddr pr) (list msg pcnt))
(force-mode-line-update t))
(pr (eglot--reporter-update pr pcnt msg)))))
(pr
(if (eql pcnt 100)
(progress-reporter-done pr)
(eglot--reporter-update pr pcnt msg))))))
(eglot--dbind ((WorkDoneProgress) kind title percentage message) value
(pcase kind
("begin"