unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Dario Gjorgjevski" <dario.gjorgjevski@gmail.com>,
	"João Távora" <joaotavora@gmail.com>
Cc: 72696@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS)
Date: Thu, 19 Sep 2024 08:32:21 +0300	[thread overview]
Message-ID: <86a5g49pju.fsf@gnu.org> (raw)
In-Reply-To: <CAJm4QYMfFWRQJsyW5pDreTwPPwwGGBng+9wO6vvZf=Tx9PpnAQ@mail.gmail.com> (message from Dario Gjorgjevski on Thu, 19 Sep 2024 00:02:34 +0200)

> Cc: 72696@debbugs.gnu.org
> From: Dario Gjorgjevski <dario.gjorgjevski@gmail.com>
> Date: Thu, 19 Sep 2024 00:02:34 +0200
> 
> Hi, Stefan,
> 
> On Mon, Sep 9, 2024 at 1:06 AM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> >
> > > As far as I can see, the testDocument/didChange request should not be
> > > there.
> >
> > Either the `didClose/didOpen` should not be there, or the `didChange` should
> > not be there.  The problem is that we have both.
> >
> > Can you try the patch below, which I suspect should fix your problem?
> > It should get rid of the `didChange` in your recipe.
> 
> I gave your patch a try and it indeed fixes the issue.  Thank you very
> much for looking into it!

João, is Stefan's patch okay with you?  AFAIU, the same problem exists
on the emacs-30 release branch, so I'd like to install the patch
there, if you agree.

Here's the patch in case you didn't see it (I CC'ed you on the
original report, but subsequent discussion omitted you for some
reason, sigh):

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 82e99a2c920..a2c9f73fc73 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -2813,6 +2813,8 @@ eglot--signal-textDocument/didChange
 
 (defun eglot--signal-textDocument/didOpen ()
   "Send textDocument/didOpen to server."
+  ;; Flush any potential pending change.
+  (eglot--track-changes-fetch eglot--track-changes)
   (setq eglot--recent-changes nil
         eglot--versioned-identifier 0
         eglot--TextDocumentIdentifier-cache nil)





  reply	other threads:[~2024-09-19  5:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-18 10:58 bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS) Dario Gjorgjevski
2024-08-18 11:02 ` Eli Zaretskii
2024-08-18 16:10 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-18 20:36   ` Dario Gjorgjevski
2024-08-20 12:15     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-22 11:19       ` Dario Gjorgjevski
2024-08-22 11:27         ` Dario Gjorgjevski
2024-09-07  7:15           ` Eli Zaretskii
2024-09-08 23:06         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-18 22:02           ` Dario Gjorgjevski
2024-09-19  5:32             ` Eli Zaretskii [this message]
2024-09-19 12:58               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-19 21:47                 ` João Távora
2024-09-20  6:21                   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86a5g49pju.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=72696@debbugs.gnu.org \
    --cc=dario.gjorgjevski@gmail.com \
    --cc=joaotavora@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).