Skip to main content

Metals v0.11.6 - Aluminium

· 8 min read

We're happy to announce the release of Metals v0.11.6 which continues to improve the Scala 3 support along with many other fixes.

Commits since last release165
Merged PRs56
Contributors12

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

  • reduce memory usage in large projects
  • override completions for Scala3
  • improved scaladoc support in both Scala2 and Scala3
  • better UX in the test explorer
  • automatically setup java home for the Bloop build server
  • support for Scala 3.1.3-RC3 and RC4

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

Reduce file watcher memory usage

Previously, Metals consumed a huge amount of memory for file watchers in large projects, especially on macOS. Now, Metals uses a memory-efficient way to watch files to detect changes and consume less memory.

For more technical details, see the original PR: #3758.

[Scala3] Override Completions

Override completions for Scala3 are now available with Metals 0.11.6! Now, Metals shows the scaladoc on hover for Scala3 projects. (Before this release, Metals was unable to show the scaladoc for the symbols from third-party modules).

override-completion

[Scala3] Show scaladoc on hover for Scala 3 project

Previously, scaladocs were missing for a lot of classes and methods in Scala 3, especially for the symbols from third-party modules. From this release, Metals will always show the scaladoc on hover for Scala3 projects.

hover-scala3

[Scala3] Support completionItem/resolve

completionItem/resolve is a feature that provides on-demand, more detailed information when moving through the list of suggested completions. It will show documentation, proper parameter names for Java methods, and default values for Scala 3 methods. Now, this is also available for use in Scala 3.

completion-item-resolve

Show parent scaladoc if implementation is returning empty

Scaladocs can be inspected whenever you hover, use a completion or signature help. Up until recently we only showed you the documentation if the exact method you are using had the scaladocs written, which meant that if you overrode a method and didn't add the scaladoc comments again we would not show you any documentation. One example of such method is headOption on List.

From this release we will also search the parent method in case the current method's scaladoc are empty.

[Scala 3] Show scaladocs for signature help

As mentioned in the previous paragraph, Metals can show you documentation in three different places. That, however, was true only for Scala 2 previously. In this release, we will now show you proper documentation whenever invoking signature help.

As a reminder, signature help is used to indicate what parameters can be used in a method. It should pop up automatically after writing (, but you can also invoke it manually. In VS Code that takes the form of editor.action.triggerParameterHints command, which can also be bound to a shortcut and by default is.

[MUnit] Test Explorer can find helper methods from parent classes

MUnit allows to use helper functions when declaring tests. Very often those helper methods are extracted to some parent classes which are extended by many test suites. Now, Metals can find usages of those helper methods and display them in Test Explorer.

This feature is available for Bloop and SBT 1.7.0-M2 or later.

MUnit-helper-methods

Support Cats Effect stacktraces in stacktrace analyzer

Cats Effect offers asynchronous stack tracing which augments exceptions with additional information.
Now, Stacktrace Analyzer is able to recognize CE's stacktraces and provide link to location in code. Say no to tedious debugging when you have only stacktrace from the logs!

cats-effect-stacktraces

Improve implement all completion and code action

Previously, when we invoked the "implement all members" completion and code action, Metals used x$0 for Java parameter names. Now, Metals fills these with the correct parameter names.

Improve rewrite to braces/parenthesis code action

Sometimes, it wasn't clear which code would be affected by rewrite to braces/parenthesis code action. Now, code action's description contains name of the function/method which will be affected by executing action. rewrite-braces-parens Theme: One Dark Pro

Automatically setup java home for the Bloop build server

In previous versions of Metals, if users wanted to change the java version of the Bloop build server, they would need to manually update .bloop/bloop.json file in their user home directory. With this version, we ensure that the Bloop Java version will correspond to Metals one to avoid weird compilation issues that could arise from different versions being used.

Now, each time you update javaHome or bloopJvmProperties settings, Metals will ask you whether to forward those changes to the Bloop configuration file. If you modified that file previously or want to use a custom one, you can dismiss the Metals notification. Otherwise, everything will automatically be set up for you once you decide to apply the changes. If you never created the file, we will create it before starting Bloop, so you should not notice anything out of order.

Support for Scala 3.1.3-RC4, 3.1.3-RC3

Metals 0.11.6 supports Scala 3.1.3-RC3 and RC4.

Contributors

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

$ git shortlog -sn --no-merges v0.11.5..v0.11.6
34 Rikito Taniguchi
18 Tomasz Godzik
14 Scala Steward
11 Vadim Chelyshov
10 zmerr
7 Kamil Podsiadlo
5 Pavol Vidlička
5 ckipp01
4 Arman Bilge
2 Ian Tabolt
1 Arthur McGibbon
1 tgodzik

Merged PRs

v0.11.6 (2022-06-03)

Full Changelog

Merged pull requests: