unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Dario Gjorgjevski <dario.gjorgjevski@gmail.com>
Cc: 72696@debbugs.gnu.org
Subject: bug#72696: Track-changes errors out when file is overwritten using Node.js's fs.writeFile (at least on macOS)
Date: Sun, 08 Sep 2024 19:06:55 -0400	[thread overview]
Message-ID: <jwv4j6pbve0.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAJm4QYPyy3Em9HUWpvLeC8w0BLwbU2TyUeFEb+1S4y4GKaUGMQ@mail.gmail.com> (Dario Gjorgjevski's message of "Thu, 22 Aug 2024 13:19:39 +0200")

[-- Attachment #1: Type: text/plain, Size: 524 bytes --]

> 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.

We could also change Eglot so it doesn't do `didClose/didOpen` upon
`revert-buffer` (in which case it should/will do the `didChange`), but
that should be a separate concern.


        Stefan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: eglot.patch --]
[-- Type: text/x-diff, Size: 529 bytes --]

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)

  parent reply	other threads:[~2024-09-08 23:06 UTC|newest]

Thread overview: 16+ 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 [this message]
2024-09-18 22:02           ` Dario Gjorgjevski
2024-09-19  5:32             ` Eli Zaretskii
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
2024-09-20 18:46                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-24 17:51                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=jwv4j6pbve0.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=72696@debbugs.gnu.org \
    --cc=dario.gjorgjevski@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).