]> git.eshelyaron.com Git - emacs.git/commit
Eglot: Handle LSP progress with Emacs progress reporters (bug#59149)
authordannyfreeman <danny@dfreeman.email>
Fri, 9 Dec 2022 12:49:26 +0000 (12:49 +0000)
committerJoão Távora <joaotavora@gmail.com>
Fri, 9 Dec 2022 13:03:57 +0000 (13:03 +0000)
commit74a009dd96a643b12a63a29fba3d40a74e7d82a2
treebf01dd79925eadf4ffe19bd8212080304440fd07
parent0cfeb1c2bc98b3b4c9ea8c28d176ac65b9211f7f
Eglot: Handle LSP progress with Emacs progress reporters (bug#59149)

Co-authored-by: João Távora <joaotavora@gmail.com>
* lisp/progmodes/eglot.el (eglot-report-progress): New custom variable.
(eglot-lsp-server): New slot for tracking active progress reporters.
(eglot-handle-notification (eql $/progress)): New method.

The LSP spec describes methods for reporting progress on long running
jobs to the client:

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#progress
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workDoneProgress

This change reports those notifications in the minibuffer as they come
in.  It shows a percent indicator (if the server provides theme), or a
spinner.

This change could open the door for writing a "cancel long running
request" command, which are identified by these progress
notifications.  See
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_workDoneProgress_cancel

* doc/misc/eglot.texi (Customizing Eglot): Describe new variable.
doc/misc/eglot.texi
lisp/progmodes/eglot.el