Skip to main content

Metals v0.10.8 - Tungsten

We're happy to announce the release of Metals v0.10.8, which brings a lot of new features in addition to Scala 3.1.0 support!

Commits since last release162
Merged PRs70
Contributors16
Closed issues11
New features4

For full details: https://github.com/scalameta/metals/milestone/43?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!

  • Expression evaluator for Scala 2
  • [Scala 2] Type annotations on code selection
  • Source file analyzer
  • Find text in dependency JAR files
  • VSCode - workspace symbol search fix
  • Scala 3.1.0 and completion improvements

Expression Evaluator#

The long awaited issue #3051 was close to celebrating its 2 years birthday but due to the impressive work by @tdudzik and help from @adapi and @tgodzik Metals finally has support for expression evaluation during debugging! The implementation is based on the initial idea from @smarter's for expression evaluation in the Dotty Language Server.

Currently, it's implemented only for Scala 2, however the work on Scala3 support is in progress.

Since expression evaluation is a complex feature there might still be some bugs that we didn't account for, so do not hesitate to report anything that doesn't look right.

evaluator

Editors support: every client that implements DAP

Type annotations on code selection#

Thanks to @KacperFKorban, yet another long awaited issue #3059 was closed. Previously, hover in Metals was limited by the LSP protocol and only worked for a single position, however it turns out that it was possible to work around this limitation.

selection

Editors support: VS Code, nvim-metals

Source file analyzer#

The Show Tasty command from the previous release was extended. Now, Metals also can show javap and semanticdb outputs from the source. Thanks @Arthurm1 for javap/semanticdb implementation and @kpodsiad for aligning all views into a single feature.

The full list of commands:

  • metals.show-tasty
  • metals.show-javap
  • metals.show-javap-verbose
  • metals.show-semanticdb-compact
  • metals.show-semanticdb-detailed
  • metals.show-semanticdb-proto

In VS Code you can notice that there is a new Metals Analyze Source submenu in file pop-up menu that provides a list of all these commands.

analyze

Editors support: VS Code, nvim-metals

Find text in dependency JAR files#

This release also introduces another helpful feature, it's possible now to do text search through files in classpath jars and source-jars. Thanks to @ Z1kkurat for his contribution!

find-in-jars

Editors support: VS Code, nvim-metals

VSCode extension - workspace symbol search fix#

Initially, workspace symbol search in Metals allowed you to extend the search in a couple of ways:

  • It was possible to look through all the dependencies by adding the semicolon ; at the end or to search. This was done by default if no results were found in the current workspace.

  • Users could use the full path for symbols such as j.n.f.Path for java.nio.file.Path .

Unfortunately, this stopped being possible in some later Visual Studio Code versions. To work around that issue a new command was added: metals.symbol-search, which allows for the additional search features. This already works for all other editors. In addition, Metals extension now overrides default keybing for symbol search: Ctrl+T/Cmd+T executes this Metals command.

An important notice: we can't fix the default workspace symbol search. It still uses default VS Code implementation.

symbol-search

Scala 3.1.0 and completion improvements#

And lastly this new Metals release comes with a new compiler version support - 3.1.0. As well as support for the next release candidate 3.1.1-RC1, which will be later updated in the SNAPSHOT Metals versions in case of further release candidates. We also further improved the support for Scala 3:

  • Completion items ordering were reworked and now it should match the behaviour of Scala 2
  • Type descriptions in completion now shows the precise type for generic methods

Miscellaneous#

  • Fix type decorations for sbt/standalone files @tgodzik
  • Use Scala 3 syntax by default. @smarter
  • Support more scenarios in rewrite parent/braces code action. @kpodsiad
  • Fix go to parent code lenses for local symbols. tgodzik
  • Strip out [info] for stacktraces. ckipp01
  • [sbt server] Fix meta-build-target configuration. adpi2
  • Add build server version to the doctor view. kpodsiad

Contributors#

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

$ git shortlog -sn --no-merges v0.10.7..v0.10.8
25 Tomasz Godzik
20 Vadim Chelyshov
13 Z1kkurat
10 Adrien Piquerez
8 Kamil Podsiadlo
4 ckipp01
3 Gabriele Petronella
2 tdudzik
2 Ólafur Páll Geirsson
1 Alexandre Archambault
1 Arthur McGibbon
1 Guillaume Martres
1 Kacper Korban

Merged PRs#

v0.10.8 (2021-10-26)#

Full Changelog

Merged pull requests: