Metals v1.5.2 - Strontium
We're happy to announce the release of Metals v1.5.2, which continues to improve overall user experience and stability of Metals. This release includes a number of new features, bug fixes and improvements. Especially worth mentioning is the fix for the Scala 2 issue, which previously caused most interactive features to break when using a type defined in a package object.
Commits since last release | 145 |
Merged PRs | 132 |
Contributors | 16 |
Closed issues | 42 |
New features | 5 |
For full details: https://github.com/scalameta/metals/milestone/77?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!
- Deduplicate compile requests
- Add exact location for the test failure
- Convert sbt style deps on paste in for scala-cli
- Add test cases discovery for TestNG
- Improvements to automatic imports
- Remove Ammonite script support
Deduplicate compile requests
In previous versions of Metals, we would sometimes send multiple compile requests for the same file expecting most of them to be fast. This worked reliably well in Bloop, but not so much in a lot of other build servers such as sbt.
Thanks to kasiaMarek we will try not to send multiple requests if we know a file hasn't changed between them. This should help in a number of cases and make the experience more reliable.
Add exact location for the test failure
Previously, when running tests in Metals with VS Code Test Explorer, the location of the test failure was not shown, only the start of the test case. Now, we will correctly show the exact location of the test failure, which should make it easier to navigate to the failing test.
Convert sbt style deps on paste in for scala-cli
Thanks to majk-p any sbt style dependencies that
you paste into a Scala CLI file after //> using dep
will be automatically
converted to Scala CLI style dependencies. This was previously only supported in
a code action, but turns out to be useful enough to apply the rewrite automatically on paste.
Add test cases discovery for TestNG
Thanks to kasiaMarek it's now possible to run TestNG tests inside Metals, which was previously not possible.
This would mean following test cases will now show lenses or test explorer icon next to them:
import org.testng.annotations.Test
class TestNG {
@Test
def testOK(): Unit = {
assert(true)
}
}
Improvements to automatic imports
Whenever importing a particular symbol, Metals would previously suggest all the possible symbol with the expected name. However, in a lot of cases, those symbol might already have a method being invoked on them, which means that only symbols containing that method should be suggested.
For example in the following code:
object O{
Future.successful(1)
}
we don't need to suggest java.concurrent.Future, but only
scala.concurrent.Future since only the latter contains the successful
method.
If none of the symbols contains that specific method, we will revert to showing
all symbols. Let us know if this is a helpful behaviour or if you see additional
cases where this could be improved.
Remove Ammonite script support
Some time ago we have asked in discussions in our Github repository about the possibility of removing support for Ammonite scripts. We have not received any overwhelming feedback to keep it, so we have decided to remove it. If you have any concerns or questions about this change, please let us know.
The removal was directly prompted by the fact that there were serious issues with Ammonite support with no users reporting them or anyone from maintainers being aware of them. Which points to the fact that the feature is not widely used.
This will also help to to ease the maintenance burden and to focus more on stability of Metals. Scala Scripts still are and will be supported via Scala CLI, so for anyone using Ammonite we suggest switching to Scala CLI. Scala CLI is the default Scala runner for Scala 3 and we believe it offers overall better experience. If you see any useful Ammonite feature missing from Scala CLI don't hesitate to start a discussion in the Scala CLI repository.
Miscellaneous
- bugfix: Also infer type with complex expressions before method invocation tgodzik
- bugfix: fix
typeDefinition
on backticked identifier harpocrates - bugfix: Fix when types are coming from package objects tgodzik
- bugfix: Infer arg type properly when method uses complex parameters tgodzik
- improvement: convert workspace folder to be a Metals project on chosen commands kasiaMarek
- Fix extracting values for fewer braces majk-p
- bugfix: Regenerate mill BSP config on incorrect version kasiaMarek
- bugfix: Add missing completion in args in generic method with default args harpocrates
- improvement: Add file location also to stacktrace printed to stdout kasiaMarek
- bugfix: Don't propose inaccessible named arg defaults harpocrates
- feature: Support completions inside of backticks harpocrates
- bugfix: Support show decompiled and show tasty for Bazel kasiaMarek
- bugfix: Fix invalid config message when multiple scalafmt files are used with 'include' Sporarum
- bugfix: don't propose inaccessible named arg defaults harpocrates
- bugfix: don't prefix scope completions from supertype harpocrates
- Add function params selection range blaz-kranjc
- bugfix: Don't fail when deleting temporary files tgodzik
- bugfix: Treat self types as parent types in go to implementation context KacperFKorban zainab-ali kasiaMarek
- fix: look for implementations in rename for possibly overridden type aliases kasiaMarek
- improvement: Ask to start http server if not running (tgodzik)
- improve error messages when no main classes can be found cvogt
- fix: go to def should lead to all apply, object and class (Scala 2) kasiaMarek
- improvement: Add jar search command to metals view tgodzik
- fix: generate auto-imports for more pattern completions (harpocrates)
- fix: colliding pattern and scope completions #7295 (harpocrates)
- improvement: add CompileTarget server command cvogt
- bugfix: Try and improve credentials handling when downloading dependencies tgodzik
- Suggest open diagnostics for debug compile errors cvogt
- feat: convert sbt style deps on paste in for scala-cli test.dep scarf005
- bugfix: Fix issues when we would rename more symbols than needed tgodzik
- bugfix: Make sure to choose the best import option in unambiguous cases tgodzik
- improvement: Add scalafix and Scala 3 Presentation Compiler to DownloadDependencies tgodzik
Contributors
Big thanks to everybody who contributed to this release or reported an issue!
$ git shortlog -sn --no-merges v1.5.1..v1.5.2
38 Tomasz Godzik
24 Scalameta Bot
16 scalameta-bot
10 kasiaMarek
7 dependabot[bot]
6 Alec Theriault
5 Blaz Kranjc
4 tgodzik
3 Christopher Vogt
3 Katarzyna Marek
2 Chris Birchall
1 Francesco Nero
1 Kacper Korban
1 Lorenzo Gabriele
1 Quentin Bernet
1 Seth Tisue
1 scarf
Merged PRs
v1.5.2 (2025-03-18)
Merged pull requests:
- bugfix: Make sure to choose the best import option #7285 (tgodzik)
- improvement: Add scalafix and Scala 3 PC to DownloadDependencies #7332 (tgodzik)
- bugfix: Fix issues when we would rename more symbols #7334 (tgodzik)
- improvement: Retry downloading dependencies using a local coursier #7330 (tgodzik)
- improvement: Forward all LSP data from BSP #7294 (tgodzik)
- build(deps): Update flyway-core from 11.4.0 to 11.4.1 #7335 (scalameta-bot)
- feat: convert sbt style deps on paste in for scala-cli test.dep #7333 (scarf005)
- build(deps): Update guava from 33.4.0-jre to 33.4.5-jre #7324 (scalameta-bot)
- Suggest open diagnostics for debug compile errors #7321 (cvogt)
- improvement: Log when setting credentials #7329 (tgodzik)
- improvement: Don't crash the server if failed to download java semanticdb #7328 (tgodzik)
- build(deps): Update sbt, scripted-plugin from 1.10.10 to 1.10.11 #7326 (scalameta-bot)
- build(deps): Update cli_3, scala-cli-bsp from 1.7.0 to 1.7.1 #7327 (scalameta-bot)
- bugfix: Add credentials automatically for coursier API #7314 (tgodzik)
- build(deps): Update mill-contrib-testng from 0.12.8 to 0.12.9 #7325 (scalameta-bot)
- chore: Update Bloop to 2.0.9 #7322 (tgodzik)
- improvement: add CompileTarget server command #7315 (cvogt)
- chore: Change doctor to log less relevant data on debug #7318 (tgodzik)
- chore: Bump mdoc to 2.6.5 #7313 (tgodzik)
- refactor: Remove Ammonite to reduce maintenance burden #7309 (tgodzik)
- build(deps): Update flyway-core from 11.3.4 to 11.4.0 #7305 (scalameta-bot)
- build(deps): bump @babel/helpers from 7.24.7 to 7.26.10 in /website #7298 (dependabot[bot])
- build(deps): bump @babel/runtime-corejs3 from 7.26.0 to 7.26.10 in /website #7299 (dependabot[bot])
- build(deps): Update sbt-ci-release from 1.9.2 to 1.9.3 #7303 (scalameta-bot)
- build(deps): Update protobuf-java from 4.30.0 to 4.30.1 #7304 (scalameta-bot)
- build(deps): Update scalafmt-core from 3.9.3 to 3.9.4 #7306 (scalameta-bot)
- build(deps): bump @babel/runtime from 7.18.6 to 7.26.10 in /website #7300 (dependabot[bot])
- Upgrade maven-wrapper and maven #7308 (cb372)
- build(deps): Update scalameta, semanticdb-metap, ... from 4.13.3 to 4.13.4 #7307 (scalameta-bot)
- fix: colliding pattern and scope completions #7295 (harpocrates)
- fix: generate auto-imports for more pattern completions #7292 (harpocrates)
- build(deps): bump prismjs from 1.29.0 to 1.30.0 in /website #7290 (dependabot[bot])
- improvement: Add search command to metals view #7283 (tgodzik)
- fix: go to def should lead to all apply, object and class (Scala 2) #7275 (kasiaMarek)
- build(deps): Update cli_3, scala-cli-bsp from 1.6.2 to 1.7.0 #7289 (scalameta-bot)
- build(deps): Update scalameta, semanticdb-metap, ... from 4.13.2 to 4.13.3 #7288 (scalameta-bot)
- build(deps): Update scala3-library from 3.6.3 to 3.6.4 #7287 (scalameta-bot)
- build(deps): Update jsoup from 1.18.3 to 1.19.1 #7280 (scalameta-bot)
- improve error messages when no main classes can be found #7284 (cvogt)
- build(deps): Update sbt, scripted-plugin from 1.10.7 to 1.10.10 #7281 (scalameta-bot)
- build(deps): Update protobuf-java from 4.29.3 to 4.30.0 #7278 (scalameta-bot)
- improvement: Only show symbol import if static method exists #7272 (tgodzik)
- build(deps): Update scalafmt-core from 3.9.2 to 3.9.3 #7282 (scalameta-bot)
- build(deps): Update semanticdb-java from 0.10.3 to 0.10.4 #7279 (scalameta-bot)
- improvement: Don't log noop compilation on info #7271 (tgodzik)
- tests: Add Scala 3 tests that use symbol search #7269 (tgodzik)
- build(deps-dev): bump @types/node from 22.13.0 to 22.13.8 in /website #7257 (dependabot[bot])
- build(deps): bump @easyops-cn/docusaurus-search-local from 0.46.1 to 0.48.5 in /website #7258 (dependabot[bot])
- bugfix: fix Scala 2 NPE in implicit inlay hints #7260 (francesconero)
- build(deps): Update scalafmt-core from 3.9.1 to 3.9.2 #7261 (scalameta-bot)
- improvement: Ask to start http server if not running #7083 (tgodzik)
- build(deps): Update flyway-core from 11.3.3 to 11.3.4 #7255 (scalameta-bot)
- build(deps): Update scala-debug-adapter from 4.2.3 to 4.2.4 #7254 (scalameta-bot)
- fix: look for implementations in rename for possibly overridden type aliases #7253 (kasiaMarek)
- Treat self types as parent types in go to implementation context #7170 (KacperFKorban)
- chore: deprecate 3.3.1 and 3.3.3; delete Scala 3 pc #7243 (kasiaMarek)
- feat: add test cases discovery for TestNG #7200 (kasiaMarek)
- improvement: when logging error report creation use
warning
instead ofsevere
#7249 (kasiaMarek) - bugfix: Don't fail when deleting temporary files #7245 (tgodzik)
- Add function parms selection range #7233 (blaz-kranjc)
- build(deps): Update scalameta, semanticdb-metap, ... from 4.13.1.1 to 4.13.2 #7242 (scalameta-bot)
- build(deps): Update scalafmt-core from 3.8.6 to 3.9.1 #7241 (scalameta-bot)
- build(deps): Update sbt-scalafix, scalafix-interfaces from 0.14.0 to 0.14.2 #7235 (scalameta-bot)
- build(deps): Update munit from 1.0.4 to 1.1.0 #7151 (scalameta-bot)
- build(deps): Update flyway-core from 11.3.2 to 11.3.3 #7237 (scalameta-bot)
- build(deps): Update cli_3, scala-cli-bsp from 1.6.1 to 1.6.2 #7238 (scalameta-bot)
- bugfix: Fix invalid config message when multiple files are used #7232 (Sporarum)
- Add Michał to contributors #7230 (tgodzik)
- docs: Add information about how to debug Scala Native #7220 (tgodzik)
- build(deps): Update scalameta, semanticdb-metap, ... from 4.12.7 to 4.13.1.1 #7225 (scalameta-bot)
- test: add compat for completions for Scala 2.13.17 #7226 (kasiaMarek)
- bugfix: Revert go to definition order for older scala version #7210 (tgodzik)
- build(deps): Update flyway-core from 11.3.1 to 11.3.2 #7223 (scalameta-bot)
- build(deps): Update mill-contrib-testng from 0.12.7 to 0.12.8 #7221 (scalameta-bot)
- build(deps): Update os-lib from 0.11.3 to 0.11.4 #7222 (scalameta-bot)
- build(deps): Update interface from 1.0.27 to 1.0.28 #7205 (scalameta-bot)
- build(deps): Update github-api from 1.326 to 1.327 #7213 (scalameta-bot)
- build(deps): Update mdoc-interfaces from 2.6.3 to 2.6.4 #7214 (scalameta-bot)
- build(deps): Update bloop-config from 2.3.1 to 2.3.2 #7212 (scalameta-bot)
- chore: Remove CI from mergify that doesn't exist #7217 (tgodzik)
- build(deps): Update metaconfig-core from 0.14.0 to 0.15.0 #7215 (scalameta-bot)
- fix: suport show decompiled and show tasty for Bazel (build target cl… #7206 (kasiaMarek)
- build(deps): bump serialize-javascript from 6.0.0 to 6.0.2 in /website #7207 (dependabot[bot])
- feature: completions inside of backticks #7204 (harpocrates)
- feature: Add location for the test failure #7195 (tgodzik)
- bugfix: Calculate indent and insert position before retrying infering… #7203 (tgodzik)
- chore: Check name when renaming #7199 (tgodzik)
- improvement: deduplicate compile requests #7006 (kasiaMarek)
- bugfix: don't prefix scope completions from supertype #7201 (harpocrates)
- bugfix: don't propose inaccessible named arg defaults #7202 (harpocrates)
- chore: Test Metals on JDK 21 #7163 (tgodzik)
- chore: Update mergify to use newest jobs #7198 (tgodzik)
- build(deps): Update flyway-core from 11.3.0 to 11.3.1 #7197 (scalameta-bot)
- improvement: improve definition reports #7192 (kasiaMarek)
- Special handling for Mill paths in ScalaVersionSelector #7193 (lolgab)
- chore: Retry BreakpointScalaCliDapSuite #7173 (tgodzik)
- chore: Fix issue with flakiness properly #7194 (tgodzik)
- support testing on Scala 2 PR validation snapshots #7190 (SethTisue)
- improvement: add file location also to stacktrace printed to stdout #7174 (kasiaMarek)
- bugfix: Don't fail on broken pipe #7189 (tgodzik)
- bugfix: Filter out cache directories containing null #7175 (tgodzik)
- bugfix: completion in args in generic method w/ default args #7182 (harpocrates)
- fix: don't change focused file on
didOpen
if client is adidFocusProvider
#7145 (kasiaMarek) - fix: regenerate mill on incorrect version #7171 (kasiaMarek)
- build(deps): Update mdoc-interfaces from 2.6.2 to 2.6.3 #7186 (scalameta-bot)
- build(deps): Update org.eclipse.lsp4j, ... from 0.23.1 to 0.24.0 #7185 (scalameta-bot)
- build(deps): Update mill-contrib-testng from 0.12.5 to 0.12.7 #7184 (scalameta-bot)
- chore: Bump all docusaurus deps #7183 (tgodzik)
- build(deps-dev): bump @types/node from 22.10.3 to 22.13.0 in /website #7178 (dependabot[bot])
- Convert sbt style deps on paste in for scala-cli #7176 (majk-p)
- build(deps): bump @docusaurus/plugin-client-redirects from 3.6.3 to 3.7.0 in /website #7181 (dependabot[bot])
- chore: Don't fail supported tests in case of sonatype issues #7172 (tgodzik)
- improvement: convert workspace folder to be a Metals project on chosen commands #7135 (kasiaMarek)
- build(deps): Update flyway-core from 11.2.0 to 11.3.0 #7167 (scalameta-bot)
- bugfix: Fix cross tests #7165 (tgodzik)
- bugfix: Infer arg type properly when complex #7158 (tgodzik)
- bugfix: Fix when types are coming from package objects #7162 (tgodzik)
- bugfix: Properly print method type #7160 (tgodzik)
- bugfix: fix
typeDefinition
on backticked identifier #7119 (harpocrates) - docs: Adjust documentation to make it clearer on how to use snapshots #7103 (tgodzik)
- bugfix: Also infer type with complex expressions before #7159 (tgodzik)
- Fix extracting values for fewer braces #7164 (majk-p)
- build(deps): Update scala3-library from 3.3.4 to 3.3.5 #7169 (scalameta-bot)
- chore: Bump scalameta to 4.12.5 #7114 (tgodzik)
- docs: release notes for 1.5.1 #7156 (kasiaMarek)