From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mikael Springer via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#73496: 30.0.91; Eglot (and clangd) out of sync after switching git branches in magit Date: Thu, 26 Sep 2024 11:07:43 +0000 Message-ID: References: <864j62buca.fsf@gnu.org> Reply-To: Mikael Springer 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="10682"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73496@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 26 14:26:26 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 1stnZh-0002Xw-Cc for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 26 Sep 2024 14:26:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1stnZJ-0004wF-8B; Thu, 26 Sep 2024 08:26:02 -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 1stnZ2-0004tN-6O for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2024 08:25:47 -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 1stnYu-0003jo-6Z for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2024 08:25:42 -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=c7uFrUNz+rvl9Zop0vJue2uAjKT4xaasJcmZZ46mjzg=; b=oCtnlmZsp1/T4AMei6+fztj29qPTGSEulVV6VEEFj+0Qo/LmAgVOSRgQU3/V2aLowiUPS4TbBQn2nOM31oiZhoev3XoO1M3QkXaxPACvWShf+/21vzIB8OrId5/9RHh6MV9VQzVgDdNM1D8W87hHq9G5XiJapuTQXHlGJRn9bRX4YgJQYEoA3+iLHPTPKTS2EGaolfAhYpBdPmewEEqkbrhya6vI1qB0gn/J90y2VwuA5kIUTeXKYNTnrbg4tcbukGULh0nwRm+2r7vwBey0Q+MjHXTcsrTdH6i/NUMSxZ13e/pR2+SY3q0p5ZcyL7OnkDKD+U057XnGKwV2vfHLBw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1stnZL-0003RF-6Z for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2024 08:26:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mikael Springer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Sep 2024 12:26:03 +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.172735352612599 (code B ref 73496); Thu, 26 Sep 2024 12:26:03 +0000 Original-Received: (at 73496) by debbugs.gnu.org; 26 Sep 2024 12:25:26 +0000 Original-Received: from localhost ([127.0.0.1]:58652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stnYj-0003H2-Es for submit@debbugs.gnu.org; Thu, 26 Sep 2024 08:25:26 -0400 Original-Received: from mail-40134.protonmail.ch ([185.70.40.134]:43867) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stmM9-0006on-G0 for 73496@debbugs.gnu.org; Thu, 26 Sep 2024 07:08:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1727348868; x=1727608068; bh=c7uFrUNz+rvl9Zop0vJue2uAjKT4xaasJcmZZ46mjzg=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=RzCfplJJ8M1EVORcm/0+sU5PEfAD4xUmtpRzP6UF1IXtduEnrJaV2VwXtsYhcmW1t mlGJcJKmFukAcmf8lFJ5ju5gxN03LwfPWwsepkFGdwQIRWm7oPUmf3QVd7Wro25tDH 6+ZdeN++LnI/JkxPU0FLm6tKv/jvau4pGyXKqGTFlFngnUbYpx8wwkVmyt0T2kwVX0 3z9wf+wiUyoq+G2Yk+XP0yq/d3/whwx5dhRvNUru3pukQLhp0Vkt/0PHupS1wsm244 ABfEqLPstSbOUHmgQPmgNfHW219PDVh53mUnzSMrzksFCilsiHZK50ooSPAMdZOYkr lIPAjQNc0eCAg== In-Reply-To: Feedback-ID: 14037015:user:proton X-Pm-Message-ID: 1ca5e8cb33127df365260651cd8ee724b6ab2803 X-Mailman-Approved-At: Thu, 26 Sep 2024 08:23:55 -0400 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:292456 Archived-At: 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=20 agree and suspect that any outside file operation will work as a trigger. /Micke. On 2024-09-26 12:25, Jo=C3=A3o T=C3=A1vora wrote: > On Thu, Sep 26, 2024 at 11:08=E2=80=AFAM Eli Zaretskii wro= te: >>> 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=3D44 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=C3=A3o. > 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 (o= r > 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=C3=A3o.