Refactor rename stops working

has anybody seen this problem?  after a while refactoring stops working when i try to rename a class or variable.  it either opens the refactor highlight, or the dialog box.  you can type in the new name but in the case of the highlight, when you press enter it just reverts.  in the case of the dialog box, you click the refactor button and nothing happens.  the only way to fix it is to restart IDEA.

24 comments
Comment actions Permalink

Hi Christopher,

What version of IDE are you using? And in which language does it happen?

0
Comment actions Permalink

oops not very informative of me.  this is intellij idea 12.0.2, i've never seen it in intellij 11.  i did just turn on the gradle plugin though so i'm not sure if that has something to with it.  this is with Java, btw.

0
Comment actions Permalink

Hi,
please attach your idea.log (Help|Reveal log)

0
Comment actions Permalink

attached



Attachment(s):
logs.zip
0
Comment actions Permalink

Hi Christopher,

Can you check if the problem occurrs if you disable spring plugin?

Denis

0
Comment actions Permalink

hum a bit difficult as i use spring all the time and the problem doesn't happen all the time, it's random :(.

0
Comment actions Permalink

I'm having a similar issue, but for me the process goes all the way up to a "preprocessing usages" dialog, which never displays a progress bar and just hangs.  This is a serious issue.  Log attached.

Version 11.1.5, Java



Attachment(s):
idea.log.zip
0
Comment actions Permalink

There is no rename in your log and the initial issue was introduced in 12.0.x and you use 11.1.5. So I suppose that you have another issue but it is not enough information to reproduce it. So please describe your case in more details

0
Comment actions Permalink

I don't know what else I can describe for you.  Do you have any specific questions?


0
Comment actions Permalink

E.g. thread dumps from system directory or from the console?

0
Comment actions Permalink

Do you mean from the Intellij installation directory? I was assuming the log I gave would have whatever thread dumps you were looking for.  Also of interest: if I go through the dialog (Shift-F6 twice), and don't check either checkbox, the rename works fine.

0
Comment actions Permalink

idea.log contains exception and thread dumps directories near idea.log contains dumps of all threads when UI hangs

0
Comment actions Permalink

attached.



Attachment(s):
log.zip
0
Comment actions Permalink

I do not see any hang in the thread dumps attached. Could you please take a CPU snapshot http://devnet.jetbrains.com/docs/DOC-192

0
Comment actions Permalink

I am having the same problem. I've attached my log file. I'm on IDEA 12.1.4.



Attachment(s):
idea.log.zip
0
Comment actions Permalink

I started disabling plugins until I could find it. I had disabled Gradle, JavaFX, and Attlassian Connector with no difference seen. In my particular project, I get the popup asking me to configure Android & Python SDKs, but I always ignored it. By turning off Android & Python plugins, I now have refactoring support back. I don't know if the problem is that Android and/or Python SDK is the culprit, or if the problem is just that not configuring an SDK when a plugin is asking for it is the culprit, or something else.

0
Comment actions Permalink

Richard, sorry for the late responce. Your problem was possible to fix with File|Invalidate Caches action. The indices are corrupted and that's why refactorings as well as possible find usages didn't work,

3
Comment actions Permalink

Thanks for this tip.  Every few weeks using IDEA 12.x, the ability to rename any variable, method, or class stops working for me.  It doesn't work with either shift-f6 or by going through the context menu.

Previously, the only thing that fixed it was to completely delete the IDEA project (.idea folder and all *.iml files), then reopen the project from its Maven pom.xml.

However, this technique Anna describes works.  By invalidating the cache and restarting, the ability to rename things is restored.  :-)

1
Comment actions Permalink

When you have at least somewhat complex rename, after you are pressing done, IntelliJ changes all to the previous state and shows the changes in the Refactoring Preview window - look for it below, similar to the Find tab. This window has below the Do Refactor button. Simply press it.

2
Comment actions Permalink

Thanks - that's it - it works :-) .

0
Comment actions Permalink

Still happens in PyCharm 2017.3.2 with no plugins installed.  FYI just invalidating caches without restarting seemed to fix it.  Still, please keep trying to find and correct whatever is corrupting the indexes.

0
Comment actions Permalink

I had some keybinds on SHIFT+F6 and SHIFT+F5 and I had to remove them to make refactor working.

:)

0
Comment actions Permalink

Same here: 

Android Studio 3.1.3
Build #AI-173.4819257, built on June 4, 2018
JRE: 1.8.0_152-release-1024-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.16.13-1-ARCH

Invalidating helps but the issue is a bit annoying.

0
Comment actions Permalink

Same issue here.

Android Studio 3.1.3
Build #AI-173.4819257, built on June 5, 2018
JRE: 1.8.0_152-release-1024-b02 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 7 6.1

Class rename neither work unless clean build first.

0

Please sign in to leave a comment.