Skip to main content

Metals v0.10.3 - Tungsten

· 5 min read

We're happy to announce the release of Metals v0.10.3, which brings support for the long awaited Scala 3.0.0 version together with some important improvements.

Commits since last release104
Merged PRs49
Contributors6
Closed issues12
New features6

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

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.

TL;DR

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

  • [Scala 3] Scala 3.0.0 support!
  • Scala 2.13.6 along with -Xsource:3 support.
  • Extract class code action.
  • Rename file as class.
  • [Scala 3] Auto imports in completions and code actions.
  • Support same names in different build targets.

Extract class code action

Due to the great work by @Giggiux Metals now provides a new Extract to file code action, which is available when there are multiple definitions in the source file. This works for classes, traits, enums, and objects. The code action will not show if the definition we are extracting is or extends a sealed definition.

gif1

The extraction happens via a code action on the definition's name, it will also extract any relevant package definition, imports, and, if available, the companion.

Rename file as class

It is also now possible when there is only a single definition in a file that doesn't have the same name as the definition, to quickly rename the file according to its content.

gif2

[Scala 3] Auto imports in completions and code actions

Previously, the experience of writing Scala 3 code might be spoiled because these usual features weren't implemented for Scala 3 in Metals. We are happy to say that there is no more need to write imports by hand and remember the exact path to the symbol. Now, completions in Scala 3 sources provide symbols from the workspace and libraries and their application automatically adds the necessary import. Code action AutoImport also started working.

Enjoy writing Scala 3!

This required some huge amounts of effort and is working thanks to (dos65).

Support same names in different build targets

This change fixes navigation issues that previously happened in case of having clashing names across libraries and projects. An additional thing you might notice with this change is the presence of library names in .metals/readonly directory. Previously, for example, if jump into String the file was extracted into ./metals/readonly/scala/Predef.scala.

Now it will be ./metals/readonly/dependencies/scala-library-$scalaVersion-sources.jar/scala/Predef.scala

Miscellaneous

  • Support names with dots for "Implement all members" code action.
  • Fix invalid auto imports with wrong prefix.
  • Fix flaky "Organize imports" behaviour.

Contributors

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

$ git shortlog -sn --no-merges v0.10.2..v0.10.3
Tomasz Godzik
Luigi Frunzio
Vadim Chelyshov
Chris Kipp
Amaal Ali
Evgeny Kurnevsky

Merged PRs

v0.10.3 (2021-05-17)

Full Changelog

Merged pull requests: