rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.31k stars 96 forks source link

Couldn't start REPL #620

Closed Creeperface01 closed 3 years ago

Creeperface01 commented 3 years ago

I can't get stack project working. I always get this error when open a hs file or write something. [project-stack-repl-cviceni:exe:cviceni-exe] Couldn't start REPL. Error message class java.util.LinkedHashMap cannot be cast to class java.lang.String (java.util.LinkedHashMap and java.lang.String are in module java.base of loader 'bootstrap')

Creeperface01 commented 3 years ago
10:19   HLint inspection is started for file Main.hs

10:19   [project-stack-repl-cviceni:exe:cviceni-exe] REPL will be started with command: C:/Users/honza/AppData/Roaming/local/bin/stack.exe repl cviceni:exe:cviceni-exe --no-build --ghci-options -ghci-script=C:\Users\honza\AppData\Local\rikvdkleij\intellij-haskell\cache\repl.ghci --silent --ghc-options "-v1 -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints" --no-load

10:19   HLint inspection is started for file Main.hs

10:19   C:\Users\honza\AppData\Local\rikvdkleij\intellij-haskell\cache\lts-16\bin\hlint.exe --json "D:\OneDrive - VSB-TUO\FPR\cviceni\app\Main.hs":  C:\Users\honza\AppData\Local\rikvdkleij\intellij-haskell\cache\lts-16\bin\hlint.exe --json "D:\OneDrive - VSB-TUO\FPR\cviceni\app\Main.hs"

10:19   C:\Users\honza\AppData\Local\rikvdkleij\intellij-haskell\cache\lts-16\bin\hlint.exe --json "D:\OneDrive - VSB-TUO\FPR\cviceni\app\Main.hs":  []

10:19   HLint inspection is finished for file Main.hs

10:19   [project-stack-repl-cviceni:exe:cviceni-exe] Command :set +c took + 2 ms

10:19   [project-stack-repl-cviceni:exe:cviceni-exe] stdout: ^IntellijHaskell^

10:19   [project-stack-repl-cviceni:exe:cviceni-exe] Command :set -fdefer-type-errors took + 2 ms

10:19   [project-stack-repl-cviceni:exe:cviceni-exe] stdout: ^IntellijHaskell^

10:19   [project-stack-repl-cviceni:exe:cviceni-exe] Command :set -fshow-loaded-modules took + 3 ms

10:19   [project-stack-repl-cviceni:exe:cviceni-exe] stdout: ^IntellijHaskell^

10:19   [project-stack-repl-cviceni:exe:cviceni-exe] Command :set -fno-max-valid-substitutions took + 2 ms

10:19   [project-stack-repl-cviceni:exe:cviceni-exe] stdout: ^IntellijHaskell^

10:19   [project-stack-repl-cviceni:exe:cviceni-exe] stderr: Some flags have not been recognized: -fno-max-valid-substitutions

10:19   Executing: C:/Users/honza/AppData/Roaming/local/bin/stack.exe path 

10:19   Executing: C:\Users\honza\AppData\Local\Programs\stack\x86_64-windows\ghc-8.8.4\bin\ghc --supported-languages 

10:19   [project-stack-repl-cviceni:exe:cviceni-exe] Couldn't start REPL. Error message class java.util.LinkedHashMap cannot be cast to class java.lang.String (java.util.LinkedHashMap and java.lang.String are in module java.base of loader 'bootstrap')

10:19   [project-stack-repl-cviceni:exe:cviceni-exe] Command :q took + 2 ms

10:19   [project-stack-repl-cviceni:exe:cviceni-exe] stdout: Leaving GHCi.

10:19   [project-stack-repl-cviceni:exe:cviceni-exe] REPL is stopped
rikvdkleij commented 3 years ago

Looks like there is some conflict in your IntelliJ installation. And which versions are you using?

Adrijaned commented 3 years ago

Latest IDEA Ultimate (from ToolBox), exactly the same error Plugin version 1.0.0-beta81 - completely fresh install of IDEA, stack, and plugin yesterday

Adrijaned commented 3 years ago

Also, here is the stacktrace:

