Skip to main content

Metals v0.11.0 - Aluminium

· 16 min read

We're happy to announce the release of Metals v0.11.0! Due to the number of changes in this release we decided to introduce one more minor version before Metals 1.0.0, which is planned to come this year.

Commits since last release337
Merged PRs136
Closed issues42
New features11

For full details:

Metals is a language server for Scala that works with VS Code, Vim, Emacs, Sublime Text and Eclipse. Metals is developed at the Scala Center and VirtusLab with the help from Lunatech along with contributors from the community.


Check out, and give Metals a try!

  • Add CFR class file viewer.
  • [Scala 3] Type annotations on code selection.
  • Simplify usage of sbt server.
  • Better support for mill BSP.
  • Extract value code action.
  • Add command to run current file.
  • Support test explorer API.
  • Add go to definition via links for synthetic decorations.
  • Basic Java support.
  • Add support for Scala 2.13.8.
  • Reworked Metals Doctor.

Add CFR class file viewer

In addition to the recently added semanticdb, tasty and javap functionalities, thanks to the efforts of Arthurm1, it's now possible to decompile class files using Lee Benfield's CFR (Class File Reader).

CFR decompiles class files to java, which is much more readable than using javap.


In the future this might help in go to definition for jars that do not have a corresponding source jar, which is what Metals uses today.

Editor support: VS Code, nvim-metals, Sublime Text

Extension authors:

This can be added as a new command for the users to invoke.

[Scala 3] Type annotations on code selection

In one of the last releases v0.10.8 we added the ability to inspect the type of an expression that is currently selected. We are happy to announce that this functionality is now also available for Scala 3, which is thanks to the continued effort of the team to bring the users the best Scala 3 experience possible.

Editor support: VS Code, nvim-metals, Sublime Text

Simplify usage of sbt server

Previously if you wanted to use sbt as your build server instead of the default Bloop you'd need to ensure a .bsp/sbt.json file existed before you tried to switch your build server. We originally created the metals.generate-bsp command for this, but realized this potentially forced extra steps on the user. To make this simpler, now even if no BSP entry exists for sbt and you attempt to switch your build server to sbt via the metals.bsp-switch command, we'll either use the existing .bsp/sbt.json file if one exists or automatically generate it (needs at least sbt 1.4.1) for you and then switch to it.

Editor support: All.

Better support for mill BSP

Recently Mill has complete revamped their BSP implementation allowing for a much better experience for Metals users. Just like sbt, you can now use the metals.bsp-switch command to use Mill as your BSP server (needs at least Mill 0.10.0-M4). Keep in mind that the BSP support in Mill is still a work-in-progress. If you are interested in Mill BSP and you're a Metals user, feel free to include your input here as they are requesting feedback on improving the experience.

Editor support: All.

Extract value code action

In this release we introduce a new code action that allows users to automatically extract method parameter to a separate value.

For example in a invocation such as:

def main(name: String) =
println("Hello " + name + "!")

when user invokes the new code action they will see:

def main(name: String) =
val newValue = "Hello " + name + "!"

This should work correctly for both Scala 2 and Scala 3, in which case it will try to maintain your coding style even if a block is needed.

One important limitation is that this new code action doesn't allow extracting lambdas or partial functions, as this has the potential of breaking your code.

Currently, this works only in method parameters and Metals will try to choose the exact parameter to extract even if there is a number of nested ones. This will most likely be improved in the future to also be used in other places such as if conditions or to allow users to choose the exact parameter they want to extract.

Editor support: All

Add command to run current file

Based on the work of ckipp01 in one of the previous releases it's now possible to invoke a command to run anything in the current file. This means that if we use this new command anything that is located within the currently focused file, whether it's tests or a main class, will be properly discovered and run.

In Visual Studio Code this replaces the previously default config generation and now if no launch.json is specified in the workspace, any file can be run using the default run command (F5).

Editor support: Any editor that supports DAP

Support test explorer API.

Metals 0.11.0 implements Visual Studio Code's Testing API. According to the documentation:

The Testing API allows Visual Studio Code extensions to discover tests in the workspace and publish results. Users can execute tests in the Test Explorer view and from decorations. With these new APIs, Visual Studio Code supports richer displays of outputs and diffs than was previously possible.

Test Explorer UI is a new default way to run/debug test suites and replaces Code Lenses. The new UI adds a testing view, which shows all test suites declared in project's modules. From this panel it's also possible to run/debug test or to navigate to test's definition.


