Build Tools

Contributing

Atom

Requirements

Java 8. Metals does not work with Java 11 yet so make sure the JAVA_HOME
environment variable points to Java 8.

macOS, Linux or Windows. Metals is developed on macOS and every PR is
tested on Ubuntu+Windows.

Scala 2.12 and 2.11. Metals works only with Scala versions 2.12.8, 2.12.7, 2.12.6, 2.12.5, 2.12.4, 2.11.12, 2.11.11, 2.11.10 and 2.11.9.
Note that 2.10.x and 2.13.0-M5 are not supported.

Installing the package

Install the package by searching for "ide-scala" or run the following command.

apm install ide-scala

Importing a build

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

"Not now" disables this prompt for 2 minutes.

"Don't show again" disables this prompt forever, use rm -rf .metals/ to re-enable
the prompt.

Behind the scenes, Metals uses Bloop to
import sbt builds, but you don't need Bloop installed on your machine to run this step.

Once the import step completes, compilation starts for your open *.scala
files.

Once the sources have compiled successfully, you can navigate the codebase with
goto definition.

Custom sbt launcher

By default, Metals runs an embedded sbt-launch.jar launcher that respects .sbtopts and .jvmopts.
However, the environment variables SBT_OPTS and JAVA_OPTS are not respected.

Update the server property -Dmetals.sbt-script=/path/to/sbt to use a custom
sbt script instead of the default Metals launcher if you need further
customizations like reading environment variables.

Speeding up import

The "Import build" step can take a long time, especially the first time you
run it in a new build. The exact time depends on the complexity of the build and
if library dependencies need to be downloaded. For example, this step can take
everything from 10 seconds in small cached builds up to 10-15 minutes in large
uncached builds.

Manually trigger build import

Run doctor

Execute the "Run Doctor" through the command palette to troubleshoot potential
configuration problems in your workspace.

Using latest Metals SNAPSHOT

Update the "Metals version" setting to try out the latest pending Metals
features.

Version

Published

0.4.4

02 Feb 2019 18:09

0.4.4+114-c94d712a-SNAPSHOT

21 Mar 2019 15:07

Run the "Reload Window" command after updating the setting for the new version
to take effect.

Gitignore .metals/ and .bloop/

The Metals server places logs and other files in the .metals/ directory. The
Bloop compile server places logs and compilation artifacts in the .bloop
directory. It's recommended to ignore these directories from version control
systems like git.