seanhenry / MockGenerator

An AppCode plugin to help generate Swift test doubles automatically.
GNU General Public License v3.0
71 stars 11 forks source link

Crashing When trying to implement spy #21

Closed jonnydangerous closed 4 years ago

jonnydangerous commented 5 years ago

java.lang.NoSuchMethodError: com.jetbrains.swift.psi.SwiftOptionalTypeElement.getTypeElement()Lcom/jetbrains/swift/psi/SwiftTypeElement; at codes.seanhenry.transformer.TypeTransformer.visitOptionalTypeElement(TypeTransformer.kt:42) at com.jetbrains.swift.psi.impl.SwiftOptionalTypeElementGenImpl.accept(SwiftOptionalTypeElementGenImpl.java:20) at com.jetbrains.swift.psi.impl.SwiftOptionalTypeElementGenImpl.accept(SwiftOptionalTypeElementGenImpl.java:24) at codes.seanhenry.transformer.TypeTransformer$Companion.transform(TypeTransformer.kt:12) at codes.seanhenry.transformer.FunctionTransformer.transformReturnType(FunctionTransformer.kt:61) at codes.seanhenry.transformer.FunctionTransformer.visitFunctionDeclaration(FunctionTransformer.kt:28) at com.jetbrains.swift.psi.impl.SwiftFunctionDeclarationGenImpl.accept(SwiftFunctionDeclarationGenImpl.java:21) at com.jetbrains.swift.psi.impl.SwiftFunctionDeclarationGenImpl.accept(SwiftFunctionDeclarationGenImpl.java:25) at codes.seanhenry.transformer.FunctionTransformer$Companion.transform(FunctionTransformer.kt:16) at codes.seanhenry.transformer.ProtocolTransformer.visitProtocolDeclaration(ProtocolTransformer.kt:26) at com.jetbrains.swift.psi.impl.SwiftProtocolDeclarationGenImpl.accept(SwiftProtocolDeclarationGenImpl.java:21) at com.jetbrains.swift.psi.impl.SwiftProtocolDeclarationGenImpl.accept(SwiftProtocolDeclarationGenImpl.java:25) at codes.seanhenry.transformer.ProtocolTransformer$Companion.transform(ProtocolTransformer.kt:13) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) at codes.seanhenry.intentions.BaseGeneratingIntention.transformProtocols(BaseGeneratingIntention.java:145) at codes.seanhenry.intentions.BaseGeneratingIntention.transformMockClass(BaseGeneratingIntention.java:132) at codes.seanhenry.intentions.BaseGeneratingIntention.invoke(BaseGeneratingIntention.java:86) at com.intellij.codeInsight.intention.PsiElementBaseIntentionAction.invoke(PsiElementBaseIntentionAction.java:41) at com.intellij.codeInsight.intention.impl.config.IntentionActionWrapper.invoke(IntentionActionWrapper.java:63) at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.invoke(IntentionActionWithTextCaching.java:179) at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$invokeIntention$4(ShowIntentionActionsHandler.java:214) at com.intellij.openapi.application.WriteAction.run(WriteAction.java:92) at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.invokeIntention(ShowIntentionActionsHandler.java:216) at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$null$2(ShowIntentionActionsHandler.java:191) at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:82) at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:148) at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$chooseActionAndInvoke$3(ShowIntentionActionsHandler.java:190) 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.codeInsight.intention.impl.ShowIntentionActionsHandler.chooseActionAndInvoke(ShowIntentionActionsHandler.java:189) at com.intellij.codeInsight.intention.impl.IntentionListStep.lambda$applyAction$0(IntentionListStep.java:107) at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:192) at com.intellij.ui.popup.AbstractPopup.lambda$dispose$13(AbstractPopup.java:1430) at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2425) at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:217) at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:169) at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:161) at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:58) at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1426) at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:162) at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:318) at com.intellij.openapi.util.Disposer$1.execute(Disposer.java:47) at com.intellij.openapi.util.Disposer$1.execute(Disposer.java:43) at com.intellij.openapi.util.objectTree.ObjectNode$1.execute(ObjectNode.java:135) at com.intellij.openapi.util.objectTree.ObjectNode$1.execute(ObjectNode.java:104) at com.intellij.openapi.util.objectTree.ObjectTree.executeActionWithRecursiveGuard(ObjectTree.java:194) at com.intellij.openapi.util.objectTree.ObjectNode.execute(ObjectNode.java:104) at com.intellij.openapi.util.objectTree.ObjectTree.executeAll(ObjectTree.java:142) at com.intellij.openapi.util.Disposer.dispose(Disposer.java:136) at com.intellij.openapi.util.Disposer.dispose(Disposer.java:132) at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:263) at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:453) at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:407) at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:348) at com.intellij.ui.popup.list.ListPopupImpl$1.actionPerformed(ListPopupImpl.java:261) at com.intellij.ui.popup.WizardPopup.proceedKeyEvent(WizardPopup.java:378) at com.intellij.ui.popup.WizardPopup.dispatch(WizardPopup.java:358) at com.intellij.ui.popup.PopupDispatcher.dispatchKeyEvent(PopupDispatcher.java:112) at com.intellij.ui.popup.PopupDispatcher.dispatch(PopupDispatcher.java:148) at com.intellij.ide.IdePopupManager.dispatch(IdePopupManager.java:93) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:763) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:461) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:704) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:460) 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)

rolandkakonyi commented 5 years ago

same here

merlin910 commented 5 years ago

It seems to be a problem on AppCode 2019.2, but still works on 2019.1.5. As a work around I've just been using that to generate the mocks that I need, and compiling on the latest AppCode.

seanhenry commented 5 years ago

Hi everyone,

Thanks for your input on this issue. There's always a risk that the AppCode APIs that I'm using will change between releases.

I've taken a look at the issue and I've fixed the problems. It will take a couple of days for JetBrains to process the new version so in the meantime you can download and manually install the update here

merlin910 commented 5 years ago

Just tried the new version and the issue is resolved for me. Thanks for getting that out so quickly.