Skip to main content

Metals v0.11.2 - Aluminium

· 9 min read

We're happy to announce the release of Metals v0.11.2, which focuses on improving overall user experience.

Commits since last release197
Merged PRs94
Contributors11
Closed issues19
New features7

For full details: https://github.com/scalameta/metals/milestone/?closed=1

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

TL;DR

Check out https://scalameta.org/metals/, and give Metals a try!

  • Reduce indexing time in monorepos on MacOS
  • Display build target info
  • View source jar files as virtual docs
  • Improve completions for Scala 3
  • [Test Explorer] Detect and run single tests for JUnit4

Reduce indexing time in monorepos on MacOS

Thanks to changes made by Duhemm, Metals on MacOS can now index monorepo workspaces much faster than before. After changes, we observed at times over 10 times faster indexing times in the workspaces where only a few submodules needed to be imported.

Here are a few examples of indexing improvement. They are not actual benchmarks of any kind, but more of rough estimations of improvements in a couple of example repos.

BeforeAfter
>10minutes~30seconds
~40seconds~4s

However, take into mind that indexing speedup heavily depends on your repository structure. The more imported modules which don't need to be imported, the greater the speed improvement is.

If you are interested in details you can check out the related pull request.

Display build target info

Thanks to the Arthurm1 Metals is now able to display all important information about modules. This brand new feature gathers in one view information such as:

  • javac and scalac options
  • dependent modules
  • projects classpath
  • and many more

display-build-target-info

[vscode] View source jar files as virtual docs

Previously, when the client wanted to browse files in source jars source, these files were extracted and saved in the metals/readonly/dependencies directory. With the help of virtual documents Metals can show you dependencies in readonly files without unnecessary copying. Thanks Arthurm1 for this feature!

Together with Metals tab, this feature could be used to browse through your dependencies' sources. Just run the Metals: Reveal Active File in Side Bar command and browse through both dependencies and source code seamlessly.

virtual-docs-navigation

Currently, Metals: Reveal Active File in Side Bar works only for Scala 2.

Improve completions for Scala 3

Completion suggestions for different Scala keywords now work with most of the Scala 3 keywords. This includes for example given and enum, it should also work even if defining things in toplevel without a wrapping class or object. keyword-completions

Another improvement for Scala 3 completions is better support for showing scope completions, when writing in an empty line. Previously, we would not show correct completions when no identifier was specified.

object Foo:
def bar: Int = 42
def baz: Int =
val x = 1
val y = 2
@@

In the above situation with cursor position indicated by @@ we will now properly show bar and baz completions.

[Test Explorer] Detect and run single tests for JUnit4

We're actively working on improving the Test Explorer and making it better with each release. From this release, Metals is able to run or debug single test in JUnit4.

Currently, this feature only works when using Bloop as your build server, but in a future release there will be support added for sbt as well.

test-explorer-single-tests

[vscode] Add mirror setting to help coursier set up

In order to bootstrap Metals, vscode's extension uses the coursier script which needs access to repo1.maven.org. Previously, this URL couldn't be configured which was causing problems on the machines that didn't have access to repo1.maven.org.

Thanks to tgodzik's work from now on it's possible to define metals.coursierMirror property.

coursier-mirror

More information about mirrors can be found at coursier documentation.

Miscellaneous

  • Show implicit decorations in worksheets #3582 (tgodzik)
  • Add current env variables to bloopInstall #3662 (tgodzik)
  • Fix issues with Ammonite multistage scripts #3627 (tgodzik)
  • Print information about candidates searched when missing JDK sources #3606 (tgodzik)

Contributors

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

$ git shortlog -sn --no-merges v0.11.1..v0.11.2
37 Tomasz Godzik
24 Vadim Chelyshov
22 Scala Steward
15 Arthur McGibbon
8 Kamil Podsiadlo
7 ckipp01
6 Kamil Podsiadło
1 Martin Duhem
1 Adrien Piquerez
1 Jerome Wuerf
1 Hugo van Rijswijk

Merged PRs

v0.11.2 (2022-03-08)

Full Changelog

Merged pull requests: