GNU bug report logs -
#73355
29.4; eglot-rename reports success when it shouldn't
Previous Next
Full log
Message #13 received at 73355 <at> debbugs.gnu.org (full text, mbox):
> From: Joost Kremers <joostkremers <at> 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.
This bug report was last modified 225 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.