Skip to content

Option -Xprompt broken within interactive sbt sessions #22239

Closed
@bracevac

Description

@bracevac

Compiler version

3.6.4-RC1-bin-SNAPSHOT-nonbootstrapped-git-4c76323

Minimized code

Passing -Xprompt allows us to interactively obtain the stacktrace when the compiler prints an error message (very very useful!). However, that does not work properly from within an sbt session, e.g., when working on the compiler itself. Say we have an erroneous program in foo.scala, and invoke scalac -Xprompt foo.scala:

-- [E103] Syntax Error: foo.scala:1:0 ------------------------------------
1 |"dumb"
  |^
  |Illegal start of toplevel definition
  |
  | longer explanation available when compiling with `-explain`

a)bort, s)tack, r)esume:

Output

With a precompiled scalac binary, it'll work fine (can press a, s, or r and it does its magic), but invoking the sbt task of the same name in the compiler code base will not accept any input.

Bonus: In a "decent" terminal emulator (e.g., iterm2) we can abort with ctrl-c, but using the VSCode builtin terminal (connecting with sbt --client to Metal's sbt instance), not even that will work and we are completely stuck (need to kill VSCode & orphan java processes left behind).

Expectation

It works from within an sbt session just the same as with the precompiled binary.

Edit: + it should also work with scala3-bootstrapped/scalac

Metadata

Metadata

Assignees

Labels

area:dxIssues tied to the developer experience when working on the compiler.area:toolingitype:bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions