GNU bug report logs - #73414
eglot: using auto-revert-mode and git checkout corrupts diagnostics

Previous Next

Package: emacs;

Reported by: Romain Ouabdelkader <romain.ouabdelkader <at> gmail.com>

Date: Sat, 21 Sep 2024 19:17:01 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 73414 in the body.
You can then email your comments to 73414 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#73414; Package emacs. (Sat, 21 Sep 2024 19:17:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Romain Ouabdelkader <romain.ouabdelkader <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 21 Sep 2024 19:17:02 GMT) Full text and rfc822 format available.

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

From: Romain Ouabdelkader <romain.ouabdelkader <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: eglot: using auto-revert-mode and git checkout corrupts diagnostics
Date: Sat, 21 Sep 2024 21:13:35 +0200
[Message part 1 (text/plain, inline)]
Hello,

With auto-revert-mode and eglot enabled, using a git checkout to change
branch will leave invalid buffer diagnostics.

Emacs version: GNU Emacs 30.0.91
Operating system: Mac OS X
Eglot version: reproduced with emacs -Q on emacs30 pretest.
Server used: pyright

Steps to reproduce:

Using the following file:

```
def print_lorem_ipsum():
    print("Lorem ipsum dolor sit amet, consectetur adipiscing elit.")

def print_lorem_ipsum_upper():
    print("LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT.")
```

1. Initialize the git repository:

$ git init
$ git add a.py
$ git commit

$ git checkout -b test
# edit a.py and remove the function print_lorem_ipsum_upper
$ git add a.py
$ git commit

2. Start emacs on the test branch:

$ emacs -Q a.py
M-x auto-revert-mode
M-x eglot

3. Then go to the main branch:

$ git checkout main

After auto-revert-mode triggers a file reload, eglot will report that the
function print_lorem_ipsum_upper is duplicated. (See screenshot in
attachment)
See also the `eglot-events-buffer` logs in attachment.

In this state, even if you delete the function and rewrite it, the error
will stay.
The only way to fix the issue is to do a eglot-reconnect.

I can reproduce the issue on emacs30 with built-in eglot and I didn't have
the problem on emacs29 with eglot 1.15 from ELPA.

Thanks.
[Message part 2 (text/html, inline)]
[eglot_logs.txt (text/plain, attachment)]
[Screenshot 2024-09-21 at 14.30.02.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73414; Package emacs. (Thu, 26 Sep 2024 15:09:01 GMT) Full text and rfc822 format available.

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

From: Romain Ouabdelkader <romain.ouabdelkader <at> gmail.com>
To: 73414 <at> debbugs.gnu.org
Subject: eglot: using auto-revert-mode and git checkout corrupts diagn
Date: Thu, 26 Sep 2024 17:06:08 +0200
[Message part 1 (text/plain, inline)]
Hello,

It seems the issue got fixed by
commit 29d50e245f84d62a9cf4ce00593ea4c63fc4f44d, I can't reproduce the
issue with this patch installed.
You can close the issue (not sure if I can?)

Thank you.
[Message part 2 (text/html, inline)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 26 Sep 2024 15:45:02 GMT) Full text and rfc822 format available.

Notification sent to Romain Ouabdelkader <romain.ouabdelkader <at> gmail.com>:
bug acknowledged by developer. (Thu, 26 Sep 2024 15:45:02 GMT) Full text and rfc822 format available.

Message #13 received at 73414-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Romain Ouabdelkader <romain.ouabdelkader <at> gmail.com>
Cc: 73414-done <at> debbugs.gnu.org
Subject: Re: bug#73414: eglot: using auto-revert-mode and git checkout corrupts
 diagn
Date: Thu, 26 Sep 2024 18:44:14 +0300
> From: Romain Ouabdelkader <romain.ouabdelkader <at> gmail.com>
> Date: Thu, 26 Sep 2024 17:06:08 +0200
> 
> It seems the issue got fixed by commit 29d50e245f84d62a9cf4ce00593ea4c63fc4f44d, I can't reproduce the
> issue with this patch installed.
> You can close the issue (not sure if I can?)

Thanks, closing (you can also).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73414; Package emacs. (Thu, 26 Sep 2024 21:37:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: 73414 <at> debbugs.gnu.org, eliz <at> gnu.org, romain.ouabdelkader <at> gmail.com
Subject: Re: bug#73414: eglot: using auto-revert-mode and git checkout
 corrupts diagn
Date: Fri, 27 Sep 2024 00:29:55 +0300
On 26/09/2024 18:44, Eli Zaretskii wrote:
>> From: Romain Ouabdelkader<romain.ouabdelkader <at> gmail.com>
>> Date: Thu, 26 Sep 2024 17:06:08 +0200
>>
>> It seems the issue got fixed by commit 29d50e245f84d62a9cf4ce00593ea4c63fc4f44d, I can't reproduce the
>> issue with this patch installed.

Thanks for verifying!

>> You can close the issue (not sure if I can?)
> Thanks, closing (you can also).

To elaborate: one can close a bug report here by sending an email to the 
address NUM-done <at> debbugs.gnu.org.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 25 Oct 2024 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 238 days ago.

Previous Next


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