java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class java.lang.String (java.util.LinkedHashMap and java.lang.String are in module java.base of loader 'bootstrap')
    at intellij.haskell.stackyaml.StackYamlComponent$.$anonfun$getResolver$2(StackYamlComponent.scala:30)
    at scala.Option.map(Option.scala:242)
    at intellij.haskell.stackyaml.StackYamlComponent$.getResolver(StackYamlComponent.scala:30)
    at intellij.haskell.external.component.CabalConfigComponent$.getAvailablePackageNames(CabalConfigComponent.scala:22)
    at intellij.haskell.external.component.GlobalProjectInfoComponent$.getAvailableStackagesPackages(GlobalProjectInfoComponent.scala:54)
    at intellij.haskell.external.component.GlobalProjectInfoComponent$.$anonfun$createGlobalProjectInfo$4(GlobalProjectInfoComponent.scala:72)
    at scala.Option.map(Option.scala:242)
    at intellij.haskell.external.component.GlobalProjectInfoComponent$.$anonfun$createGlobalProjectInfo$3(GlobalProjectInfoComponent.scala:68)
    at scala.Option.flatMap(Option.scala:283)
    at intellij.haskell.external.component.GlobalProjectInfoComponent$.$anonfun$createGlobalProjectInfo$2(GlobalProjectInfoComponent.scala:67)
    at scala.Option.flatMap(Option.scala:283)
    at intellij.haskell.external.component.GlobalProjectInfoComponent$.createGlobalProjectInfo(GlobalProjectInfoComponent.scala:65)
    at intellij.haskell.external.component.GlobalProjectInfoComponent$.$anonfun$Cache$1(GlobalProjectInfoComponent.scala:32)
    at com.github.blemale.scaffeine.CacheLoaderAdapter.load(CacheLoaderAdapter.java:22)
    at com.github.benmanes.caffeine.cache.LocalLoadingCache.lambda$newMappingFunction$2(LocalLoadingCache.java:141)
    at com.github.benmanes.caffeine.cache.UnboundedLocalCache.lambda$computeIfAbsent$2(UnboundedLocalCache.java:238)
    at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
    at com.github.benmanes.caffeine.cache.UnboundedLocalCache.computeIfAbsent(UnboundedLocalCache.java:234)
    at com.github.benmanes.caffeine.cache.LocalCache.computeIfAbsent(LocalCache.java:108)
    at com.github.benmanes.caffeine.cache.LocalLoadingCache.get(LocalLoadingCache.java:54)
    at com.github.blemale.scaffeine.LoadingCache.get(LoadingCache.scala:35)
    at intellij.haskell.external.component.GlobalProjectInfoComponent$.findGlobalProjectInfo(GlobalProjectInfoComponent.scala:36)
    at intellij.haskell.external.component.HaskellComponentsManager$.getSupportedLanguageExtension(HaskellComponentsManager.scala:98)
    at intellij.haskell.editor.HaskellCompletionContributor.intellij$haskell$editor$HaskellCompletionContributor$$getLanguageExtensionsLookupElements(HaskellCompletionContributor.scala:388)
    at intellij.haskell.editor.HaskellCompletionContributor$$anon$1.addCompletions(HaskellCompletionContributor.scala:171)
    at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:32)
    at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:155)
    at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:76)
    at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:154)
    at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:146)
    at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:142)
    at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$1.addCompletions(LiveTemplateCompletionContributor.java:88)
    at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:32)
    at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:155)
    at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:76)
    at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:59)
    at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:132)
    at com.intellij.codeInsight.completion.BaseCompletionService.performCompletion(BaseCompletionService.java:41)
    at com.intellij.codeInsight.completion.CompletionProgressIndicator.lambda$calculateItems$10(CompletionProgressIndicator.java:854)
    at com.intellij.util.indexing.FileBasedIndex.lambda$ignoreDumbMode$0(FileBasedIndex.java:149)
    at com.intellij.util.indexing.FileBasedIndexImpl.ignoreDumbMode(FileBasedIndexImpl.java:653)
    at com.intellij.util.indexing.FileBasedIndex.ignoreDumbMode(FileBasedIndex.java:148)
    at com.intellij.codeInsight.completion.CompletionProgressIndicator.calculateItems(CompletionProgressIndicator.java:850)
    at com.intellij.codeInsight.completion.CompletionProgressIndicator.runContributors(CompletionProgressIndicator.java:838)
    at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$startContributorThread$6(CodeCompletionHandlerBase.java:352)
    at com.intellij.codeInsight.completion.AsyncCompletion.lambda$tryReadOrCancel$5(CompletionThreading.java:172)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1110)
    at com.intellij.codeInsight.completion.AsyncCompletion.tryReadOrCancel(CompletionThreading.java:170)
    at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$startContributorThread$7(CodeCompletionHandlerBase.java:344)
    at com.intellij.codeInsight.completion.AsyncCompletion.lambda$startThread$0(CompletionThreading.java:95)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:170)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157)
    at com.intellij.codeInsight.completion.AsyncCompletion.lambda$startThread$1(CompletionThreading.java:91)
    at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
    at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:268)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
    at java.base/java.lang.Thread.run(Thread.java:834)
rikvdkleij commented 3 years ago

O, wait, this is the same issue as #599

rikvdkleij commented 3 years ago

Fixed in beta84 which is also uploaded to alpha plugin repo.