softwaremill / scala-clippy

Good advice for Scala compiler errors
Apache License 2.0
312 stars 20 forks source link

Issues using Ensime and Clippy #57

Open jqno opened 7 years ago

jqno commented 7 years ago

I'm trying to use both Ensime and Clippy on the same machine, but they don't seem to enjoy each other's company 😅. I'm not sure whether to raise the issue here or with Ensime, but since I'm seeing a stacktrace with Clippy-related things, I'm starting here. Please let me know if I should bring this to Ensime.

Anyway, Clippy is running quite well on my machine, but when I'm trying to open my project in Vim with Ensime, Ensime suddenly stops working. After some frustrations, I finally found this in the Ensime logs:

java.lang.ClassCastException: com.softwaremill.clippy.InjectReporter$$anon$1 cannot be cast to scala.tools.nsc.Global$GlobalPhase
    at scala.tools.nsc.Global$Run$$anonfun$compileLate$2$$anonfun$apply$1.apply(Global.scala:1607)
    at scala.tools.nsc.Global$Run$$anonfun$compileLate$2$$anonfun$apply$1.apply(Global.scala:1607)
    at scala.reflect.internal.SymbolTable.enteringPhase(SymbolTable.scala:235)
    at scala.tools.nsc.Global$Run$$anonfun$compileLate$2.apply(Global.scala:1607)
    at scala.tools.nsc.Global$Run$$anonfun$compileLate$2.apply(Global.scala:1606)
    at scala.collection.Iterator$class.foreach(Iterator.scala:750)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1202)
    at scala.tools.nsc.Global$Run.compileLate(Global.scala:1606)
    at scala.tools.nsc.interactive.Global.scala$tools$nsc$interactive$Global$$parseAndEnter(Global.scala:656)
    at scala.tools.nsc.interactive.Global.backgroundCompile(Global.scala:562)
at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:25)

Here's the complete log, in case it's relevant.

When I remove Clippy from my global build settings, Ensime works fine again.

gigiigig commented 7 years ago

I'm having the same issue.

smungee commented 7 years ago

I've seen this problem too

jan0sch commented 6 years ago

I can confirm this but I wonder if this is more an issue on the Ensime side...

dragos commented 6 years ago

Clippy should play nice and extend GlobalPhase, as everyone else ;-)

michelemauro commented 6 years ago

This happens on Eclipse Scala IDE too: if you add the clippy plugin to an sbt-eclipse controlled project, Scala IDE loses the worksheet functionality and in general starts to have (more than usual) problems with highlighting and compiling.

adamw commented 6 years ago

@dragos do you have any specific way to fix this problem? Hints appreciated (not to mention PRs of course ;) )

quasi-coherent commented 6 years ago

Having this problem too.