unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Troy Brown" <brownts@troybrown.dev>,
	"João Távora" <joaotavora@gmail.com>
Cc: 70929@debbugs.gnu.org
Subject: bug#70929: 30.0.50; eglot--apply-text-edits prevents point adjustment
Date: Tue, 14 May 2024 09:23:42 +0300	[thread overview]
Message-ID: <86seykx66p.fsf@gnu.org> (raw)
In-Reply-To: <CABvCZ42smi66y8DfoYU32pPPm84m4ZpH4+hNLCeQe7C9v8ZD2Q@mail.gmail.com> (message from Troy Brown on Mon, 13 May 2024 22:15:07 -0400)

> From: Troy Brown <brownts@troybrown.dev>
> Date: Mon, 13 May 2024 22:15:07 -0400
> 
> Language Servers may use onTypeFormatting to provide indentation for a
> buffer.  When this happens, the language server will indicate a
> newline trigger character (in the DocumentOnTypeFormattingOptions).
> In the Emacs buffer, after hitting RET, point is moved to the next
> line and a textDocument/onTypeFormatting request is sent from Eglot to
> the server.  The server responds back with the corresponding spacing
> prefix for the line in newText of the TextEdit response.  However,
> when Eglot applies the text edit to insert this spacing, via
> eglot--apply-text-edits, it uses save-excursion, and this prevents the
> point from being pushed to the end of the inserted spacing.  It would
> seem that save-excursion should be avoided when applying text edits.
> This issue has been observed with the Ada Language Server.

Thanks.

João, any comments or suggestions?





  parent reply	other threads:[~2024-05-14  6:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-14  2:15 bug#70929: 30.0.50; eglot--apply-text-edits prevents point adjustment Troy Brown
2024-05-14  5:30 ` Felician Nemeth
2024-05-14 12:38   ` Troy Brown
2024-05-14  6:23 ` Eli Zaretskii [this message]
2024-05-14  9:28   ` João Távora
2024-05-14 12:43     ` Troy Brown
2024-05-14 14:16       ` João Távora
2024-05-15 12:58         ` Troy Brown
2024-05-15 15:10           ` João Távora
2024-05-21  3:35         ` Troy Brown

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=86seykx66p.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=70929@debbugs.gnu.org \
    --cc=brownts@troybrown.dev \
    --cc=joaotavora@gmail.com \
    /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).