Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clearing output from Scala Worksheet

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.

like image 895
Jack Avatar asked Nov 08 '12 19:11

Jack


4 Answers

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

like image 187
Iulian Dragos Avatar answered Sep 21 '22 18:09

Iulian Dragos


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

like image 29
skyluc Avatar answered Sep 21 '22 18:09

skyluc


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!

like image 31
Andrew Smith Avatar answered Sep 19 '22 18:09

Andrew Smith


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

like image 33
Jorge P. Avatar answered Sep 17 '22 18:09

Jorge P.