Skip to content
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

REPL: Add compiler options to :reset #14139

Merged
merged 1 commit into from Jan 14, 2022

Conversation

dwijnand
Copy link
Member

@dwijnand dwijnand commented Dec 19, 2021

An easy change that makes it match Scala 2's REPL.

@dwijnand dwijnand changed the title repl/reset with opts REPL: Add compiler options to :reset Dec 19, 2021
@dwijnand dwijnand marked this pull request as ready for review December 19, 2021 21:45
Copy link
Member

@SethTisue SethTisue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should these be revived? removed?

tests/disabled/partest/run/repl-reset.check:scala> :reset
tests/disabled/partest/run/repl-reset.scala:    |:reset
tests/disabled/partest/run/t7747-repl.check:scala> :reset
tests/disabled/partest/run/t7747-repl.scala:    |:reset

@@ -110,7 +111,7 @@ case object Help extends Command {
|:type <expression> evaluate the type of the given expression
|:doc <expression> print the documentation for the given expression
|:imports show import history
|:reset reset the repl to its initial state, forgetting all session entries
|:reset [options] reset the repl to its initial state, forgetting all session entries
|:settings <options> update compiler options, if possible
Copy link
Member

@SethTisue SethTisue Dec 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: I think you meant angle brackets here, like the other entries?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a type parameter, not an index.

Copy link
Member Author

@dwijnand dwijnand Dec 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied Scala 2. And I think I kind of grok the logic there to be <options> for settings, because it's expected to get options, even though it actually accepts none as a way to print options... While for :reset (and :replay in the scala 2 repl) passing options is more of an extra, so more... optional (🥁 !)

Or we can deviate to fix it to some standard. I just looked at http://docopt.org/ before realising I wasn't following that here, I was following what Scala 2 had.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I think it should follow docopt, but it's not a blocker.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is docopt like Coptic?

compiler/test-resources/repl/reset-command Outdated Show resolved Hide resolved
@dwijnand dwijnand merged commit c01d596 into scala:master Jan 14, 2022
@dwijnand dwijnand deleted the repl/reset-with-opts branch January 14, 2022 10:19
@dwijnand
Copy link
Member Author

The main impl landed in #14140.

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

Successfully merging this pull request may close these issues.

None yet

3 participants