From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61506: 30.0.50; [PATCH]: Send command in eglot completion exit-function Date: Tue, 14 Feb 2023 18:44:01 +0100 Message-ID: <74E0BF9F-42AF-4578-9681-D0FB936081AE@thornhill.no> References: <87h6vo1ph6.fsf@thornhill.no> <87pmacjl4l.fsf@betli.tmit.bme.hu> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37776"; mail-complaints-to="usenet@ciao.gmane.io" Cc: joaotavora@gmail.com To: Felician Nemeth , 61506@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 14 18:45:36 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pRzN1-0009YC-KS for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 14 Feb 2023 18:45:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRzMb-0005Ce-K5; Tue, 14 Feb 2023 12:45:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRzMZ-0005BY-Ci for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 12:45:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRzMV-0007x0-4w for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 12:45:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pRzMU-0008I2-IR for bug-gnu-emacs@gnu.org; Tue, 14 Feb 2023 12:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 14 Feb 2023 17:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61506 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 61506-submit@debbugs.gnu.org id=B61506.167639665331790 (code B ref 61506); Tue, 14 Feb 2023 17:45:02 +0000 Original-Received: (at 61506) by debbugs.gnu.org; 14 Feb 2023 17:44:13 +0000 Original-Received: from localhost ([127.0.0.1]:56894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRzLh-0008Ge-BV for submit@debbugs.gnu.org; Tue, 14 Feb 2023 12:44:13 -0500 Original-Received: from out-96.mta0.migadu.com ([91.218.175.96]:44797) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pRzLf-0008GU-Tr for 61506@debbugs.gnu.org; Tue, 14 Feb 2023 12:44:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1676396646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bLT59A2xLfevosh4ZW6Uqwb0OjE12CO78Xn47qbT5YU=; b=R6veChQVw30Ov9tFlxE1EqRbA5/wa3lFbU0vGNCY3k7xbrEWzvov5dZMYCKwWW4pQoFOzv 4ddLiXt/YfdgOQMEI9Jy/iG5BjZsjqSSDkwWA63k7jd6YPaJ13Na8rANxUTqeWzuApo2L8 xVyGL0rvOXxmCz1l8K1/q+eWkiXq8us5/9bGcGTd2gtv1CCePHt+4XRYST4rkK7IA4ldNR 4jvh8sJ8QipnpuHB9fAodoJdDwlxE4UbnEKU6thvzUTGpnY6CUuNuRynZlxElLAgRD2BWG de+o3U7oKcpai1AIPW8LKnd6S1ABcGV+oJlaJtnVznMkf9H0B922G7QO2NQRhQ== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-Reply-To: <87pmacjl4l.fsf@betli.tmit.bme.hu> X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:255621 Archived-At: On 14 February 2023 16:56:58 CET, Felician Nemeth 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=2E Tha= t >> information can then be used by the server to score candidates for >> better completion results etc=2E > >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=2E > Jdtls does=2E See https://github=2Ecom/eclipse/eclipse=2Ejdt=2Els/blob/c4e= d39a70e8c32e055a1b136ceb6c0477687a330/org=2Eeclipse=2Ejdt=2Els=2Ecore/src/o= rg/eclipse/jdt/ls/core/internal/JDTDelegateCommandHandler=2Ejava#L152 As for proving a difference, not sure how easy that is=2E The code around = the link I posted seems to score, so I guess over time the server should le= arn _something_=2E 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)=2E Anyway, lsp-mode, neovim and others support this, so I see no reason we sh= ouldn't :) >> This simple patch adds support for this=2E >> I have no strong opinions on _where_ exactly the command should be sent= , >> as in before or after the didchange notification=2E > >The specification only says: "An optional command that is executed >*after* inserting this completion=2E" I think it is worth asking for >clarification at https://github=2Ecom/microsoft/language-server-protocol >(I'd guess it's safer to send the command after the didChange >notification=2E) I agree=2E Theo