From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Brennan Vincent" Newsgroups: gmane.emacs.bugs Subject: bug#73279: [PATCH] Eglot: use immediate-mode eglot--request for :completionItem/resolve Date: Wed, 25 Sep 2024 11:14:07 -0400 Message-ID: <877caz935s.fsf@denver.mail-host-address-is-not-set> References: <87v7ywoh7m.fsf@taipei.mail-host-address-is-not-set> <86wmjbdehl.fsf@gnu.org> <8734lz7hn2.fsf@taipei.mail-host-address-is-not-set> <87y13r5xzk.fsf@taipei.mail-host-address-is-not-set> 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="30490"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 73279@debbugs.gnu.org, Dmitry Gutov To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 25 17:16:04 2024 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 1stTkI-0007kC-Mp for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Sep 2024 17:16:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stTjv-00056M-3L; Wed, 25 Sep 2024 11:15:39 -0400 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 1stTjs-0004zT-V1 for bug-gnu-emacs@gnu.org; Wed, 25 Sep 2024 11:15:37 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1stTjs-0001Et-Fb for bug-gnu-emacs@gnu.org; Wed, 25 Sep 2024 11:15:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=SkIl1Z/laQXoLOiEFkm+QfVANdwc7kuAXNhb+3LlgNE=; b=o87cQXiKOXeAwpJRm0eX7pLINlpLMIFU0ouWWB4ohRQvXm7Vy90od0a6uMLqubhH6e+hJJr8TutxNafRPsOtyL41ZmYB8XgjrHaW97xXIvlYEP9JrlBJKdIt6tWki9kTzEC3mmogdnlK/YKxOErl7Fk4Uo/UYpYYAM+tnDykvpOf3cKXWpLrsPkzcRhqBquQcO9bdzV1dDlUXcFxVOlOBStGM0wPrDTQt/wvXAUPVd/ukMlnD68V7hwDaSLzjkCqNi/sAbaA4din5bXeXfLq/XTH4ukI/0BCg/JDd5nsGv6PJL3gYOTIBYIcYf8ZxhGtbWfYApDcz/+Efeh8KbLv4g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stTkI-000228-3c for bug-gnu-emacs@gnu.org; Wed, 25 Sep 2024 11:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Brennan Vincent" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Sep 2024 15:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73279 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 73279-submit@debbugs.gnu.org id=B73279.17272773097247 (code B ref 73279); Wed, 25 Sep 2024 15:16:02 +0000 Original-Received: (at 73279) by debbugs.gnu.org; 25 Sep 2024 15:15:09 +0000 Original-Received: from localhost ([127.0.0.1]:42974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stTjR-0001so-04 for submit@debbugs.gnu.org; Wed, 25 Sep 2024 11:15:09 -0400 Original-Received: from smtp.umanwizard.com ([54.203.248.109]:50962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stTjG-0001rn-1B for 73279@debbugs.gnu.org; Wed, 25 Sep 2024 11:15:07 -0400 Original-Received: from localhost ([98.167.244.13]) by smtp.umanwizard.com ; 25 Sep 2024 15:14:08 +0000 X-Fes-Received-For: 73279@debbugs.gnu.org X-Fes-Received-From: In-Reply-To: <87y13r5xzk.fsf@taipei.mail-host-address-is-not-set> X-Fes-Encrypted: true X-Fes-Ehlo-Domain: localhost 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:292398 Archived-At: Hi Jo=C3=A3o, Did you get a chance to take a look at my last message? Let me know if I need to provide any further information. Thanks Brennan "Brennan Vincent" writes: > Jo=C3=A3o T=C3=A1vora writes: > >> On Mon, Sep 16, 2024 at 4:50=E2=80=AFPM Jo=C3=A3o T=C3=A1vora wrote: >>> >>> On Mon, Sep 16, 2024 at 4:40=E2=80=AFPM Jo=C3=A3o T=C3=A1vora wrote: >>> > >>> > On Mon, Sep 16, 2024 at 4:17=E2=80=AFPM Brennan Vincent wrote: >>> > >>> > > As for the regression: yes, it's a regression from 29.4, and in fac= t I >>> > > have bisected to the commit that regressed it: >>> > > a8c1559a663d9bc21776e33303251e244f86f0d7 >>> > >>> > Oh alright, that clears it up. It was an oversight indeed, so I think >>> > your patch is TRT. I'll install it in emacs-30. >>> >>> Actually, not so fast. The code before that allegedly broken commit >>> _also_ sent outstanding changes to the server before resolving >>> (via the advice that was then removed). > > Not according to my testing. > > And, taking a look at the old code: > > (advice-add #'jsonrpc-request :before > (cl-function (lambda (_proc _method _params &key > deferred &allow-other-keys) > (when (and eglot--managed-mode deferred) > (eglot--signal-textDocument/didChange)))) > '((name . eglot--signal-textDocument/didChange))) > > It seems that we are only sending the changes if the function is called > with the :deferred flag. The function was NOT called with the :deferred > flag at the site in question, which as of 093a36 (parent of a8c1559) > looked like this: > > (jsonrpc-request server :completionItem/resolve > lsp-comp :cancel-on-input t) > >>> >>> So I must be missing something, and must investigate more >>> closely. >> >> Brennan, can you provide an excerpt of the Eglot event log >> (M-x eglot-events-buffer) for your MRE recipe before and >> after a8c1559a663d9bc21776e33303251e244f86f0d7? >> > > Sure. See attachments. They are a bit long because of the huge doc > strings rust-analyzer includes, but you should get the idea by searching > for textDocument/completion. > > Note that in BEFORE, we send textDocument/completion, immediately followe= d by > completionItem/resolve. In AFTER, we send textDocument/completion, then > textDocument/didChange, then completionItem/resolve. > > (snip) > >> It should highlight what has changed in the client-server >> communication, if anything. >> >> Jo=C3=A3o