all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Joost Kremers" <joostkremers@fastmail.fm>,
	"João Távora" <joaotavora@gmail.com>
Cc: 73355@debbugs.gnu.org
Subject: bug#73355: 29.4; eglot-rename reports success when it shouldn't
Date: Sat, 21 Sep 2024 13:34:58 +0300	[thread overview]
Message-ID: <864j6947n1.fsf@gnu.org> (raw)
In-Reply-To: <86plozvomz.fsf@fastmail.fm> (message from Joost Kremers on Thu,  19 Sep 2024 14:01:08 +0200)

> From: Joost Kremers <joostkremers@fastmail.fm>
> Date: Thu, 19 Sep 2024 14:01:08 +0200
> 
> 
> I tried to use 'eglot-rename' to rename a variable to a name that already
> existed in the relevant function. The change was not applied but Eglot
> nonetheless reported "[eglot] Edit successful!".
> 
> This was in a Python buffer, using python-ts-mode and basedpyright
> (v1.17.1) as language server. The relevant code snippet:
> 
> ```
> def main():
>     sizes = [100, 1000, 10000]
>     results: dict[str, list[float]] = {
>         "Linear search": [],
>         "Binary search": [],
>         "Interpolation search": [],
>     }
>     for size in sizes:
>         seq: list[int] = sorted([random.randint(0, 10000) for _ in range(size)])
>         x = random.choice(arr)
>         results["Linear search"].append(measure_time(linear_search, arr, x))
>         results["Binary search"].append(measure_time(binary_search, arr, x))
>         results["Interpolation search"].append(
>             measure_time(interpolation_search, arr, x)
>         )
> ```
> 
> Note the 'seq' variable in the first line of the for loop, and the 'arr'
> variable in the three '.append' invocations. With point on the first 'arr',
> calling eglot-rename and giving 'seq' as the new name, Eglot refuses to
> rename the three occurrences of 'arr' (which makes sense, given that a
> variable with that name obviously already exists), but still reports
> success.
> 
> (Note that there is no problem if the 'seq' above is also 'arr'. Then
> renaming works fine.)

Adding João.





  parent reply	other threads:[~2024-09-21 10:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-19 12:01 bug#73355: 29.4; eglot-rename reports success when it shouldn't Joost Kremers
2024-09-19 16:07 ` Joost Kremers
2024-09-21 10:34 ` Eli Zaretskii [this message]
2024-09-21 11:43   ` João Távora
2024-09-21 12:12     ` Joost Kremers
2024-09-21 20:15       ` João Távora
2024-09-21 22:04         ` Joost Kremers
2024-09-21 22:31           ` João Távora
2024-09-21 22:46     ` Joost Kremers
2024-10-05  9:57       ` Eli Zaretskii
2024-10-19  7:03         ` Eli Zaretskii
2024-11-02 11:43           ` Eli Zaretskii
2024-11-02 13:26             ` João Távora

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

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

  git send-email \
    --in-reply-to=864j6947n1.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=73355@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=joostkremers@fastmail.fm \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.