julienr / pycharm-cellmode

PyCharm cell mode
Other
25 stars 5 forks source link

Exception in plugin #8

Closed mguetlein closed 5 years ago

mguetlein commented 5 years ago

Hi, thanks for the nice plugin, unfortunately its not working anymore:

Access is allowed from event dispatch thread only.

com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: EventQueue.isDispatchThread()=false Toolkit.getEventQueue()=com.intellij.ide.IdeEventQueue@30476a74 Current thread: Thread[ApplicationImpl pooled thread 2,4,Idea Thread Group] 289146934 SystemEventQueueThread: Thread[AWT-EventQueue-0,6,Idea Thread Group] 200483382 at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1123) at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1112) at com.intellij.ui.content.impl.ContentManagerImpl.removeContent(ContentManagerImpl.java:212) at com.intellij.ui.content.impl.ContentManagerImpl.removeContent(ContentManagerImpl.java:185) at com.intellij.ui.content.impl.ContentManagerImpl.removeAllContents(ContentManagerImpl.java:292) at com.intellij.openapi.wm.impl.ToolWindowImpl.ensureContentInitialized(ToolWindowImpl.java:511) at com.intellij.openapi.wm.impl.ToolWindowImpl.getContentManager(ToolWindowImpl.java:345) at com.jetbrains.python.console.PythonConsoleToolWindow.getConsoleContentDescriptors(PythonConsoleToolWindow.java:49) at PythonConsoleUtils.getConsoles(PythonConsoleUtils.java:73) at PythonConsoleUtils.complete(PythonConsoleUtils.java:149) at PythonConsoleCompletion.addCompletions(PythonConsoleCompletion.java:41) at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36) at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:141) at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:89) at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:149) at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:142) at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$2.addCompletions(LiveTemplateCompletionContributor.java:92) at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:36) at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:141) at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:89) at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:118) at com.intellij.codeInsight.completion.CompletionProgressIndicator.calculateItems(CompletionProgressIndicator.java:815) at com.intellij.codeInsight.completion.CompletionProgressIndicator.runContributors(CompletionProgressIndicator.java:800) at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$null$2(CodeCompletionHandlerBase.java:266) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1161) at com.intellij.codeInsight.completion.AsyncCompletion.tryReadOrCancel(CompletionThreading.java:181) at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$doComplete$3(CodeCompletionHandlerBase.java:263) at com.intellij.codeInsight.completion.AsyncCompletion.lambda$null$0(CompletionThreading.java:108) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144) at com.intellij.codeInsight.completion.AsyncCompletion.lambda$startThread$1(CompletionThreading.java:104) at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

mrtolkien commented 5 years ago

Getting this regularly too, and it stops my Python console from starting. Such a shame really, because cell execution is so convenient!

maxborn commented 5 years ago

Same problem here. It will be nice to have it fix, but I know you guys are probably busy doing something else after all this time. So maybe posting on PyCharm's forum will attract some Java programmers attention to this, and they could help? After all, without cell mode, most people using python for scientific computing will stick to Spyder. Just a thought, anyways.

julienr commented 5 years ago

Thanks for reporting this and sorry for the delayed answer.

I've finally had time to look into this and this was caused by the 'code completion from console' part of the plugin. I've removed this and released version 1.2.1 that should fix this. I've pushed an update on pycharm's plugin repo but it can take some time to update. In the meantime, you can download the .jar from:

https://github.com/julienr/pycharm-cellmode/releases/tag/1.2.1

Please reopen this bug if this doesn't fix it.