From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#73496: 30.0.91; Eglot (and clangd) out of sync after switching git branches in magit Date: Sat, 19 Oct 2024 09:58:04 +0300 Message-ID: <86bjzgmver.fsf@gnu.org> References: <864j62buca.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15647"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73496@debbugs.gnu.org, joaotavora@gmail.com To: Mikael Springer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 19 08:59:03 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 1t23QT-0003sn-Ev for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 19 Oct 2024 08:59:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t23Q7-0001F2-NE; Sat, 19 Oct 2024 02:58: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 1t23Q6-0001Ep-Ve for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2024 02:58:38 -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 1t23Q6-0000aT-N8 for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2024 02:58:38 -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:References:In-Reply-To:From:Date:To:Subject; bh=MvKOPXqot0IwqLkwAa9AO9qAFlEg5smeDV5RufqY/wU=; b=mfHqUIMkzAjFgh3hSS2/u0pTBuhjDlM6oNEG0vkbmhwaZs4MQtLm+qX6jA7iiGtCtPXFiDqRFEQtbTpHMa/LL4dx8AFflQL4bfQea5R+tHLu/eLOsDaPhquDDsh8u4NLDldaC8t71+DaxwpxfpNWoe1HO+aPcAYblVGYCUDa8XYsKkig06I/8yCj+tjRhT7m/9jmwDjyfQMOI4w9pgNed93802wWRfh+iNjH5rVB1OUn2Y4j8gYQ5Xmqup3z2IMVjEV6QSX6v7Wc6KuSxWLsy1HZ5RBmNCgPjHOrITZyyXH0ISMFd6LQ8FPUVL35/UF02KI/oRqD6aZyLQgZj3CAIQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t23QU-0006kb-0s for bug-gnu-emacs@gnu.org; Sat, 19 Oct 2024 02:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 Oct 2024 06:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73496 X-GNU-PR-Package: emacs Original-Received: via spool by 73496-submit@debbugs.gnu.org id=B73496.172932112225918 (code B ref 73496); Sat, 19 Oct 2024 06:59:01 +0000 Original-Received: (at 73496) by debbugs.gnu.org; 19 Oct 2024 06:58:42 +0000 Original-Received: from localhost ([127.0.0.1]:41055 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t23Q9-0006jx-K7 for submit@debbugs.gnu.org; Sat, 19 Oct 2024 02:58:41 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t23Q5-0006jd-9Q for 73496@debbugs.gnu.org; Sat, 19 Oct 2024 02:58:39 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t23Pc-0000ZB-4g; Sat, 19 Oct 2024 02:58:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=MvKOPXqot0IwqLkwAa9AO9qAFlEg5smeDV5RufqY/wU=; b=C8FsD75erkbCsiycdXsW o+xwibqZE9UjhZyGX+qP09wuFmv+90tSOZ3dU/1iMA92rgS6a4jwoLoVqMw3WjPulVQn1gSUj7TGi cZSiglpSRbauSk61l7h9hcs9FZPUWzDwQWJtQo4Ibr7bbo2EAqD06HSOvBfRj/rrepJmEMlVk1C5W vluzYNZkXR77mZRvizrzXoR2tBW40hAGoZzKn6XPDkeZ7Xc2hQrPx+wV+q4XO5AOPFIdlE5QCdLBV fJfT2SDliyAfFkvAoI6OowMUJWgHJO53ho9yALoNCXlg0BpU3W4ayURdDz7v/TTKhIYmoU0Kb+nmg CmrBOFylghbvIQ==; In-Reply-To: (message from Mikael Springer on Thu, 26 Sep 2024 11:07:43 +0000) 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:293833 Archived-At: > Date: Thu, 26 Sep 2024 11:07:43 +0000 > From: Mikael Springer > Cc: 73496@debbugs.gnu.org > > You are right, I have eglot-ensure enabled for c++ts-mode. > > I'll try to create an emacs -Q recipe for this as soon as I can. I also > agree and suspect that any outside file operation will work as a trigger. Ping! Any success in creating such a recipe? > On 2024-09-26 12:25, João Távora wrote: > > On Thu, Sep 26, 2024 at 11:08 AM Eli Zaretskii wrote: > >>> Date: Thu, 26 Sep 2024 08:20:52 +0000 > >>> From: Mikael Springer via "Bug reports for GNU Emacs, > >>> the Swiss army knife of text editors" > >>> > >>> > >>> 1. Visit buffer with C++ code -> Eglot starts. > >>> 2. Listing references for a variable in Eglot works. > >>> 3. Switch Git branch in magit. > >>> 4. Go back to C++ buffer. Listing references for a variable using Eglot > >>> does not work, error message in echo buffer; "jsonrpc-request: > >>> jsonrpc-error: "request id=44 failed:", (jsonrpc-error-code . -32602), > >>> (jsonrpc-error-message . "trying to get AST for non-added document"), > >>> (jsonrpc-error-data)" > >>> 5. Closing the buffer and opening it again fixes the problem, or doing > >>> eglot-reconnect also fixes the problem, listing references is working > >>> again. > >>> 6. This is true for all open C++ buffers handled by Eglot before the > >>> branch switch. > >> CC'ing João. > > It would be great if Mikael could make this into a Emacs -Q recipe > > to ease investigation and rule out interference from configuration etc. > > > > For example this isn't true > > > > Visit buffer with C++ code -> Eglot starts. > > > > unless you use eglot-ensure in your config. And possibly Magit isn't > > needed to trigger this, a simple Git branch change on the side will do (or > > maybe it won't in which case Magit has to be investigated, too). > > > > A concrete example toy repo with, say, a single file would also > > be useful. > > > > João. > >