Working with Scala Console
IntelliJ IDEA lets you run Scala Console to quickly evaluate an expression or a code selection.
Running Scala Console
- Right-click on your Scala object and select Run Scala Console from the drop-down list.
Evaluating Code in Scala Console
- Type an expression in the console and evaluate it. You can also evaluate a code selection by sending it from the editor to the Scala console.
- To see the result of the typed expression, press Ctrl+Enter.
- To send the code selection to Scala Console, select the code in the editor, press Ctrl+Shift+X (for Windows) or Shift+⌘+X (for Mac). Alternatively, right-click on the code selection and from the context menu select Send Selection To Scala Console to get the same result. Now, you can view the selected code and its evaluation in the console.
Using Toolbars in Scala Console
- You can use Run toolbar and Console toolbar options to rerun, stop, pause, or terminate the Scala console.
Last modified: 5 April 2017