Skip to main content

Metals v1.6.4 - Osmium

· 10 min read

We're happy to announce the release of Metals v1.6.4, which brings in a number of improvements for Java support as well as some bugfixes and improvements for other features.

Commits since last release46
Merged PRs46
Contributors7
Closed issues23
New features8

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

Java support improvements

Some basic Java support was already added in an earlier version of Metals, but since then we haven't improved it too much. However, it came to our attention that there is plenty of codebases that currently use Bazel and a mixture of Scala and Java. For those codebases there is no way to use LSP properly aside from Metals. We decided to improve some lower hanging fruits when it comes to Java support.

These new features include:

  • Navigating to definition will now be using the Java compiler directly first, which will not require a full compilation of the file.
  • Signature help for methods and constructors in Java files will now show up together with the documentation.
  • Document highlight for Java will now also be using the compiler instead of semanticdb.
  • Rename and references using the Java compiler directly for variables and methods that are not accessible from other files.

All those improvements allow users to work with Java files without having to compile them first to access most important features.

If there is a feature that you feel is missing, please let us know by opening an issue on GitHub.

We still plan on working on auto import functionality and overall improvements for Java support in the near future.

Save configuration that was run via lenses to Vs Code launch.json

Previously, when running a configuration that was run via code lenses, we would not save that configuration anywhere and the user would have to manually save it to the launch.json file. Now, when running main classes via lenses, we will save that configuration for main classes to the launch.json file automatically if the configuration is not already present.

This behaviour is already present in some other IDEs, so this should be a welcome improvement for many users.

Produce diagnostics for errors in sbt files

When importing a sbt project with the default settings, Metals would not produce any diagnostics for errors in sbt files even if the import failed. This would cause confusion for users as they would not know why the import failed unless they dug through the log files.

In this release, thanks to the work of @afentev, Metals will show the errors in the problem tab alongside other diagnostics.

Refactoring: Automatically add imports when copying between files

This feature was add to the last version of metals, but unfortunately it turned out to not be working correctly yet. In this release, we improved it to reuse the existing auto import functionality when copying between files, which is much more robust and reliable.

Additionally, the feature will now also work for Scala 3 files in the upcoming 3.8.0 and 3.3.8 versions of Scala. 3.8.0-RC1 is already available for testing.

Add fallback for showMessageRequest

Some editors, such as Helix, do not support the showMessageRequest method, which is required for the Metals to work properly. To allow them to function correctly, we added a fallback with a default option to choose in each show message request.

This can be enabled by adding the following to the Metals server configuration in the user settings:

-Dmetals.disable-show-message-request=true

or configuring the client to be Helix editor via:

-Dmetals.client=helix

Let us know if any functionality is missing or is still not working as expected.

Miscellaneous

  • bugfix: Increase timeout for starting tests and make it configurable zielinsky
  • improvement: Also clear caches in case of 2.12 issues tgodzik
  • bugfix: Don't show sbt warnings as errors after Bloop import tgodzik
  • improvement: Include constructor params in document symbol tgodzik
  • bugfix: Support standard Scala 3 library when capture checked tgodzik
  • Cancel compilation before cleaning up the workspace pielas
  • bugfix:Fixed issues when using repositories with credentials tgodzik
  • improvement: Offer to regenerate Scala CLI config when clicking on build tool status tgodzik
  • improvement: Allow first letter to be lower case even if the variable name start with a capital letter tgodzik
  • Allow configuring preferred build system in user config jklukas
  • bugfix: Use existing auto import functionality instead of custom one when copying between files tgodzik
  • bugfix: Add repl module for Scala 3.8.0 in worksheets tgodzik

Contributors

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

$ git shortlog -sn --no-merges v1.6.3..v1.6.4
38 Tomasz Godzik
1 Jeff Klukas
1 Kirill Afentev
1 Mateusz Piękos
1 Radek Busz
1 Zieliński Patryk
1 dependabot[bot]

Merged PRs

v1.6.4 (2025-11-21)

Full Changelog

Merged pull requests:

  • bugfix: Reload classloader when republishing rules #7972 (tgodzik)
  • chore: Don't throw if we can't find symbol #7972 (tgodzik)
  • bugfix: Feature proof support for Scala 3.8.0 #7972 (tgodzik)
  • improvement: Add fallback if showMessageRequest is not supported #7954 (tgodzik)
  • improvement: Ignore flaky tests on MacOS #7968 (tgodzik)
  • add debuggeeGracePeriod as a configuration parameter #7969 (zielinsky)
  • improvement: Also clear caches in case of 2.12 issues #7967 (tgodzik)
  • bugfix: Don't show sbt warnings as errors after import #7966 (tgodzik)
  • improvement: Include constructor params in document symbol #7953 (tgodzik)
  • bugfix: Fix test for the new version of Scala 2.13 #7965 (tgodzik)
  • bugfix: Support standard library when capture checked #7963 (tgodzik)
  • chore: Add support for Scala 2.13.18 #7962 (tgodzik)
  • chore: Update Bloop to 2.0.17 #7960 (tgodzik)
  • Cancelling compilation before cleaning up the workspace #7959 (pielas)
  • feature: Add rename for Java PC #7957 (tgodzik)
  • bugfix: Download fully cross version scalafix dependency #7955 (tgodzik)
  • chore: Remove unused class #7952 (tgodzik)
  • bugfix: Retry downloading scalafix with fallback #7949 (tgodzik)
  • chore: Update scala nightlies repo and remove old sonatype one #7950 (tgodzik)
  • bugfix: Use coursierapi to make sure credentials are used #7947 (tgodzik)
  • bugfix: Check for null in .tpe #7948 (tgodzik)
  • feature: Add support for references in Java PC #7934 (tgodzik)
  • improvement: Also allow using full target id when using discovery #7945 (tgodzik)
  • chore: Update all website dependencies #7942 (tgodzik)
  • build(deps): bump actions/upload-artifact from 4 to 5 #7935 (dependabot[bot])
  • improvement: Offer to regenerate Scala CLI config when clicking on status #7933 (tgodzik)
  • bugfix: Do not throw from OnDemandDefinitionIndex #7931 (tgodzik)
  • chore: Add tests for #5923 #7929 (tgodzik)
  • improvement: Allow first letter to be lower case #7907 (tgodzik)
  • bugfix: Don't modify name if incorrect position #7928 (tgodzik)
  • Allow configuring preferred build system in user config #7924 (jklukas)
  • feat: Produce diagnostics for errors in sbt files #7464 (afentev)
  • feature: Add document highlight for Java using the compiler directly #7927 (tgodzik)
  • improvement: Add stack trace to toplevels fail message #7926 (tgodzik)
  • feature: Add signature help for Java files #7922 (tgodzik)
  • bugfix: Use existing auto import functionality instead #7912 (tgodzik)
  • feature: Add compiler go to definition for Java #7920 (tgodzik)
  • improvement: Do not use imgur for images #7918 (tgodzik)
  • bugfix: Drop suffix when working with scalafix #7915 (tgodzik)
  • bugfix: Fix navigation in mill projects for Java #7914 (tgodzik)
  • bugfix: Remove usage of listFiles, which can cause null pointer exception #7910 (tgodzik)
  • bugfix: Add missing type to array in MCP schema #7905 (gitplaneta)
  • chore: Update scalafmt to 3.10.0 #7906 (tgodzik)
  • bugfix: Fix images in the last releases #7902 (tgodzik)
  • chore: Add release notes for Meals 1.6.3 #7899 (tgodzik)
  • bugfix: Fix test issues after merging #7900 (tgodzik)