-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add support for disabling redirected output in the REPL driver for usage in worksheets in the Scala Plugin for IntelliJ IDEA #16810
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
Conversation
…age in worksheets in the Scala Plugin for IntelliJ IDEA - Calling `setOut/setErr` in a concurrent environment without any synchronization (such as the Scala compile server in the Scala Plugin for IntelliJ IDEA, which is used to execute Scala 3 worksheets) can lead to unpredictable outcomes where the out/err streams are not restored properly after changing. - This change adds a new default method `redirectOutput` which can be overriden by others to control the redirecting behavior of the REPL driver.
I signed the Scala CLA, please run another check. |
We would appreciate if this change lands in Scala 3.3.0, as it is supposed to be an LTS release. Thanks. |
3.3.0 is now in the phase of testing release candidates and only critical bug fixes and fixes of new regressions are allowed in, so these changes would apply only in 3.3.1 and later on. However, to make things clear: LTS actually refers to the entire minor release 3.3.x line, not to a particular patch version as the general idea of LTS is about backporting fixes and some essential improvements from newer major release lines. So until 3.4.0 is out at some point in the future, there's no distinction between LTS and the mainstream. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with merging this. But I don't want to give the impression that we're giving guarantees on any compatibility of the API with this. As in, we won't intentionally break it but we also won't stop the world and/or consider it a critical regression if some API is changed and it happened to be utilised externally.
That said, and not withstanding, could you add some details as scaladoc to redirectOutput
to the effect of what you wrote, in terms of control/concurrency/synchronization/predictability.
setOut/setErr
in a concurrent environment without any synchronization (such as the Scala compile server in the Scala Plugin for IntelliJ IDEA, which is used to execute Scala 3 worksheets) can lead to unpredictable outcomes where the out/err streams are not restored properly after changing.redirectOutput
which can be overriden by others to control the redirecting behavior of the REPL driver.