Implementing LSP specific commands (MetaLS, in this case) #1305
-
Hi, I really enjoy using eglot. I use it primarily with Metals, and it provides a lot of In particular, I'm wanting to get started with implementing it's TL;DR: How does one implement a custom capability ( |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 9 replies
-
The most recent version of the manual has a new section on this topic of server-specific extensions, but it's not published in HTML yet. I'll do that later (please ping me if I forget). In the meantime, check the source material directly https://git.savannah.gnu.org/cgit/emacs.git/tree/doc/misc/eglot.texi#n1268 |
Beta Was this translation helpful? Give feedback.
-
Another thing I'd like to ask is, |
Beta Was this translation helpful? Give feedback.
-
Hello, it's me again
So, I'm not exactly sure what you meant by I asked around a bit in the MetaLS community, and didn't really find anything that says I can request all the commands. They did say that at
|
Beta Was this translation helpful? Give feedback.
-
Yes, but if I were to override it, using cl-defmethod, it could do more
than Commands and CodeActions, yes? Not that I'm thinking of doing that.
Also, any idea how I can extract that `executeCommandProvider` list at
initialisation, and if it would even be beneficial to do so?
I'm leaning towards how lsp-metals does it and just create a new
interactive method for each server command.
…On Mon, 16 Oct, 2023, 2:27 am João Távora, ***@***.***> wrote:
Would I be correct in saying that eglot-execute is a more general
mechanism than eglot--request, and can essentially be thought of as a
highly customisazle middleware to the eglot--request itself?
"highly customizable middleware" is a bit exaggerated 😄
It's just a convenience function for calling eglot--request when the
point is to is to run an "action", which, as the docstring indicated, can
be a CodeAction or a Command. It does the right thing each time.
If you haven't yet, you should familiarize yourself with some of the LSP
specification
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/
, particularly the parts about commands and actions.
—
Reply to this email directly, view it on GitHub
<#1305 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANMDSZ2HNBFNEKENHONQ77TX7RE27AVCNFSM6AAAAAA6AE537CVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TEOBWHA3DA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
eglot-request
the specific method, server replies with a number of actions, choose one of those actions in Elisp, use them as theACTION
argument for aeglot-execute
request