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

Use -Xnojline option when starting console #468

Merged
merged 1 commit into from
May 3, 2018

Conversation

tues
Copy link
Contributor

@tues tues commented May 3, 2018

Since we are using Nailgun, the REPL is being run in a different
process than the one connected to the user's terminal, so we cannot
run Scala's ILoop with InteractiveReader - we must use SimpleReader
instead. By passing -Xnojline argument to AnalyzingCompiler.console we
make sure that it will use SimpleReader.

Fixes #385.

Since we are using Nailgun, the REPL is being run in a different
process than the one connected to the user's terminal, so we cannot
run Scala's ILoop with InteractiveReader - we must use SimpleReader
instead. By passing -Xnojline argument to AnalyzingCompiler.console we
make sure that it will use SimpleReader.

Fixes scalacenter#385.
@tues tues added bug A defect or misbehaviour. cli task / console labels May 3, 2018
@@ -212,7 +212,8 @@ object Tasks {
val loader = ClasspathUtilities.makeLoader(classpathFiles, scalaInstance)
val compiler = state.compilerCache.get(scalaInstance).scalac.asInstanceOf[AnalyzingCompiler]
val classpathOptions = ClasspathOptionsUtil.repl
compiler.console(classpathFiles, project.scalacOptions, classpathOptions, "", "", state.logger)(
val options = project.scalacOptions :+ "-Xnojline"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd love to use a constant here, but scala.tools.nsc.settings.ScalaSettings has no companion object and I don't think that creating our own instance just to extract this value makes much sense.

Copy link
Contributor

Choose a reason for hiding this comment

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

The flag is unlikely to change, so I don't think it's a big deal 👍

Copy link
Contributor

@jvican jvican left a comment

Choose a reason for hiding this comment

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

What a pity this didn't make it into M10! This change looks great, I'm so happy to see the console working again.

@@ -212,7 +212,8 @@ object Tasks {
val loader = ClasspathUtilities.makeLoader(classpathFiles, scalaInstance)
val compiler = state.compilerCache.get(scalaInstance).scalac.asInstanceOf[AnalyzingCompiler]
val classpathOptions = ClasspathOptionsUtil.repl
compiler.console(classpathFiles, project.scalacOptions, classpathOptions, "", "", state.logger)(
val options = project.scalacOptions :+ "-Xnojline"
Copy link
Contributor

Choose a reason for hiding this comment

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

The flag is unlikely to change, so I don't think it's a big deal 👍

@jvican
Copy link
Contributor

jvican commented May 3, 2018

By the way, I just realized that we should handle cancellation for the console gracefully and filed #469.

@jvican jvican merged commit 548e42e into scalacenter:master May 3, 2018
jvican added a commit that referenced this pull request May 3, 2018
tindzk pushed a commit to tindzk/bloop that referenced this pull request May 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect or misbehaviour. cli task / console
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants