seanhenry / MockGenerator

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

Problem to generate code with Appcode 2019.3 #22

Closed mendesbarreto closed 4 years ago

mendesbarreto commented 4 years ago

Hello guys,

I am having problem to generates the mock on swift 5.1 on Appcode 2019.3:

The error is the follows:

java.lang.NoSuchMethodError: 'java.util.List com.jetbrains.swift.psi.SwiftProtocolDeclaration.getStatementList()'
    at codes.seanhenry.transformer.ProtocolTransformer.visitProtocolDeclaration(ProtocolTransformer.kt:24)
    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:58)
    at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.invoke(IntentionActionWithTextCaching.java:181)
    at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$invokeIntention$4(ShowIntentionActionsHandler.java:219)
    at com.intellij.openapi.application.WriteAction.run(WriteAction.java:98)
    at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.invokeIntention(ShowIntentionActionsHandler.java:221)
    at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$null$2(ShowIntentionActionsHandler.java:196)
    at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:83)
    at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:149)
    at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$chooseActionAndInvoke$3(ShowIntentionActionsHandler.java:195)
    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:194)
    at com.intellij.codeInsight.intention.impl.IntentionListStep.lambda$applyAction$0(IntentionListStep.java:107)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:193)
    at com.intellij.ui.popup.AbstractPopup.lambda$dispose$13(AbstractPopup.java:1434)
    at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2413)
    at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:177)
    at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:129)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:159)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:36)
    at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1430)
    at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:151)
    at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:326)
    at com.intellij.openapi.util.ObjectNode.lambda$execute$0(ObjectNode.java:104)
    at com.intellij.openapi.util.ObjectTree.executeActionWithRecursiveGuard(ObjectTree.java:183)
    at com.intellij.openapi.util.ObjectNode.execute(ObjectNode.java:71)
    at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:133)
    at com.intellij.openapi.util.Disposer.dispose(Disposer.java:116)
    at com.intellij.openapi.util.Disposer.dispose(Disposer.java:112)
    at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:252)
    at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:461)
    at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:415)
    at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:356)
    at com.intellij.ui.popup.list.ListPopupImpl$1.actionPerformed(ListPopupImpl.java:269)
    at com.intellij.ui.popup.WizardPopup.proceedKeyEvent(WizardPopup.java:367)
    at com.intellij.ui.popup.WizardPopup.dispatch(WizardPopup.java:347)
    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:746)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:422)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:421)
    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)

Thank you so much

seanhenry commented 4 years ago

Hi @mendesbarreto

Thanks for raising this issue. I've uploaded a fix for 2019.3. JetBrains will take a day or so to process it, or you can manually install it here

mendesbarreto commented 4 years ago

Thank you so much @seanhenry , I really Love you for that ahahaha!!!

mendesbarreto commented 4 years ago

Oh no =(

I tried the new plugin version but I got this error:

java.lang.NoClassDefFoundError: com/github/mustachejava/DefaultMustacheFactory
    at codes.seanhenry.template.MustacheView.render(MustacheView.java:29)
    at codes.seanhenry.mockgenerator.generator.MockViewPresenter.generate(MockViewPresenter.kt:100)
    at codes.seanhenry.mockgenerator.generator.Generator.generate(Generator.kt:36)
    at codes.seanhenry.intentions.BaseGeneratingIntention.generateMock(BaseGeneratingIntention.java:191)
    at codes.seanhenry.intentions.BaseGeneratingIntention.invoke(BaseGeneratingIntention.java:89)
    at com.intellij.codeInsight.intention.PsiElementBaseIntentionAction.invoke(PsiElementBaseIntentionAction.java:41)
    at com.intellij.codeInsight.intention.impl.config.IntentionActionWrapper.invoke(IntentionActionWrapper.java:58)
    at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.invoke(IntentionActionWithTextCaching.java:181)
    at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$invokeIntention$4(ShowIntentionActionsHandler.java:219)
    at com.intellij.openapi.application.WriteAction.run(WriteAction.java:98)
    at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.invokeIntention(ShowIntentionActionsHandler.java:221)
    at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$null$2(ShowIntentionActionsHandler.java:196)
    at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:83)
    at com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait(TransactionGuardImpl.java:149)
    at com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler.lambda$chooseActionAndInvoke$3(ShowIntentionActionsHandler.java:195)
    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:194)
    at com.intellij.codeInsight.intention.impl.IntentionListStep.lambda$applyAction$0(IntentionListStep.java:107)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:193)
    at com.intellij.ui.popup.AbstractPopup.lambda$dispose$13(AbstractPopup.java:1434)
    at com.intellij.util.ui.UIUtil.invokeLaterIfNeeded(UIUtil.java:2413)
    at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:177)
    at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:129)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:159)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.doWhenFocusSettlesDown(IdeFocusManagerImpl.java:36)
    at com.intellij.ui.popup.AbstractPopup.dispose(AbstractPopup.java:1430)
    at com.intellij.ui.popup.WizardPopup.dispose(WizardPopup.java:151)
    at com.intellij.ui.popup.list.ListPopupImpl.dispose(ListPopupImpl.java:326)
    at com.intellij.openapi.util.ObjectNode.lambda$execute$0(ObjectNode.java:104)
    at com.intellij.openapi.util.ObjectTree.executeActionWithRecursiveGuard(ObjectTree.java:183)
    at com.intellij.openapi.util.ObjectNode.execute(ObjectNode.java:71)
    at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:133)
    at com.intellij.openapi.util.Disposer.dispose(Disposer.java:116)
    at com.intellij.openapi.util.Disposer.dispose(Disposer.java:112)
    at com.intellij.ui.popup.WizardPopup.disposeAllParents(WizardPopup.java:252)
    at com.intellij.ui.popup.list.ListPopupImpl.handleNextStep(ListPopupImpl.java:461)
    at com.intellij.ui.popup.list.ListPopupImpl._handleSelect(ListPopupImpl.java:415)
    at com.intellij.ui.popup.list.ListPopupImpl.handleSelect(ListPopupImpl.java:356)
    at com.intellij.ui.popup.list.ListPopupImpl$1.actionPerformed(ListPopupImpl.java:269)
    at com.intellij.ui.popup.WizardPopup.proceedKeyEvent(WizardPopup.java:367)
    at com.intellij.ui.popup.WizardPopup.dispatch(WizardPopup.java:347)
    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:746)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:422)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:421)
    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)
Caused by: java.lang.ClassNotFoundException: com.github.mustachejava.DefaultMustacheFactory PluginClassLoader[codes.seanhenry.mockgenerator, 17] com.intellij.ide.plugins.cl.PluginClassLoader@1d2365dd
    at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:77)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 57 more

I downloaded the new one and installed from disk

mendesbarreto commented 4 years ago

Forget it! All Good... I installed the version from JetBrains and it's working!

Thank you for all!

seanhenry commented 4 years ago

Great! I'm glad that's working