Build Tools

Contributing

sbt

sbt is most commonly used build tool in the Scala community works with Metals
out-of-the-box.

Automatic installation

The first time you open Metals in a new workspace it prompts you to import the
build. Select "Import build" to start automatic installation.

Install without Bloop

Automatic build import for sbt happens through
Bloop, a compile server for Scala. Bloop
implements the
Build Server Protocol (BSP)
that Metals uses to learn the directory structure of your project and its
library dependencies. sbt does not implement BSP so Metals is not able to import
sbt builds without Bloop.

Manual installation

It's recommended to use automatic installation over manual installation since
manual installation requires several independent steps that makes it harder to
stay up-to-date with the latest Metals version.

Instead of using automatic build import, you can manually install sbt-metals and
generate the Bloop JSON files directly from your sbt shell. This approach may
speed up build import by avoiding Metals from starting sbt in a separate
process.