Refactoring seems to be broken in 2025.2.x and 2025.3.x

I think the refactoring feature is broken in recent versions as I am seeing at least two issues.

  1. When I rename a variable, the updated name only sticks for the currently selected instance. As soon as I press Enter, the variable reverts to its original name everywhere else. I have to click elsewhere in order for the renaming to go through. Otherwise, I have to do a manual search and replace.
  2. PyCharm would try to rename all variables with the same name across the entire project and not just in the current scope.

Both issues occurred in version 2025.2.5 for me. Upgrading to 2025.3.3 seems to have resolved the second issue, but the first one remains.

Environment information:

PyCharm version: 2025.3.3

OS: Windows 11

I have no plug-ins installed (other than the default ones) besides Classic UI.

0

Hi Danny

Thank you for this report, 

 

I tried with a simple snippet and cannot replicate this.

Would you please provide me a minimal snippet where you can replicate the issue (with exact instructions which variable to refactor)

May I ask if using a new test project you can replicate the issue also ? 

 

Could you please try to do File | Invalidate caches and let me know if the situation changes?

 

Kind regards,

0

Yes, I've already tried File > Invalidate Caches…

I did some more testing and found that the issue only seems to affect specific files. It definitely affects even a file consisting of a simple function:

def foo(a, b):
    c = a + b
    d = a + b
    print(c)
    print(d)

e = 1
f = 2

foo(e, f)

For example, I use Rename to change foo to bar. The other instance initially changes to bar as well, but reverts to foo when I press Enter.

I do have a file not affected by this issue, but I'm unable to share it as it contains confidential information. :-(

0

Hi Danny

 

Thank you for the snippet.

 

Would such snippet only be broken in a specific file ? 

What if you create a new test project and use the same snippet, would you get the same problem?

I am unable to replicate using PyCharm 2025.3.3 w. classic UI and this snippet.

 

If the problem seem to affect a certain project I would advise to reset the project by doing this operations:

  • Close the IDE
  • Navigate to the project root directory and backup/delete the .idea folder (please note in UNIX based OS this is a hidden folder)
  • Start the IDE

 

If the issue still persists in a new project would you please provide me a screenshot of the rename selected options

Also please let me know which python version you are using and if any tools to manage your python environments (such as conda/uv..)

Kind regards,

0

Hi Danny

 

Thank you for the video, I tried to replicate using a similar python file to the one in the video however no luck so far.

 

May I ask if you have done the .idea folder reset?

  • Close the IDE
  • Navigate to the project root directory and backup/delete the .idea folder (please note in UNIX based OS this is a hidden folder)
  • Start the IDE

As I can see the project files are showing in yellow background so maybe files are excluded from the project which could point to a .idea folder corruption (or is this a custom theme configuration ? )

 

Kind regards,

 

0

This fails for as well

0

Hi Ekurilina 

 

Could you please also follow the steps advised above and let me know if it helps?
 

  • Close the IDE
  • Navigate to the project root directory and backup/delete the .idea folder (please note in UNIX based OS this is a hidden folder)
  • Start the IDE

 

Also would you please provide a screenshot/screenrecording showing the full IDE and the error?

0

Same thing happens for me, both in PyCharm as well as IntelliJ Ultimate 2025.3.3 with python plugin. Consistently reproducible inside Jupyterlab notebook files in a UV managed environment.
Python 3.13, JupyterLab 4.5.6 in pyproject.toml

Shift-F6 to rename variable, preview works normally over all instances of the variable, press Enter to finalize, and only the variable having the focus will get renamed.

Invalidating caches as well as removing all intelliJ artifacts from the project and reloading make no difference.

0

Hi N Van Klaveren 

 

As we have not bee able to replicate this, may I ask if it is possible for you to share a full minimal project where the issue can be replicated?

If so would be great to upload it to our cloud drive : https://uploads.jetbrains.com/ and provide me the upload ID (Only JetBrains members have access)

A screen capture and IDE Logs would be helpful as well.

The logs can be provided from Help -> Collect Logs and diagnostics data

 

Kind regards,

 

 

 

 

0

请先登录再写评论。