From 1b81fa34ff282bfca0f754afad2c9eca04ad7985 Mon Sep 17 00:00:00 2001 From: dannyfreeman Date: Fri, 9 Dec 2022 14:40:01 -0500 Subject: [PATCH] Eglot: show progress reports for slow starting servers * lisp/progmodes/eglot.el (eglot--connect): report progress on initialization This takes advantage of the new `eglot-handle-notification` implementation of the LSP $/progress method. Slow starting servers will now show their progress in the minibuffer if `eglot-report-progress` is `t`. The server must also opt in to providing the $/progress notifications. See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initialize for more information on the InitializeParams interface. --- lisp/progmodes/eglot.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index a53f62fc565..cceb9fb5b32 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1291,7 +1291,10 @@ eglot--connect :initializationOptions (eglot-initialization-options server) :capabilities (eglot-client-capabilities server) - :workspaceFolders (eglot-workspace-folders server)) + :workspaceFolders (eglot-workspace-folders server) + ;; Request $/progress notifications from the + ;; server on startup. + :workDoneToken "initialize") :success-fn (eglot--lambda ((InitializeResult) capabilities serverInfo) (unless canceled -- 2.38.1