all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Danny Freeman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 59929@debbugs.gnu.org
Subject: bug#59929: [PATCH]: Eglot, request progress notification on server init
Date: Fri, 09 Dec 2022 15:59:24 -0500	[thread overview]
Message-ID: <87k030tf4t.fsf@dfreeman.email> (raw)
In-Reply-To: <handler.59929.B.167061645810464.ack@debbugs.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 810 bytes --]


Another patch for consideration related to the first in this thread,
I've confirmed that clients can signal to servers that they are willing
to accept server initiated progress notifications with the client
capability in the attached patch. 

Note: there is still no server capability for this that can be ignored,
and the `eglot-report-progress` defcustom remains relevant here. Any
server initiated progress report will be ignored if
`eglot-report-progress` is `nil`.

Server will send a `window/workDoneProgress/create` request, but nothing
needs to be done with it. That request will be followed by the already
implemented $/progress notifications.

I need to find a server that I can test this with before this patch is
applied. I will report back in this thread once I've done that.

-- 
Danny Freeman


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Eglot-Enable-server-initiated-progress-reports.patch --]
[-- Type: text/x-patch, Size: 1409 bytes --]

From f30bd7d7396d29c38249a232e36f4b811dd27f56 Mon Sep 17 00:00:00 2001
From: dannyfreeman <danny@dfreeman.email>
Date: Fri, 9 Dec 2022 15:55:28 -0500
Subject: [PATCH] Eglot: Enable server initiated progress reports

* lisp/progmodes/eglot
(eglot-client-capabilities): servers can initiate progress reports
---
 lisp/progmodes/eglot.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index cceb9fb5b32..e909efdb6f4 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -728,6 +728,7 @@ eglot-client-capabilities
   "What the Eglot LSP client supports for SERVER."
   (:method (s)
            (list
+            :window (list :workDoneProgress t)
             :workspace (list
                         :applyEdit t
                         :executeCommand `(:dynamicRegistration :json-false)
@@ -2062,6 +2063,10 @@ eglot-handle-notification
   (_server (_method (eql telemetry/event)) &rest _any)
   "Handle notification telemetry/event.") ;; noop, use events buffer
 
+(cl-defmethod eglot-handle-reqeust
+  (_server (_method (eql window/workDoneProgress/create)) &rest _any)
+  "Handle request window/workDoneProgress/create.") ;; noop, use events buffer
+
 (cl-defmethod eglot-handle-notification
   (server (_method (eql $/progress)) &key token value)
   "Handle $/progress notification identified by TOKEN from SERVER."
-- 
2.38.1


  parent reply	other threads:[~2022-12-09 20:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-09 19:55 bug#59929: [PATCH]: Eglot, request progress notification on server init Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found] ` <handler.59929.B.167061645810464.ack@debbugs.gnu.org>
2022-12-09 20:59   ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-03-25 19:10     ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-25 19:15       ` 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=87k030tf4t.fsf@dfreeman.email \
    --to=bug-gnu-emacs@gnu.org \
    --cc=59929@debbugs.gnu.org \
    --cc=danny@dfreeman.email \
    /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.