GNU bug report logs - #61506
30.0.50; [PATCH]: Send command in eglot completion exit-function

Previous Next

Package: emacs;

Reported by: Theodor Thornhill <theo <at> thornhill.no>

Date: Tue, 14 Feb 2023 11:01:02 UTC

Severity: wishlist

Tags: patch

Found in version 30.0.50

Full log


Message #11 received at 61506 <at> debbugs.gnu.org (full text, mbox):

From: Theodor Thornhill <theo <at> thornhill.no>
To: Felician Nemeth <felician.nemeth <at> gmail.com>, 61506 <at> debbugs.gnu.org
Cc: joaotavora <at> gmail.com
Subject: Re: bug#61506: 30.0.50; [PATCH]: Send command in eglot completion exit-function
Date: Tue, 14 Feb 2023 18:44:01 +0100

On 14 February 2023 16:56:58 CET, Felician Nemeth <felician.nemeth <at> gmail.com> wrote:
>Hi Theo,
>
>> The LSP spec supports an optional command in the completion results, so
>> that the server can know what completion candidate was selected.  That
>> information can then be used by the server to score candidates for
>> better completion results etc.
>
>Can you list some servers that send this info?  And if it is not too
>much trouble can write a simple recipe where supporting this feature
>actually makes a difference?  Thanks.
>

Jdtls does. See https://github.com/eclipse/eclipse.jdt.ls/blob/c4ed39a70e8c32e055a1b136ceb6c0477687a330/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/JDTDelegateCommandHandler.java#L152

As for proving a difference, not sure how easy that is. The code around the link I posted seems to score, so I guess over time the server should learn _something_. It's a little hard to verify anyway because eglot doesn't respect the ordering provided by the server (which is a different bug in itself).

Anyway, lsp-mode, neovim and others support this, so I see no reason we shouldn't :)


>> This simple patch adds support for this.
>> I have no strong opinions on _where_ exactly the command should be sent,
>> as in before or after the didchange notification.
>
>The specification only says: "An optional command that is executed
>*after* inserting this completion."  I think it is worth asking for
>clarification at https://github.com/microsoft/language-server-protocol
>(I'd guess it's safer to send the command after the didChange
>notification.)

I agree.

Theo




This bug report was last modified 1 year and 241 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.