You can use either Metals with your favorite editor (VS Code, Neovim, Sublime) or IntelliJ IDEA for Scala to work on the Scala 3 codebase. There are however a few additional considerations to take into account.
The sbt build for dotty implements bootstrapping within the same build, so each component has two projects:
sbt:scala3> projects ... [info] scala3-compiler [info] scala3-compiler-bootstrapped ...
These duplicated projects can be confusing and cause issues in IDEs, so it's import to import the project in a specific way depending on your editor.
When using Metals, the
-bootstrapped projects are not exported by default. Normally this is fine, but if you're working on certain modules like
scaladoc you'll actually want these modules exported. In order to achieve this you'll want to make sure you do two things:
- You'll want to find and change the following under
commonBootstrappedSettingswhich is found in the
- bspEnabled := false, + bspEnabled := true,
sbtas your build server instead of the default, Bloop. You can achieve this with the
Metals: Switch Build Servercommand and then choosing sbt. In VSCode, this looks like this:
In IntelliJ IDEA, we recommend importing the dotty codebase through BSP, then the
-bootstrapped projects are not exported.