Skip to content

REPL: please add support for a custom errors reporter #8678

Open
@unkarjedy

Description

@unkarjedy

Hi!

I am working on support of Worksheet / REPL for Dotty in IntelliJ.
In Scala 2 under the hood of Worksheets we are using
scala.tools.nsc.interpreter.ILoop and
scala.tools.nsc.interpreter.IMain.interpret.
It allows injecting your own errors-reporter, see:
https://github.com/JetBrains/intellij-scala/blob/0bed3d4fc4f411ff14d98dfb52d9e30b7a6c2957/scala/compiler-jps/resources/ILoopWrapper213Impl.scala#L46

https://github.com/JetBrains/intellij-scala/blob/0bed3d4fc4f411ff14d98dfb52d9e30b7a6c2957/scala/compiler-jps/resources/ILoopWrapperImpl.scala#L45

In Dotty, we are using dotty.tools.repl.ReplDriver.run as it looks like it's the closest analogue to IMain.interpret.
Unfortunately, ReplDriver prints all the errors / warnings to the out: PrintStream parameter (e.g. see ReplDriver.displayErrors) together with normal output.

Could you please add some reporter parameter similarly to how it is done in IMain ins Scala 2, so that we can have more control of how the errors are reported in Scala Plugin?

Here is an example of how warnings/errors are displayed now:
image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions