Dotty comes built-in with the Dotty Language Server, an implementation of the Language Server Protocol, which means that any editor that implements the LSP can be used as a Dotty IDE. Currently, the only IDE we officially support is Visual Studio Code.
To use this in your own Scala project, you must first get it to compile with Dotty, please follow the instructions at https://github.com/lampepfl/dotty-example-project
- Install Visual Studio Code.
- Make sure
code, the binary for Visual Studio Code, is on your
$PATH, this is the case if you can start the IDE by running
codein a terminal. This is the default on all systems except Mac where you'll need to follow these instructions: https://code.visualstudio.com/docs/setup/mac#_command-line
- In your project, run:
- Typechecking as you type to show compiler errors/warnings
- Type information on hover
- Go to definition (in the current project)
- Find all references
- Documentation on hover
- Worksheet mode
- Go to definition in external projects
- Formatting code (requires integrating with scalafmt)
- Quick fixes (probably by integrating with scalafix)
- Projects should be compiled with sbt before starting the IDE, this is
automatically done for you if you run
- Once the IDE is started, source files that are not opened in the IDE should not be modified in some other editor, the IDE won't pick up these changes.
- Not all compiler errors/warnings are displayed, just those occurring during typechecking.