Working with Scala Worksheet
IntelliJ IDEA lets you create a Scala worksheet that enables you to evaluate your Scala code results in a special view of the Scala editor.
- Creating Scala Worksheet
- Running Scala Worksheet
- Removing Worksheet's Results
- Copying Actions
- Configuring Worksheet Settings
Creating Scala Worksheet
- Right-click on your project and select New|Scala Worksheet.
- In the New Scala Worksheet window type a name of your Scala worksheet and click OK.
As a result, a file with .sc extension opens. Now you can enter your code.
Running Scala Worksheet
- Enter your code and press to see the results. If you select Interactive Mode check box then
the code results will be displayed automatically.
You can clear the Make project check box to improve evaluation performance. In this case, the automatic checking of project's changes is disabled. The results appear in the view on the right side of your code.
- You can evaluate a Scala object. You can fold the output without affecting your code on the left side and expand only that block output that matches a specific statement.
Removing Worksheet's Results
Configuring Worksheet Settings
- Select File|Settings|Languages and Frameworks|Scala and click Worksheet tab.
- On the Worksheet tab, you can set the output cutoff limit and configure in what mode you want to run the worksheet.