Code Lenses are still the default in other editors and can be brought back by setting "metals.testUserInterface": "Code Lenses"

Editor support: Visual Studio Code

Since Metals v0.9.6 it's possible to show additional information about sythetic code that is being generated by the compiler. This includes implicit parameters, classes and conversions. It wasn't however possible to find their definitions. This limitation was mostly due to the lack of proper UI options in different editors.

Recently, we've managed to work around it by using command links that can be rendered in the hover and will bring the user to the right definition.


Editor support: Visual Studio Code, Sublime Text

Basic Java support

Thanks to the the effort led by Arthurm1 Metals now supports a subset of features for Java files and even Java only build targets. Currently the biggest missing piece is interactive compiler that would allow us to properly support features such as completions, hover or signature help.


This was possible thanks to using the Java semanticdb plugin included in lsif Java project from sourcegraph and especially the work by olafurpg.

The support includes:

  • formatting
  • code folding
  • go to definition
  • references
  • go to implementation
  • rename
  • run/debug code lense for Java main classes

These functionalities will also now work thanks to dos65's work in dependency sources.

We are still missing some of the interactive features such as:

  • hover
  • completions
  • signature help
  • selection range

An important note to make is that, while we still want to support some more features, Metals is not a Java language server, so we will never offer the same amount of functionality as the tools and IDEs focused on the Java language. Current discussion about the scope of Java support can be found in this issue. Especially, we will most likely not support any more advanced refactorings or presentation compiler functions.

Visual Studio Code: In case you want to use Metals in a Java only workspace it's now also possible to start Metals using a new Start Metals button in the the Metals tab. We don't want to start Metals as a default in such cases as some other language server might be more suitable.

Editor support: All

Reworked Metals Doctor

Due to the other changes in this release the Metals Doctor needed to be reworked to better show the different targets that are available in the workspace as well as try to explain a bit better what is supported and why it might not work.


The type column can now have 3 different values Scala <version>, sbt <version> or Java. We also replaced some of the columnsm which are now:

  • diagnostics - tells whether and what kind of diagnostics are published by the target.
  • interactive - tells whether interactive features such as hover or completions are working, this should work for all supported Scala and sbt versions.
  • semanticdb - explains whther the semanticdb indexes are generated for the target
  • debugging - tells whether you can run or debug within that target
  • Java support - in mixed targets this will tell users if the semanticdb indexes are also generated for Java files.

You can always look for explanation of these statuses underneath the table or on the right in the Recommendation column.

Editor support: All

Extension authors:

If you are using the json output method for the doctor, you will need to modify the way it's displayed according to this.


  • Allow to create trace files for debugging in .metals directory. kpodsiad
  • Fix issues with stale code lens being shown. dos65
  • Print Bloop logs when connection errored out. tgodzik
  • Fix issues with given imports in organize imports. tgodzik
  • Fix issues with type on selection in Ammonite scipts. tgodzik
  • [Scala 3] Improve type shown for generics in hover. dos65
  • [Scala 3] Fix go to defition for givens. dos65
  • Use Mill --import to import bloop when supported. lolgab
  • Enable to create file with just package. kpodsiad
  • Fix Gradle detection when file other than build.gradle is at top level. GavinRay97
  • Use proper dialect and ignore sbt targets when automatically setting up scalafmt.conf. dos65
  • Detect missing in doctor. ayoub-benali
  • Ensure autoimports don't break scala-cli directives. ckipp01
  • [Scala 3] Don't show error type if it cannot be inferred by the compiler. tgodzik
  • Fix analyze stacktrace when using toplevel methods. tgodzik
  • [Scala 3] Fix insert type in case of type aliases. tgodzik
  • [Scala 3] Use maybeOwner instead of owner when looking for shortened name. ckipp01
  • [Scala 3] Fix autoimport with prefixes. dos65


Big thanks to everybody who contributed to this release or reported an issue!

$ git shortlog -sn --no-merges v0.10.9..v0.11.0
Tomasz Godzik
Ayoub Benali
Vadim Chelyshov
Chris Kipp
Arthur McGibbon
Kamil Podsiadlo
Gavin Ray
Adrien Bestel
Alexandre Archambault
Lorenzo Gabriele
Thomas Lopatic

Merged PRs

v0.11.0 (2022-01-12)

Full Changelog

Merged pull requests: