Question

Every-time you save a Scala Worksheet in the Scala IDE, the output of each expression is printed as comments on the right-hand side of the editor. Is there a way to clear this output from a Scala Worksheet so that you can cut and paste code?

Currently, my solution is to save my worksheet with an error, so that the output would disappear. There must be a better way... a keyboard shortcut or something.

Was it helpful?

Solution

There is no such feature yet. There is a related ticket: The Format action should strip comments.

OTHER TIPS

While waiting for the ticket to be resolved, this regular expression can be used in Find/Replace (Ctrl/Cmd+F) to delete the comments.

 *//[>|].*$

Update: This has been fixed: #132

It's jerry-rigged, but gets the job done.

  1. Make a small edit (e.g. delete a space where it doesn't matter) to prompt a save.
  2. Save.
  3. Press Esc immediately to terminate worksheet process.

You now have a clean worksheet!

Ctrl+Shift+C does the job in Scala IDE 4.7.0

Alt+Shift+A enables Block selection mode. You will be able to select only left part of screen (columns with code). Block mode also makes possible to select only columns with output.

More on block selection mode

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top