-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Implement initial and cleanup commands as well as value bindings for REPL #3007
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
Comments
While I was working on this, few doubts popped up.
|
You're making sense :)
One way to do this is to say: case class Silent(underlying: ParseResult) extends ParseResult {
require(!underlying.isInstanceOf[Silent])
} that way we can unpack it to the A more type safe way to do this is to introduce a marker trait extending
And then making case class Silent(underlying: ConcreteParseResult) extends ParseResult Perhaps there's a better name than concrete though 😄 |
Thanks for the help. I've submitted a WIP PR, to check if I'm going in right direction. If I understood marker traits correctly, I need to declare a trait, say Also I'm getting this warning, even though I am unpacking the inner object and required |
Is this feature still requested? As I understand, it wasn't implemented in the master in the end. |
Yes.
We didn't stop liking the feature. The |
I have implemented the changes, they seem to be much easier after refactoring, but I haven't added yet any tests to check the results. Where should I put them? |
Under |
For reference, here is where it is done for
Only value binding should run in a silent mode |
@allanrenucci, could you please also tell me about the status of testing of the feature? I tried to uncomment console in sbt-dotty/sbt-test/sbt-dotty/example-project/test, but received: |
@SzymonPajzert Yeah that doesn't work on CI, there's a fix at #5018. EDIT: looking at #4933, it looks like #5018 is enough to fix it. |
Fix #3007: Add support for initial and cleanup commands in the REPL
https://github.com/dotty-staging/dotty/blob/812f141ba97e224168fc3bf91a6401c5dd349ce8/sbt-bridge/src/xsbt/ConsoleInterface.scala#L22-L39
The text was updated successfully, but these errors were encountered: