all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
To: Danny Freeman <danny@dfreeman.email>
Cc: 59149@debbugs.gnu.org
Subject: bug#59149: Feature Request: Report progress of long requests in Eglot
Date: Mon, 21 Nov 2022 10:04:08 -0800	[thread overview]
Message-ID: <86fseckwvb.fsf@stephe-leake.org> (raw)
In-Reply-To: <87k03qvmla.fsf@dfreeman.email> (Danny Freeman's message of "Sat,  19 Nov 2022 13:03:24 -0500")

Danny Freeman <danny@dfreeman.email> writes:

> Stephen Leake <stephen_leake@stephe-leake.org> writes:
>
>> This works for my needs in ada-mode; + 1.
>
> Great to hear!
>
>> > Anyway, the way the user opts out of LSP configuration is via the user
>> > variable eglot-ignored-server-capabilities.  So there should be some
>> > point where you check the associated LSP capability of "progress
>> > reporting" with eglot--server-capable.
>
> I'm trying to work on using the eglot-ignored-server-capabilities
> functionality with this, and am having some trouble. What exactly is the
> capability to ignore here? 

The LSP says progress report is part of the base protocol, not optional:
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#progress

> I believe this needs an entry somewhere in the
> `eglot-client-capabilities` hierarchy.
>
> This:
[2. application/emacs-lisp]
```
(cl-defgeneric eglot-client-capabilities (server)
  "What the Eglot LSP client supports for SERVER."
  (:method (s)
           (list
            :progress t
            ;; or maybe
            :$ (list :progress t)

            :workspace (list ...
            ... )))
```
>
>
>
> does not translate into anything when checking
> `(eglot--capabilities (eglot-current-server))`. Other capabilities are
> listed but not the new one I've added.

Moving :progress into :workspace worked for me:

            :workspace (list
                        :applyEdit t
                        :executeCommand `(:dynamicRegistration :json-false)
                        :workspaceEdit `(:documentChanges t)
                        :didChangeWatchedFiles
                        `(:dynamicRegistration
                          ,(if (eglot--trampish-p s) :json-false t))
                        :symbol `(:dynamicRegistration :json-false)
                        :configuration t
                        :semanticTokens `(:refreshSupport :json-false)
                        :workspaceFolders t
                        :progress t)

I have no idea why this works when yours does not.

> nor does `(eglot--server-capable :progress)` ;; returns nil
> `(eglot--server-capable :progressHandler)` ;; also nil
>

Note that this is checking the _server_ capabilities; since LSP does not
define "projess" as a capability, no server will ever advertise that
it is supported.

So we can't use eglot-ignores-server-capabilities; we could maybe
introduce eglot-ignored-client-capabilities.

But we already have a mechanism for that; eglot-stay-out-of.

So a user can do:

(add-to-list 'eglot-stay-out-of 'progress)

And in eglot-handle-notification ($/progress) we check for that:

(unless (eglot--stay-out-of-p 'progress)
   ...

There's probably a way to fold that check into the cl-defmethod
dispatching parameters; I did not look into that.

-- 
-- Stephe





  reply	other threads:[~2022-11-21 18:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 14:13 bug#59149: Feature Request: Report progress of long requests in Eglot Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-10 15:50 ` João Távora
2022-11-11 13:07   ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-19  9:42 ` Stephen Leake
2022-11-19 18:03   ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-21 18:04     ` Stephen Leake [this message]
2022-11-23 14:12       ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-23 18:01         ` Stephen Leake
2022-11-23 19:36           ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-23 19:56             ` João Távora
2022-11-24 11:06               ` bug#59149: [SPAM UNSURE] " Stephen Leake
2022-11-24 14:16                 ` João Távora
2022-11-24 21:25                   ` Stephen Leake
2022-11-25 16:11                     ` João Távora
2022-11-25 16:15                     ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-25 16:31                       ` Eli Zaretskii
2022-11-25 16:41                         ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-25 16:44                           ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-26  1:03                           ` João Távora
2022-11-26 18:37                             ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-26 19:46                             ` Stefan Kangas
2022-12-01 13:29                               ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-03 13:23                                 ` João Távora
2022-12-09 13:06                                   ` João Távora
2022-12-09 13:38                                     ` Danny Freeman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-22 18:45     ` Stephen Leake

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=86fseckwvb.fsf@stephe-leake.org \
    --to=stephen_leake@stephe-leake.org \
    --cc=59149@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.