Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
unkarjedy opened this issue Apr 6, 2020 · 1 comment
Open

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

unkarjedy opened this issue Apr 6, 2020 · 1 comment

Comments

@unkarjedy
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants