Subject: Re: bug#79290: 30.2; eglot-alternatives doesn't support re-use of same program with different subcommands

From: Felician Nemeth <[email-masked]>
Date: Sat, 23 Aug 2025 16:19:01 +0200

>> From: Doug Davis <[email-masked]>
>> Date: Fri, 22 Aug 2025 10:37:38 -0500
>> 
>> When writing an `eglot-alternatives' that looks like this:
>> 
>>   (add-to-list 'eglot-server-programs
>>                `(python-base-mode
>>                  . ,(eglot-alternatives '(("basedpyright-langserver" "--stdio")
>>                                           ("uv" "run" "pyright-langserver" "--stdio")
>>                                           ("uv" "run" "ty" "server")
>>                                           "jedi-language-server"
>>                                           ("pyright-langserver" "--stdio")))))
>> 
>> an invocation of M-x eglot will fail to show the second instance of
>> using uv in the resulting list that appears to be passed on to
>> `completing-read'. (Notice the repeated use of `uv run`
>> https://docs.astral.sh/uv/reference/cli/#uv-run)
>> 
>> more info: the benefit of using `uv run` unloads the burden of using
>> emacs to property setup a virtual environment; uv automatically handles
>> running the correct installation of the invoked subcommand.

Maybe an element of ALTERNATIVES of eglot-alternatives (or the CONTACT
of eglot-server-programs) cloud have an additional property named :title
or :label (similarly to the existing :initializationOptions) to be used
in the completing-read call of eglot-alternatives.

As a workaround, Doug can create two symlinks named
uv-pyright-langserver and an uv-ty pointing to uv.