From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Danny Freeman via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59929: [PATCH]: Eglot, request progress notification on server init Date: Fri, 09 Dec 2022 15:59:24 -0500 Message-ID: <87k030tf4t.fsf@dfreeman.email> References: <87y1rgtk78.fsf@dfreeman.email> Reply-To: Danny Freeman Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10019"; mail-complaints-to="usenet@ciao.gmane.io" To: 59929@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 09 22:57:27 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p3lN1-0002Qn-Bp for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Dec 2022 22:57:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3lMe-0004t0-Lu; Fri, 09 Dec 2022 16:57:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3lMd-0004ss-0O for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 16:57:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3lMc-0001Dq-Or for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 16:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3lMc-0006KE-Cv for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 16:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Danny Freeman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Dec 2022 21:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59929 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 59929-submit@debbugs.gnu.org id=B59929.167062301724308 (code B ref 59929); Fri, 09 Dec 2022 21:57:02 +0000 Original-Received: (at 59929) by debbugs.gnu.org; 9 Dec 2022 21:56:57 +0000 Original-Received: from localhost ([127.0.0.1]:38759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3lMX-0006K0-48 for submit@debbugs.gnu.org; Fri, 09 Dec 2022 16:56:57 -0500 Original-Received: from out2.migadu.com ([188.165.223.204]:16192) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3lMU-0006Js-SN for 59929@debbugs.gnu.org; Fri, 09 Dec 2022 16:56:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dfreeman.email; s=key1; t=1670623013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=elJDtJ27YjA9erITB8249lLWTrDHkDIzr6E6WmqiEeY=; b=JE6/JGy6ViypWflswhfUZJY6htzVXuwzOZETzDyDDVc03mdn5l+wvB5HA0XvwP/4pDs0qm ChSm7HzwQL/PNN1eCp+oANkseW0lqIsm9mRQWnC08FH0HJ7WFmVEEJgSHcdSkVEVHP3tXd W/Se+ecTfqXiQxGUGtvCSkJ7I9QAKhM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250470 Archived-At: --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Eglot-Enable-server-initiated-progress-reports.patch >From f30bd7d7396d29c38249a232e36f4b811dd27f56 Mon Sep 17 00:00:00 2001 From: dannyfreeman 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 --=-=-=--