Subject: Re: bug#76423: Major-mode provided LSP server for Eglot

From: Stefan Monnier <[email-masked]>
Date: Thu, 20 Feb 2025 16:12:27 -0500

>>       (setq-local eglot-server-programs
>>                   `(bicep-ts-mode . ("dotnet"
>>       ,(bicep-langserver-path))))
>
> You mean eglot-server-program, singular (that's what your patch proposes)

Oops, yes.

> Anyway, your patch is more or less what I had in mind altough:
>
> * The name should probably be something less confusable with
>   e-s-programs, like eglot-suggested-servers or eglot-preferred-servers
>   (note that it can still be "servers!" unless we purposedly cap that
>   ability, which we maybe should).

I have no opinion on the name.

> * It's a bit silly to repeat the major-mode symbol in it.  So the
>   setting in the major-mode function should be something like
>
>     (setq eglot-suggested-servers '("dotnet" ,(bicep-langserver-path)))

That's what I started with but then I saw that `eglot--lookup-mode`
returns info that includes part of the `car` of the elements in
`eglot-server-programs` (IIUC it's so as to know which other buffers and
major modes could share the same server), so rather than try and learn
how that part of Eglot really works, I went for a simpler change.

        Stefan