From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#73355: 29.4; eglot-rename reports success when it shouldn't Date: Sat, 21 Sep 2024 13:34:58 +0300 Message-ID: <864j6947n1.fsf@gnu.org> References: <86plozvomz.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28566"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73355@debbugs.gnu.org To: Joost Kremers , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 21 12:35:59 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1srxT4-0007DT-Fg for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Sep 2024 12:35:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srxSu-0002b4-1K; Sat, 21 Sep 2024 06:35:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1srxSq-0002aG-IP for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2024 06:35:46 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1srxSo-00064K-GI for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2024 06:35:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=ODNv3Kg2NrpvV5jgPN+zhA2HPoZ+qUD5nZ+hNKhJZ8Y=; b=al4n26d3UrHUqfSEtFmOYIAi6J4iJDdJWPtKb9txNiDoYINhavu57Uza5fAxNVSl5KkrW8sEBZFblRInEDLEMVX+Vx1ZyjEo7QxlrrZ4MnMQogGfKNSVWjHR4FBI8NpZKGPMz3JLF1S0tlgpMWb80OMCdi5VfcAQxh41eVi5rt/O8Mo/nkCqAMNxd0olvxh580uy6hsm/o8SawmHGJP85fUywjm3C/FONXwEFXLHXJs+9hv+a2dSBGU6qvGIOrQkyjW04RdI1Wv/H6qK8rEIYNXVwn7DUxYstya5qvHDaKU8w1CpNQLDp3+cYZpWLD5Bek1MheRrJgFAMEfWpyLv2g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1srxT8-0006Zw-HH for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2024 06:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Sep 2024 10:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73355 X-GNU-PR-Package: emacs Original-Received: via spool by 73355-submit@debbugs.gnu.org id=B73355.172691493025214 (code B ref 73355); Sat, 21 Sep 2024 10:36:02 +0000 Original-Received: (at 73355) by debbugs.gnu.org; 21 Sep 2024 10:35:30 +0000 Original-Received: from localhost ([127.0.0.1]:37392 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srxSb-0006XK-M5 for submit@debbugs.gnu.org; Sat, 21 Sep 2024 06:35:30 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srxSZ-0006QT-1r for 73355@debbugs.gnu.org; Sat, 21 Sep 2024 06:35:27 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1srxS9-0005pP-LF; Sat, 21 Sep 2024 06:35:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=ODNv3Kg2NrpvV5jgPN+zhA2HPoZ+qUD5nZ+hNKhJZ8Y=; b=MiK6u+U/EWfIGovGauev I9pUiBAlHmnQexlRRU3cl/tdVE5TFvPfAmNsE/Nvj7L0gCcb1QaFfCgPoHhmXqxcRYBCVZs6uHglE zhT/PmqWh9WRo3r1hIehYzLsLYKbZJBlUDaLZdzKaflaLcD06fFRDEqIUu1D3+5vVe+E8KKW3gBKX AluefTTVRZdfxdCms6BVSIIVU7Jas1wjgx/XAAZZQzwKIM/C4zd7KgBINJbrbQPsj2lAGFCKzk6+G E922FKLjk6vpo/Fl23cSQTJpLp+KVCy9AYjbaC5eGokH0aL6RcOV2UnCAZ0nIQg0JsQcRJLg/Fi16 k6+oEIpR4ZiJvQ==; In-Reply-To: <86plozvomz.fsf@fastmail.fm> (message from Joost Kremers on Thu, 19 Sep 2024 14:01:08 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292176 Archived-At: > From: Joost Kremers > 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.