Skip to content

report compilation progress via xsbti.compile.CompileProgress #13082

Closed
@unkarjedy

Description

@unkarjedy

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 use xsbti.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 dotty

Guillaume 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 dotty

the 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.

related https://youtrack.jetbrains.com/issue/SCL-18400

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions