julienr / pycharm-cellmode

PyCharm cell mode
Other
26 stars 6 forks source link

ArrayIndexOutOfBoundsException when running this plugin with "Intellij IDEA with Python plugin" #14

Closed ss005 closed 3 years ago

ss005 commented 3 years ago

Hi, I'm using IntelliJ idea ultimate 2020.3 EAP with python plugin.

Intellij ultimate supports cell mode, but reason for using this plugin is - it has "run cell" and "run cell and go to next" so I can keep running current cell, while IntelliJ always runs current cell and jumps to the next cell which is annoying (there is no option to keep the focus in current cell)

This problems occurs when after opening ide, I run current cell using "pycharm cell mode plugin", But if I first start the python console (using Intellij "execute cell in console option") and then run cells using "pycharm cell mode plugin" onwards, it works perfectly without any exception.

java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
    at com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:75)
    at PythonConsoleUtils$4.run(PythonConsoleUtils.java:107)
    at com.intellij.openapi.wm.impl.ToolWindowManagerImpl$activateToolWindow$1.run(ToolWindowManagerImpl.kt:607)
    at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:216)
    at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:24)
    at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:199)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)
    at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:324)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:85)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:134)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
    at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:190)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
    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.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:976)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:843)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:773)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:501)
    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)
julienr commented 3 years ago

Hi, thanks for the report. I currently don't have much time to work on this plugin, but if someone wants to do a PR to try & fix this issue, I'd be happy to accept it.

julienr commented 3 years ago

See https://github.com/julienr/pycharm-cellmode/issues/16#issuecomment-835393046