Refactor / rename not working, or stops working

Answered

When I rightclick a method name or function name, I have the option to Refactor - Rename...

I can fill out the dialog, but no matter the options I select, once I click 'Refactor' or 'Preview', the dialog closes and nothing happens. No error message, nothing in the event log, no change to the source.

The subject says 'stops working' because restarting the IDE seems to fix the problem. Note that in all cases where I've encountered the problem, I had multiple projects in separate windows of the IDE open - not sure if that affects it though (it's just very common for me).

PyCharm 2017.3.2 (Professional Edition)
Build #PY-173.4127.16, built on December 19, 2017
Licensed to Jaap van der Velde
You have a perpetual fallback license for this version
Subscription is active until February 12, 2019
JRE: 1.8.0_152-release-1024-b8 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 7 6.1

I've also recently started noticing extreme lagginess of my entire PC when PyCharm is open, but I'm suspecting recently replaced anti-virus of causing this problem. So, only mentioning it if it helps in identifying my refactoring issue. The anti-virus doesn't stop the refactoring from working initially, so I don't think there's a direct causal relationship there.

 

Cheers, JAAP.

15 comments
Comment actions Permalink

PyCharm 2017.3.2 (Professional Edition)
Build #PY-173.4127.16, built on December 19, 2017
Licensed to Александр Плосков
Subscription is active until October 22, 2018
For educational use only.
JRE: 1.8.0_152-release-1024-b8 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

Have same problem. Invalidate caches and restart solved my problem. Just restart IDE cannot solve this issue.

1
Comment actions Permalink

Good to know I'm not the only one. I will try to invalidate caches next time as well.

However, just a restart of the IDE did solve the problem every time, but of course it also always returns at some point.

0
Comment actions Permalink

Same here: works again after invalidation and restart.

UPS - slightly offtopic - my case has nothing to do with PyCharm - only java project in use here!
Still, I leave my comment in here, as this was the first hit in google

Maybe this helps:

* new start of intellij
* refactor java property + getter/setter, etc. - works
* start debugging
* refactor another java property - not working
* invalidate and restart
* wait quite a while until index is built
* refactoring works

0
Comment actions Permalink

Happening on Goland.

GoLand 2017.3
Build #GO-173.3727.144, built on November 30, 2017
Licensed to xxxx
You have a perpetual fallback license for this version
Subscription is active until February 27, 2019
JRE: 1.8.0_161-b12 x86
JVM: Java HotSpot(TM) Client VM by Oracle Corporation
Windows 10 10.0

0
Comment actions Permalink

Hello,

Could you please report an issue on YouTrack: http://youtrack.jetbrains.com/issues/IDEA. attaching idea.log ("Help | Show log in...") after reproducing the problem and restarting IDE?

 

0
Comment actions Permalink

Hi,

I'm sorry, I cannot reliably reproduce the issue and possibly it has been (intentionally or accidentally) fixed in recent updates. 

However, I can tell you that I've noticed that, when refactoring, in some cases the refactor will be:

  • live (happening as I type), in some cases
  • immediately applied (through a dialog, but executed without additional steps and in some cases
  • a 'Find' windows opens to show the impact before the refactor is executed.

In this final situation, the Find window gets populated, but it is docked to the bottom of the screen, along with debug, console, terminal, etc. and it doesn't come to the front. So, unless you know what to look for, there is no cue to actually open it, especially if it was already open prior to the 'Refactor' command (otherwise you might see its tab appear).

It is quite possible that the technical issue I thought I was experiencing was actually just a failure to notice the 'Find' window opening.

So, at the very least I would like to see this fixed:

  • When refactoring, in the case that the Find window needs to be presented to allow the user to check the refactor, make sure the find window opens and gets moved to the front. Possibly giving it focus.

It doesn't have to pop out or anything, just making sure it is visible would help.

Ideally, I would like to see:

  • Separate or relabel the 'Find' and 'Refactor' window. They can be the same (i.e. same layout and function), but opening a window or tab named 'Refactor' and showing it would make it much clearer.

I've submitted this issue on YouTrack as PY-28884, since I cannot provide the information for any technical issue as reported before, if it still exists.

0
Comment actions Permalink

Thanks! We have similar issue for platform: https://youtrack.jetbrains.com/issue/IDEA-180334. You could check the issue with 2018.1 EAP: https://www.jetbrains.com/pycharm/nextversion/. Some fixes were included there.

0
Comment actions Permalink

I have the same issue, Pycharm 2019.01 rename stopped working, is the issue solved?

1
Comment actions Permalink

@Taylortianyuchen

Sorry, can't reproduce the issue and didn't find any open issues in the tracker.

Do you have the steps to reproduce the issue? Please provide them along with the logs (https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files). You can upload logs to our FTP https://uploads.services.jetbrains.com/

 

0
Comment actions Permalink

I'm having also problems with the refactoring.

 

This is not working any more.

When I highlight the code that I would like to refactor and then I go to Refactor --> Extract ---> Method I'm seeing the dialog

 

 

but when I click on the Preview or Refactor nothing happens.

Please fix this as soon as possible as this is one of the functionality I think is the most useful part of Intelij

 

Version Im using is:

IntelliJ IDEA 2018.2.8 (Ultimate Edition)
Build #IU-182.5262.2, built on March 28, 2019
JRE: 1.8.0_152-release-1248-b22 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.2

1
Comment actions Permalink

Please provide code snippet which can be used to reproduce the issue.

0
Comment actions Permalink

Same issue happens to me, can't refactor any method in or outside of PyCharm project.

0
Comment actions Permalink

Hi Hod,

Could you please provide sample code and idea.log file from Help | Show Log in... after reproducing?

0
Comment actions Permalink

I have the same issue, the idea.log file show that it's the AEM plugin to blame. So I turn AEM off in plugin settings, after restart pycharm, rename works fine.

0
Comment actions Permalink

@Sergey Karpov , for your information (It's not a good experience for the users to fail to rename without any information to help, even if it's caused by a puglin ):

2019-07-22 06:17:35,495 [ 187352] ERROR - llij.ide.plugins.PluginManager - com/intellij/psi/PsiPackage
java.lang.NoClassDefFoundError: com/intellij/psi/PsiPackage
at r.canProcessElement(IntelliJAEMPlugin:19)
at com.intellij.refactoring.rename.RenamePsiElementProcessor.allForElement(RenamePsiElementProcessor.java:108)
at com.intellij.refactoring.rename.RenameProcessor.prepareRenaming(RenameProcessor.java:108)
at com.intellij.refactoring.rename.RenameProcessor.doRun(RenameProcessor.java:102)
at com.intellij.refactoring.BaseRefactoringProcessor.run(BaseRefactoringProcessor.java:547)
at com.intellij.refactoring.ui.RefactoringDialog.invokeRefactoring(RefactoringDialog.java:193)
at com.intellij.refactoring.rename.RenameDialog.performRename(RenameDialog.java:301)
at com.intellij.refactoring.rename.RenameDialog.doAction(RenameDialog.java:279)
at com.intellij.refactoring.rename.RenameWithOptionalReferencesDialog.doAction(RenameWithOptionalReferencesDialog.java:60)
at com.intellij.refactoring.ui.RefactoringDialog.doRefactorAction(RefactoringDialog.java:88)
at com.intellij.refactoring.ui.RefactoringDialog$RefactorAction.actionPerformed(RefactoringDialog.java:171)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6548)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3325)
at java.awt.Component.processEvent(Component.java:6313)
at java.awt.Container.processEvent(Container.java:2237)
at java.awt.Component.dispatchEventImpl(Component.java:4903)
at java.awt.Container.dispatchEventImpl(Container.java:2295)
at java.awt.Component.dispatchEvent(Component.java:4725)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
at java.awt.Container.dispatchEventImpl(Container.java:2281)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4725)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:737)
at java.awt.EventQueue$4.run(EventQueue.java:735)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:719)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:664)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
at java.awt.Dialog.show(Dialog.java:1077)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:698)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:430)
at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1681)
at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1630)
at com.intellij.refactoring.ui.RefactoringDialog.show(RefactoringDialog.java:55)
at com.intellij.refactoring.rename.PsiElementRenameHandler.rename(PsiElementRenameHandler.java:191)
at com.intellij.refactoring.rename.PsiElementRenameHandler.rename(PsiElementRenameHandler.java:162)
at com.intellij.refactoring.rename.PsiElementRenameHandler.invoke(PsiElementRenameHandler.java:112)
at com.intellij.refactoring.rename.PsiElementRenameHandler.invoke(PsiElementRenameHandler.java:79)
at com.intellij.refactoring.actions.BaseRefactoringAction.actionPerformed(BaseRefactoringAction.java:134)
at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:258)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:153)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:273)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:618)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.lambda$processAction$2(IdeKeyEventDispatcher.java:667)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:195)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:666)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.java:519)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:474)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:211)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:643)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
2019-07-22 06:17:35,496 [ 187353] ERROR - llij.ide.plugins.PluginManager - PyCharm 2018.3.7 Build #PY-183.6156.16
2019-07-22 06:17:35,496 [ 187353] ERROR - llij.ide.plugins.PluginManager - JDK: 1.8.0_152-release; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
2019-07-22 06:17:35,496 [ 187353] ERROR - llij.ide.plugins.PluginManager - OS: Linux
2019-07-22 06:17:35,496 [ 187353] ERROR - llij.ide.plugins.PluginManager - Plugin to blame: AEM Support version: 0.8.1
2019-07-22 06:17:36,046 [ 187903] ERROR - llij.ide.plugins.PluginManager - com/intellij/psi/PsiPackage

0

Please sign in to leave a comment.