aws-toolkit-jetbrains icon indicating copy to clipboard operation
aws-toolkit-jetbrains copied to clipboard

CodeWhisperer plugin throw an exception when invoked in JetBrains IDEA

Open m-asadullah opened this issue 1 year ago • 1 comments

Describe the bug

java.lang.RuntimeException encountered, when trying to invoke a method named stateChanged in a class named CodeWhispererUIChangeListener that is listening to a topic named CodeWhisperer popup state changed. The exception message was: Cannot invoke (class=CodeWhispererUIChangeListener, method=stateChanged, topic=CodeWhisperer popup state changed). I suspect that there is an issue with one of the following: the parameters or return type of the method, the visibility of the class or the method, the initialization of the reference variable, or the topic name or subscription.

To reproduce

Expected behavior

Screenshots

Your Environment

  • OS: Windows 11.0
  • JetBrains product: IntelliJ IDEA 2023.2.1 (Community Edition)
  • JetBrains product version: Build #IC-232.9559.62, built on August 22, 2023
  • Runtime version: 17.0.8+7-b1000.8 amd64
  • VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
  • Non-Bundled Plugins: aws.toolkit (1.77-232) Kotlin (232-1.9.0-IJ9559.62)
  • AWS Toolkit version: 1.77-232
  • SAM CLI version:
  • JVM/Python version: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

Additional context

java.lang.RuntimeException: Cannot invoke (class=CodeWhispererUIChangeListener, method=stateChanged, topic=CodeWhisperer popup state changed) at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:676) at com.intellij.util.messages.impl.MessageBusImplKt.deliverMessage(MessageBusImpl.kt:422) at com.intellij.util.messages.impl.MessageBusImplKt.pumpWaiting(MessageBusImpl.kt:401) at com.intellij.util.messages.impl.MessageBusImplKt.access$pumpWaiting(MessageBusImpl.kt:1) at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:460) at jdk.proxy5/jdk.proxy5.$Proxy220.stateChanged(Unknown Source) at software.aws.toolkits.jetbrains.services.codewhisperer.popup.CodeWhispererPopupManager.changeStates(CodeWhispererPopupManager.kt:173) at software.aws.toolkits.jetbrains.services.codewhisperer.service.CodeWhispererService.updateCodeWhisperer(CodeWhispererService.kt:487) at software.aws.toolkits.jetbrains.services.codewhisperer.service.CodeWhispererService.processCodeWhispererUI(CodeWhispererService.kt:396) at software.aws.toolkits.jetbrains.services.codewhisperer.service.CodeWhispererService.access$processCodeWhispererUI(CodeWhispererService.kt:79) at software.aws.toolkits.jetbrains.services.codewhisperer.service.CodeWhispererService$invokeCodeWhispererInBackground$2$1.invoke(CodeWhispererService.kt:231) at software.aws.toolkits.jetbrains.services.codewhisperer.service.CodeWhispererService$invokeCodeWhispererInBackground$2$1.invoke(CodeWhispererService.kt:199) at com.intellij.openapi.application.ActionsKt.invokeLater$lambda$5(actions.kt:74) at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:208) at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21) at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:190) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861) at com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:478) at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:79) at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:121) at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:685) at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$10(IdeEventQueue.kt:589) at com.intellij.openapi.application.impl.ApplicationImpl.runWithoutImplicitRead(ApplicationImpl.java:1485) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:589) at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363) at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:992) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105) at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:992) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92) Caused by: com.intellij.diagnostic.PluginException: Positive width should be defined for an inline element by software.aws.toolkits.jetbrains.services.codewhisperer.inlay.CodeWhispererInlayInlineRenderer@335d429 [Plugin: aws.toolkit] at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23) at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:89) at com.intellij.openapi.editor.impl.InlineInlayImpl.doUpdate(InlineInlayImpl.java:73) at com.intellij.openapi.editor.impl.InlayImpl.<init>(InlayImpl.java:35) at com.intellij.openapi.editor.impl.InlineInlayImpl.<init>(InlineInlayImpl.java:26) at com.intellij.openapi.editor.impl.InlayModelImpl.addInlineElement(InlayModelImpl.java:151) at com.intellij.openapi.editor.impl.InlayModelImpl.addInlineElement(InlayModelImpl.java:138) at software.aws.toolkits.jetbrains.services.codewhisperer.inlay.CodeWhispererInlayManager.createCodeWhispererInlays(CodeWhispererInlayManager.kt:37) at software.aws.toolkits.jetbrains.services.codewhisperer.inlay.CodeWhispererInlayManager.updateInlays(CodeWhispererInlayManager.kt:19) at software.aws.toolkits.jetbrains.services.codewhisperer.popup.CodeWhispererUIChangeListener.stateChanged(CodeWhispererUIChangeListener.kt:90) at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:699) at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:659) ... 49 more

m-asadullah avatar Sep 05 '23 08:09 m-asadullah

We are rootcausing the issue and will be working on a fix.

andrewyuq avatar Sep 13 '23 00:09 andrewyuq