Haehnchen/idea-php-annotation-plugin

Cannot find manipulator for PsiElement(DOC_IDENTIFIER)

sstok opened this issue · 2 comments

sstok commented
2020-01-27 19:10:42,490 [8299698]  ERROR - .intellij.psi.PsiReferenceBase - PhpStorm 2019.3.2  Build #PS-193.6015.48 
2020-01-27 19:10:42,490 [8299698]  ERROR - .intellij.psi.PsiReferenceBase - JDK: 11.0.5; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o 
2020-01-27 19:10:42,491 [8299699]  ERROR - .intellij.psi.PsiReferenceBase - OS: Mac OS X 
2020-01-27 19:10:42,491 [8299699]  ERROR - .intellij.psi.PsiReferenceBase - Last Action: NextTemplateVariable 
2020-01-27 19:10:42,491 [8299699]  ERROR - .intellij.psi.PsiReferenceBase - Current Command: Renaming Class ParkManager\Domain\Webhosting\Plan\WebhostingPlan to PredefinedConstraintsSet 
2020-01-27 19:10:42,643 [8299851]  ERROR - llij.ide.plugins.PluginManager - null 
java.lang.NullPointerException
	at com.intellij.psi.PsiReferenceBase.handleElementRename(PsiReferenceBase.java:120)
	at com.intellij.refactoring.rename.RenameUtil.rename(RenameUtil.java:287)
	at com.intellij.refactoring.rename.RenameUtil.doRenameGenericNamedElement(RenameUtil.java:244)
	at com.intellij.refactoring.rename.RenamePsiElementProcessor.renameElement(RenamePsiElementProcessor.java:54)
	at com.intellij.refactoring.rename.RenameUtil.doRename(RenameUtil.java:208)
	at com.intellij.refactoring.rename.RenameProcessor.performRefactoring(RenameProcessor.java:379)
	at com.intellij.refactoring.BaseRefactoringProcessor.lambda$doRefactoring$9(BaseRefactoringProcessor.java:503)
	at com.intellij.refactoring.BaseRefactoringProcessor.lambda$doRefactoring$10(BaseRefactoringProcessor.java:514)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$null$9(ApplicationImpl.java:865)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:163)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:585)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:531)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:150)
	at com.intellij.openapi.progress.util.PotemkinProgress.runInSwingThread(PotemkinProgress.java:190)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$runEdtProgressWriteAction$10(ApplicationImpl.java:865)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:873)
	at com.intellij.openapi.application.impl.ApplicationImpl.runEdtProgressWriteAction(ApplicationImpl.java:863)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithNonCancellableProgressInDispatchThread(ApplicationImpl.java:846)
	at com.intellij.refactoring.BaseRefactoringProcessor.doRefactoring(BaseRefactoringProcessor.java:514)
	at com.intellij.refactoring.BaseRefactoringProcessor.lambda$execute$2(BaseRefactoringProcessor.java:311)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:212)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:178)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:168)
	at com.intellij.refactoring.BaseRefactoringProcessor.execute(BaseRefactoringProcessor.java:309)
	at com.intellij.refactoring.BaseRefactoringProcessor.lambda$null$5(BaseRefactoringProcessor.java:439)
	at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:83)
	at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:149)
	at com.intellij.refactoring.BaseRefactoringProcessor.lambda$customizeUsagesView$6(BaseRefactoringProcessor.java:437)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:220)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:178)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:168)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:154)
	at com.intellij.usages.impl.UsageViewImpl$MyPerformOperationRunnable.run(UsageViewImpl.java:2118)
	at com.intellij.usages.impl.UsageViewImpl$10.actionPerformed(UsageViewImpl.java:1537)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:270)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6651)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6416)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:908)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:846)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:778)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:424)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:423)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
2020-01-27 19:10:42,650 [8299858]  ERROR - llij.ide.plugins.PluginManager - PhpStorm 2019.3.2  Build #PS-193.6015.48 
2020-01-27 19:10:42,650 [8299858]  ERROR - llij.ide.plugins.PluginManager - JDK: 11.0.5; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o 
2020-01-27 19:10:42,650 [8299858]  ERROR - llij.ide.plugins.PluginManager - OS: Mac OS X 
2020-01-27 19:10:42,650 [8299858]  ERROR - llij.ide.plugins.PluginManager - Last Action: NextTemplateVariable 
2020-01-27 19:11:02,780 [8319988]  ERROR - .intellij.psi.PsiReferenceBase - Cannot find manipulator for PsiElement(DOC_IDENTIFIER) in de.espend.idea.php.annotation.reference.DocTagNameAnnotationReferenceContributor$PhpDocIdentifierReference(PsiElement(DOC_IDENTIFIER):null) class class de.espend.idea.php.annotation.reference.DocTagNameAnnotationReferenceContributor$PhpDocIdentifierReference 
java.lang.Throwable: Cannot find manipulator for PsiElement(DOC_IDENTIFIER) in de.espend.idea.php.annotation.reference.DocTagNameAnnotationReferenceContributor$PhpDocIdentifierReference(PsiElement(DOC_IDENTIFIER):null) class class de.espend.idea.php.annotation.reference.DocTagNameAnnotationReferenceContributor$PhpDocIdentifierReference
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:145)
	at com.intellij.psi.PsiReferenceBase.getManipulator(PsiReferenceBase.java:146)
	at com.intellij.psi.PsiReferenceBase.handleElementRename(PsiReferenceBase.java:120)
	at com.intellij.refactoring.rename.RenameUtil.rename(RenameUtil.java:287)
	at com.intellij.refactoring.rename.RenameUtil.doRenameGenericNamedElement(RenameUtil.java:244)
	at com.intellij.refactoring.rename.RenamePsiElementProcessor.renameElement(RenamePsiElementProcessor.java:54)
	at com.intellij.refactoring.rename.RenameUtil.doRename(RenameUtil.java:208)
	at com.intellij.refactoring.rename.RenameProcessor.performRefactoring(RenameProcessor.java:379)
	at com.intellij.refactoring.BaseRefactoringProcessor.lambda$doRefactoring$9(BaseRefactoringProcessor.java:503)
	at com.intellij.refactoring.BaseRefactoringProcessor.lambda$doRefactoring$10(BaseRefactoringProcessor.java:514)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$null$9(ApplicationImpl.java:865)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:163)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:585)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:531)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:150)
	at com.intellij.openapi.progress.util.PotemkinProgress.runInSwingThread(PotemkinProgress.java:190)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$runEdtProgressWriteAction$10(ApplicationImpl.java:865)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:873)
	at com.intellij.openapi.application.impl.ApplicationImpl.runEdtProgressWriteAction(ApplicationImpl.java:863)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithNonCancellableProgressInDispatchThread(ApplicationImpl.java:846)
	at com.intellij.refactoring.BaseRefactoringProcessor.doRefactoring(BaseRefactoringProcessor.java:514)
	at com.intellij.refactoring.BaseRefactoringProcessor.lambda$execute$2(BaseRefactoringProcessor.java:311)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:212)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:178)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:168)
	at com.intellij.refactoring.BaseRefactoringProcessor.execute(BaseRefactoringProcessor.java:309)
	at com.intellij.refactoring.BaseRefactoringProcessor.lambda$null$5(BaseRefactoringProcessor.java:439)
	at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:83)
	at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:149)
	at com.intellij.refactoring.BaseRefactoringProcessor.lambda$customizeUsagesView$6(BaseRefactoringProcessor.java:437)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:220)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:178)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:168)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:154)
	at com.intellij.usages.impl.UsageViewImpl$MyPerformOperationRunnable.run(UsageViewImpl.java:2118)
	at com.intellij.usages.impl.UsageViewImpl$10.actionPerformed(UsageViewImpl.java:1537)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
	at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
	at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
	at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
	at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:270)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6651)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
	at java.desktop/java.awt.Component.processEvent(Component.java:6416)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:908)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:846)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:778)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:424)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:423)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Not sure what's causing this, I tried to rename a class and PhpStorm started acting strange.
It only updated a few refences but then stopped with the exception above.

I have the following code snippet:

    /**
     * The WebhostingPlan is null for an exclusive webhosting plan.
     *
     * @ORM\ManyToOne(targetEntity=WebhostingPlan::class)
     * @ORM\JoinColumn(nullable=true, name="plan_id", referencedColumnName="id", onDelete="RESTRICT")
     *
     * @var WebhostingPlan|null
     */

Which uses a different syntax than using a string value, which might be the culprint.

Just encountered a similar issue, but we're not using ::class in our annotations.

Edit: Seems the :: is the source of the failure. We had some @covers \My\Class\To\Refactor::someMethod in our tests. Exlcuding those makes the renaming work again.

We have experienced the same issue and to demonstrate in a small setting, we prepared a proof of concept.
Available at https://gitlab.com/eric-kr/php-rename-class.git

Steps to reproduce:

  1. git clone https://gitlab.com/eric-kr/php-rename-class.git
  2. open the file src/Models/ModelA.php
  3. rename the class Models\ModelA to ModelARenamed
  4. Current result: There will be a few changes to references but the Models/ModelA.php and the class Models/ModelA will not be renamed.

Removing the line at: https://gitlab.com/eric-kr/php-rename-class/-/blob/master/src/Services/MockServiceA.php#L16 will make the renaming go through successfully.