Skip to main content

Metals v1.6.0 - Osmium

· 10 min read

We're happy to announce the release of Metals v1.6.0, which, among other things, fixes a regression from the previous release and adds fixes and improvements to the recently added MCP support.

Commits since last release51
Merged PRs50
Contributors8
Closed issues8
New features2

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

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

TL;DR

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

MCP improvements and fixes

Based on user feedback since the previous release, we have fixed some issues related to MCP and added some new tools to further facilitate better agent interaction.

New tools:

  • compile-module - ompile a chosen build target, input is the module name, the same as visible in the Metals Doctor.
  • find-dep - completion tool for finding dependencies using Coursier added by tgodzik.

Improvements:

  • MCP port is now saved and reused for the workspace, so it doesn't have to be repeatedly adjusted in other configurations.
  • Better responses in compile tool. Previously it would only return information about issues and an empty result otherwise; now we explicitly mark a successful compilation. Also for file compilation, if no error is found in the file, Metals will return errors from the whole module to provide possibly useful context.

Fixes:

  • inspect for Scala 3 would previously fail and return only the symbol name.
  • verbose flag marked as optional was previously required. Thanks, rtar for the fix.
  • Correctly handle package objects.
  • Fix generating MCP configuration for VSCode alternative distributions (VSCodium and insider versions).

Module status bar

This release includes a new status bar, which should make some information about the module state more visible.

By default, the status shows the name of the module (build target) that the file in focus belongs to. If the file doesn't belong to any build target or due to an error the build target cannot be resolved, the status will show no build target error message. If the build target is found but there is a compile error in an upstream module, the status will show an error with the name of the upstream module. Finally, if the build target is found and there are no upstream errors, but there are new error reports created for the build target, the status will show a warning with the number of error reports.

module-status-bar-no-error Module status bar showing build target name.

module-status-upstream-error Module status bar showing a compile error in an upstream module

module-status-erros-reports Module status bar indicating 4 new error reports

Fixed blocking user requests

In the previous release, a bug was introduced where Metals would sometimes block waiting for the response for user notification. As a result, Import build, Switch build server and similar requests would fail to work. This issue was fixed in this release with an added timeout.

Fixes for backticked identifiers

This release brings a few fixes around handling backticked identifiers: selection range, location of insert-types code action, and symbol search. Thanks go to harpocrates, who added the needed special handling where it was missed.

Changes for plugin authors

This release adds a module statusType to metals/status request. Further, it modifies the MetalsStatusParams by adding a new metalsCommand field with the following scheme

{
"title": "string",
"command": "string",
"tooltip": "string | undefined",
"arguments": "any[] | undefined"
}

metalsCommand field should take precedence over the previously existing command field.

Depending on if the client supports the metals/status extension, the field moduleStatusBarProvider in initialization options should be populated; it can contain one of the following values:

  • on - if client supports metals/status
  • off - if the client doesn't support metals/status
  • show-message - if the client doesn't support metals/status, but would like the module status to be sent via show message request.
  • log-message - if the client doesn't support metals/status, but would like the module status logged. If the field is empty, it defaults to off.

Contributors

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

$ git shortlog -sn --no-merges v1.5.3..v1.6.0
18 Tomasz Godzik
11 scalameta-bot
14 Katarzyna Marek
4 Alec Theriault
2 dependabot[bot]
1 Adam Warski
1 Ruslans Tarasovs

Miscellaneous

  • fix: indexer bug around type members harpocrates
  • chore: added support for mill 0.12.14 and 1.0.0 tgodzik.
  • fix: encode build target names to include in report file name kasiaMarek
  • fix: use dependency modules for Bazel kasiaMarek
  • improvement: Cache tokenization results when possible tgodzik
  • feat: symbol search for backticked identifiers harpocrates
  • bugfix: Calculate completion items eagerly for Scala 2 tgodzik

Merged PRs

v1.6.0 (2025-06-05)

Full Changelog

Merged pull requests: