Skip to main content

Metals v0.7.5 - Thorium

ยท 4 min read

We are excited to announce the release of Metals v0.7.5 - codename "Thorium" ๐ŸŽ‰ The release includes couple of bug fixes for 0.7.2, which were present in some rare scenarios. We also added a new experimental feature, which we would be happy to get feedback about.

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

In this release we merged 12 PRs and closed 6 issues, full details: https://github.com/scalameta/metals/milestone/17?closed=1

TL;DRโ€‹

Check out the website and give Metals a try: https://scalameta.org/metals/

  • add auto-fill option to case classes
  • deduce values for named parameters completions
  • multiple fixes after adding support for Scala 2.12.9
  • fixes for automatic addition of | in multiline strings

Add auto-fill option to case classesโ€‹

Whenever we invoke a method and try completions inside the brackets there is an additional option to allow Metals to deduce what should be filled for each parameter.

auto-fill

This algorithm checks if there exists a value in scope with the same type as the parameters' and then works according to the rules below:

1. If there is only one candidate, use it.
2. If there is more than one, give user an alternative to choose one of them.
3. Otherwise use use "???".

This feature also uses the snippets syntax to allow to quickly go over the auto-filled parameters and choose or replace the auto-filled values.

Deduce values for named parameters completionsโ€‹

Leveraging the work that went into the previous feature, we were also able to provide additional support for concrete values in named parameter completions.

deduce

We generate completion item for each value that fits the type of the parameter.

Multiple fixes after adding support for Scala 2.12.9โ€‹

After updating Metals to work with Scala 2.12.9 it turned out that completions and hover didn't work correctly and due to the presentation compiler crashing in the following scenarios:

  • whenever an older version of SemanticDB plugin was used as was the case with Mill
  • when using Scala 2.12.8 without SemanticDB plugin

Both issues have now been fixed and additionally we updated the default Mill version to 0.5.1, which works correctly with Scala 2.12.9.

Fixes for automatic addition of | in multiline stringsโ€‹

We now make sure that stripMargin exists when adding | automatically in multiline strings. This could cause issues in some scenarios, where multiline string contained |, but it was not only used for formatting.

Additionally, we fixed the feature to also work in interpolated strings, which was missing in the previous release.

Contributorsโ€‹

Big thanks to everybody who contributed to this release!

$ git shortlog -sn --no-merges v0.7.2..v0.7.5
Tomasz Godzik
Gabriele Petronella
ลukasz Byczyล„ski
Olafur Pall Geirsson

Merged PRsโ€‹

v0.7.5 (2019-09-12)โ€‹

Full Changelog

Merged pull requests: