atsky / haskell-idea-plugin

IntelliJ IDEA plugin for Haskell
Apache License 2.0
201 stars 21 forks source link

Getting an StringIndexOutOfBoundsException: String index out of range: -1 on each automatic run of GhcMod. #98

Closed atsky closed 9 years ago

atsky commented 9 years ago

String index out of range: -1 java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.(String.java:195) at org.jetbrains.haskell.external.GhcModi.runCommand(GhcModi.kt:116) at org.jetbrains.haskell.external.HaskellExternalAnnotator.getResultFromGhcModi(HaskellExternalAnnotator.kt:95) at org.jetbrains.haskell.external.HaskellExternalAnnotator.doAnnotate(HaskellExternalAnnotator.kt:164) at org.jetbrains.haskell.external.HaskellExternalAnnotator.doAnnotate(HaskellExternalAnnotator.kt:32) at com.intellij.codeInsight.daemon.impl.ExternalToolPass.d(ExternalToolPass.java:183) at com.intellij.codeInsight.daemon.impl.ExternalToolPass.access$500(ExternalToolPass.java:45) at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:125) at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320) at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310) at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254) at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269) at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227) at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217) at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238) at com.intellij.util.Alarm$Request$1.run(Alarm.java:351) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at com.intellij.util.concurrency.QueueProcessor$RunnableConsumer.consume(QueueProcessor.java:298) at com.intellij.util.concurrency.QueueProcessor$RunnableConsumer.consume(QueueProcessor.java:295) at com.intellij.util.concurrency.QueueProcessor$2$1.run(QueueProcessor.java:110) at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238) at com.intellij.util.concurrency.QueueProcessor$2.consume(QueueProcessor.java:107) at com.intellij.util.concurrency.QueueProcessor$2.consume(QueueProcessor.java:104) at com.intellij.util.concurrency.QueueProcessor$3$1.run(QueueProcessor.java:215) at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238) at com.intellij.util.concurrency.QueueProcessor$3.run(QueueProcessor.java:212) at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:400) 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) at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)

ka3a4ok commented 9 years ago

Same problem. Is there any walkaround? Maybe fix this bug priority. It is just showstopper.

atsky commented 9 years ago

@ka3a4ok try http://teamcity.jetbrains.com/guestAuth/repository/download/Haskell_Build/.lastSuccessful/haskell-plugin.zip

ka3a4ok commented 9 years ago

I have installed plugin "from disk". Message box after restart:

Plugin 'Haskell' failed to initialize and will be disabled. Please restart IntelliJ IDEA.

java.io.FileNotFoundException: C:\Users\admin.cabal\config (Системе не удается найти указанный путь) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.(FileInputStream.java:138) at kotlin.io.IoPackage$ReadWrite$c8e99b89.forEachLine(ReadWrite.kt:165) at kotlin.io.IoPackage$ReadWrite$c8e99b89.readLines(ReadWrite.kt:212) at kotlin.io.IoPackage$ReadWrite$c8e99b89.readLines$default(ReadWrite.kt:210) at kotlin.io.IoPackage.readLines$default(Unknown Source) at org.jetbrains.cabal.CabalConfing$Companion.read(CabalConfig.kt:18) at org.jetbrains.cabal.CabalApplicationComponent.getCabalConfiguration(CabalApplicationComponent.kt:30) at org.jetbrains.cabal.CabalApplicationComponent.initComponent(CabalApplicationComponent.kt:39) at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:568) at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:610) at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:245) at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:211) at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponent(ComponentManagerImpl.java:125) at com.intellij.openapi.application.impl.ApplicationImpl.createComponent(ApplicationImpl.java:354) at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:116) at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:87) at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl.load(ApplicationStoreImpl.java:101) at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:499) at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:481) at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:170) at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:52) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:749) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:702) at java.awt.EventQueue$3.run(EventQueue.java:696) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75) at java.awt.EventQueue.dispatchEvent(EventQueue.java:719) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:362) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

ka3a4ok commented 9 years ago

For example, my cabal config path is: c:\Users\admin\AppData\Roaming\cabal\config

ariskou commented 9 years ago

I have created a pull request for a fix (#103)

atsky commented 9 years ago

@ka3a4ok one more try. I tested it on Windows. Should work now: http://teamcity.jetbrains.com/guestAuth/repository/download/Haskell_Build/.lastSuccessful/haskell-plugin.zip