Description
Scala 2 compiler reported compilation progress via xsbti.compile.CompileProgress
.
It called both startUnit
and advance
methods.
This interface is used in IntelliJ Scala Plugin to report compilation progress, both with text and with Compilation Charts
Unfortunately, Scala 3 doesn't use the interface at all.
from https://gitter.im/lampepfl/dotty?at=5ee79bbf7c64f31f11614996
Artyom Semyonov June 15 2020 18:55
Hi all!
I usexsbti.compile.CompileProgress.advance
method to show the compilation progress in Scala.
But it seems this method isn't invoking by Dotty compiler.
How can I get the compilation progress information for Dotty?Guillaume Martres June 15 2020 18:56
well, someone should add calls to advance in dottyGuillaume Martres June 15 2020 19:03
hmm, CompileProgress is not part of the regular sbt callback interface but a separate thing, so this is going to require some plumbing in dottythe entry point is https://github.com/lampepfl/dotty/blob/6ab0e6353e575cf2da4ed1c008479694a2671be3/sbt-bridge/src/xsbt/CachedCompilerImpl.java#L57
we pass the AnalysisCallback to dotty via "setSbtCallback(callback)"
so essentially we need another similar method to pass CompileProgress
and then call it when needed, we can just follow the behavior of scalac which appears to be "once per compilation unit per phase completed"PRs welcome.