Improve Scala compiler settings integration #2867
Labels
enhancement
New feature or request
missing feature
Something should have been implemented, but wasn't.
scalac compatibility
Issues tied with compatibility with the scalac (compiler) command.
Sorry for another ticket like #2779 / #753... I understand there are difficulties how to handle this, but the user experience can probably still be improved.
There are compiler options not forwarded by the compiler, for example
When a user installs Scala, runs the compiler, and the compiler tells them to add a flag (
-explain
), they should not need to figure out that they actually need to do-O -explain
.The approach currently is for scala-cli to forward known compiler flags. Would it be possible to pass all unrecognized arguments to the compiler by default (for compile / repl / doc)?
As a backstop, a static hint in the "Unrecognized argument" message could help. If
scala-cli compile / repl / doc
gets an unrecognized argument, it could suggest"Use -O ${unrecognized} to pass the argument to the Scala compiler"
.Another confusing situation is because the compiler is not invoked when there are no souce files. So
scala-cli compile -S 2 C.scala -opt:help
works, butscala-cli compile -S 2 -opt:help
doesn't.Finally, in Scala 2 at least there are compiler options that support space separated arguments, for example
-Vopt _
or-Vprint-args args.txt
. The first makes scala-cli hang, the second gives an error message ([error] args.txt: unrecognized source type
).It's again not obvious for the user what's going on.
The text was updated successfully, but these errors were encountered: