Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Redirect
locationhttps://www.jetbrains.com/help/idea/working-with-scala-worksheet.html

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.

...

To create a Scala Worksheet, right-click on your project and select

Wiki Markup
{span:class=shortcut}New{span}
Wiki Markup
{span:class=shortcut}Scala Worksheet{span}


 

Note

It is recommended to create your worksheet in src directory to simplify an inclusion of the project's classes in the classpath. That might be helpful for testing purposes.

In the New Scala Worksheet window type a name of your Scala worksheet and click

Wiki Markup
{span:class=shortcut}OK{span}
.

As a result, a file with .sc extension opens. Now you can enter your code.

2. Running Scala Worksheet

You can enter your code and press  to see the results. You can clear the

Wiki Markup
{span:class=shortcut}Make project{span}
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 fold the output without affecting your code on the left side and expand only that block output that matches a specific statement.
 

3. Removing Worksheet's Results

...

You can easily copy your code and evaluation results into one file by clicking icon. 

5. Configuring Worksheet Settings

...