Metals v1.2.1 - Bismuth
We're happy to announce the release of Metals v1.2.1, which brings an array of bugfixes and adds initial support for Bazel as a build tool.
Commits since last release | 123 |
Merged PRs | 99 |
Contributors | 14 |
Closed issues | 52 |
New features | 4 |
For full details: https://github.com/scalameta/metals/milestone/63?closed=1
Metals is a language server for Scala that works with VS Code, Vim, Emacs and Sublime Text. Metals is developed at the Scala Center and VirtusLab with the help from contributors from the community.
Help us make Metals even better by informing us on any issues or missing features. It's as simple as creating a π bug report or a π feature request in the Metals GitHub repository.
TL;DRβ
Check out https://scalameta.org/metals/, and give Metals a try!
- Bazel support
- Run for Native and JS platforms
- Metals view for uncompiled changes
- LSP Progress support
Bazel supportβ
This release brings support for using Bazel as a build tool with many features like completions and go-to-definition
working out of the box. To have the features working also for dependencies, make sure to enable fetch_sources
for library dependencies in Bazel definition.
The initial work on Bazel support was started by kpodsiad, continued on by tanishiking, and finally brought to completion by jkciesluk, with tgodzik contributing additional improvements to the area.
Completions in a Bazel project.
Hover and go to definition in a Bazel project.
You can get the slightly more advanced features working by enabling SemanticDB in your project. Simply add the following content to your build:
-
in your
BUILD
file:load("@io_bazel_rules_scala//scala:scala_toolchain.bzl", "scala_toolchain")
scala_toolchain(
name = "semanticdb_toolchain_impl",
enable_semanticdb = True,
semanticdb_bundle_in_jar = False,
visibility = ["//visibility:public"],
)
toolchain(
name = "semanticdb_toolchain",
toolchain = "semanticdb_toolchain_impl",
toolchain_type = "@io_bazel_rules_scala//scala:toolchain_type",
visibility = ["//visibility:public"],
) -
and in your
WORKSPACE
file:register_toolchains(
"//:semanticdb_toolchain",
)
Adding SemanticDB to a Bazel project.
Enabling SemanticDB in your Bazel project will allow you to use such features as go to references.
Go to references in a Bazel project.
You can read more about Metals current support for Bazel and setting it up in documentation. Our Bazel support is still in the early stages but we'd love to get your feedback!
Run for Native and JS platformsβ
Thanks to tgodzik, starting with this release you can run your code using native
and js
platforms straight from the editor. Just click on the run
code lens or trigger debug run in any other way appropriate for your editor of choice.
Running a Scala Native program using code lenses.
Metals view for uncompiled changesβ
In the previous release, metals view was enhanced and brought to Scala 3. You can read more about that here. The feature was further improved by tgodzik, and now the information about workspace symbols is updated as you write, instead of on compile as before.
Tree view updating while typing.
LSP Progress supportβ
For clients that do not support metals status, slow tasks notifications can now also be available via LSP Progress thanks to work done by keirlawson.
Miscellaneousβ
This release brings also many bug fixes and improvements. Check them out to know what has changed.
- [Scala 3] bugfix: Don't show workspace completions for implicit classes members. jkciesluk
- bugfix: Pass proxy information to g8. kasiaMarek
- bugfix: Fix go to definition for nested java jars. kasiaMarek
- [Scala 3] improvement: Better labels for workspace methods completions. jkciesluk
- improvement: Discover sbt in path before fallbacking to launcher. kasiaMarek
- improvement: Only save scala or java fingerprints. tgodzik
- bugfix: Offer auto-import for new classes created via file provider. kasiaMarek
- improvement: Add support for tests using weaver cats effects. kasiaMarek
- bugfix: Show
run
/debug
code lenses when file contains shebang header. kasiaMarek - bugfix: Make debug completions independent of the order of stackTrace being requested. mekpavit
- bugfix: Fix go to definition for toplevel definitions in files with
.
in the name. kasiaMarek - improvement: Add
case
keyword completion. jkciesluk - bugfix: Don't tokenize if the source hasn't changed. tgodzik
- bugfix: Handle missing line argument in debug completion request. mekpavit
- feature: Cancel worksheet evaluations when canceling compilation. ckipp01
- feature: Show import renames in hover. kasiaMarek
- [Scala 2] bugfix: Document highlight in self type. jkciesluk
- improvement: Remove semantic tokens fallback. jkciesluk
- bugfix: Handle missing jar file in SetBreakpointRequest. adpi2
- bugfix: Don't show default argument values if type is Any. tgodzik
- [Scala 3] bugfix: Don't show givens as completions from classpath search. kasiaMarek
- [Scala 3] bugfix: Don't show scope completions inside multi-imports. kasiaMarek
- improvement: Show workspace completions for short queries. kasiaMarek
- improvement: Add atomic update on TrieMap. jkciesluk
- bugfix: Fix StacktraceAnalyser in case of empty package. tgodzik
- [Scala 3] bugfix: Wrong span in extension methods in context functions. jkciesluk
- bugfix: Fix searching for implementations of an abstract type. tgodzik
- bugfix: Fix java support (hover/completions) for symbols from dependencies. tgodzik
- [Scala 3] improvement: Suggest workspace completions for implicit classes. tgodzik
- bugfix: Extract method with empty lines. kasiaMarek
- feature: Add option to run verbose compilation. tgodzik
- improvement: Fetch missing dependency sources. kasiaMarek
Contributorsβ
Big thanks to everybody who contributed to this release or reported an issue!
$ git shortlog -sn --no-merges v1.2.0..v1.2.1
38 Tomasz Godzik
31 Katarzyna Marek
17 Jakub Ciesluk
10 scalameta-bot
6 rochala
5 Scalameta Bot
5 mekpavit
3 dependabot[bot]
2 Chris Kipp
2 Sakib Hadziavdic
1 Adrien Piquerez
1 Kamil PodsiadΕo
1 Keir Lawson
1 tgodzik
Merged PRsβ
v1.2.1 (2024-02-07)β
Merged pull requests:
- chore: update bazel bsp #6098 (kasiaMarek)
- docs: Add documentation about Bazel #6093 (tgodzik)
- chore: Update Bloop to latest version #6088 (tgodzik)
- build(deps): Update munit from 1.0.0-M10 to 1.0.0-M11 #6087 (scalameta-bot)
- LSP general progress notification support #6055 (keirlawson)
- chore: unignore tests after backport to dotty #6089 (kasiaMarek)
- bugfix: Don't show workspace completions for vals in implicit classes #6074 (jkciesluk)
- bugfix: pass proxy info to g8 #6081 (kasiaMarek)
- bugfix: handle nested java jars #6066 (kasiaMarek)
- build(deps): bump @docusaurus/plugin-client-redirects from 3.0.1 to 3.1.1 in /website #6069 (dependabot[bot])
- chore: Mark scala CLI script test as flaky #6084 (tgodzik)
- improvement: Better labels for workspace methods completions #6075 (jkciesluk)
- build(deps): Update semanticdb-java from 0.9.8 to 0.9.9 #6086 (scalameta-bot)
- Fix CI for latest nightly #6085 (rochala)
- chore: Add support for the next Scala 3.3.2-RC3 #6072 (tgodzik)
- build(deps): Update qdox from 2.0.3 to 2.1.0 #6077 (scalameta-bot)
- bugfix: Extension completions in interpolated strings #6073 (jkciesluk)
- improvement: discover sbt in path #6065 (kasiaMarek)
- bugfix: Document highlight on extension methods with implicit arguments #6060 (jkciesluk)
- improvement: Only save scala or java fingerprints #6063 (tgodzik)
- bugfix: perform on create action for new files created via file provider #6061 (kasiaMarek)
- improvement: add support for weaver cats effects #6062 (kasiaMarek)
- don't always trigger compilation on
didOpen
#6044 (kasiaMarek) - improvement: Don't require compilation for semanticdb #6050 (tgodzik)
- bugfix: Add enabled-rules to make sure Scala is always detected #6057 (tgodzik)
- bugfix: show code lenses when shebang for Scala 2 #6045 (kasiaMarek)
- improvement: Change BSP ping message to empty buildtarget/compile #6058 (jkciesluk)
- bugfix: Fix the scaalfix job #6059 (tgodzik)
- correctly backtick toplevel source object when needed in mtags #6056 (kasiaMarek)
- build(deps): Update scala-debug-adapter from 3.1.5 to 3.1.6 #6047 (scalameta-bot)
- feature: Initial support for SemanticDB in bazel projects #6022 (jkciesluk)
- build(deps): Update bsp4j from 2.1.0-M7 to 2.1.1 #6046 (scalameta-bot)
- improvement: Add
case
keyword completion #5346 (jkciesluk) - chore: test changes for upcoming changes in nightly #6035 (rochala)
- bugfix: Show non jvm lenses even if client is not a run provider #6025 (tgodzik)
- bugfix: show code lenses when shebang #6039 (kasiaMarek)
- improvement: Generate semanticdb if not found #6036 (tgodzik)
- improvement: Don't use GlobalSymbolIndex #5962 (tgodzik)
- bugfix: debug-completion depends on order of stackTrace being requested #6037 (mekpavit)
- build(deps): Update cli_3, scala-cli-bsp from 1.1.1 to 1.1.2 #6032 (scalameta-bot)
- bugfix: Fix displaying doctor information using bazel #6028 (tgodzik)
- bugfix: Match on executable name in GenerateBspConfig #6023 (jkciesluk)
- chore: Adjust bazel tests #6021 (jkciesluk)
- bugfix: Don't tokenize if the source hasn't changed #6020 (tgodzik)
- feature: Support Bazel as a build tool #3233 (kpodsiad)
- chore: Unignore tests after backporting #6015 (tgodzik)
- bugfix: Fix tests after Scala CLI update #6016 (tgodzik)
- bugfix: incorrect debug completion when line is not sent from DAP client #6019 (mekpavit)
- feat: cancel worksheet evaluations when canceling compilation #6013 (ckipp01)
- build(deps): Update cli_3, scala-cli-bsp from 1.1.0 to 1.1.1 #6012 (scalameta-bot)
- build(deps): Update ujson from 3.1.3 to 3.1.4 #6009 (scalameta-bot)
- build(deps): Update protobuf-java from 3.25.1 to 3.25.2 #6008 (scalameta-bot)
- Remove context of path wrapper which caused multiple compiler crashes #6007 (rochala)
- bugfix: show import renames in hover #5982 (kasiaMarek)
- bugfix: Document highlight in self type #6006 (jkciesluk)
- improvement: Remove semantic tokens fallback #5985 (jkciesluk)
- bugfix: handle missing jar file in SetBreakpointRequest #6005 (adpi2)
- bugfix: Don't try to add interpolation completions at a wrong position #6001 (tgodzik)
- bugfix: Don't show default argument values if type is Any #6000 (tgodzik)
- bugfix: don't show given classpath search completions #5995 (kasiaMarek)
- bugfix: don't show scope completions for multi-imports #5994 (kasiaMarek)
- build(deps): Update mdoc, mdoc-interfaces, sbt-mdoc from 2.5.1 to 2.5.2 #6004 (scalameta-bot)
- bugfix: Check instead of throwing AssertionError #5999 (tgodzik)
- bugfix: Don't call tail on an empty list #5998 (tgodzik)
- feature: Add support for running Native and JS #5197 (tgodzik)
- chore: Add more information about classpath and compiler options when severe error happens #5986 (tgodzik)
- improvement: show workspace completions for short queries #5956 (kasiaMarek)
- build(deps): bump actions/stale from 5 to 9 #5990 (dependabot[bot])
- build(deps): bump @easyops-cn/docusaurus-search-local from 0.38.1 to 0.40.1 in /website #5989 (dependabot[bot])
- improvement: add timeout to requests #5452 (kasiaMarek)
- build(deps): Update scalameta, semanticdb-scalac, ... from 4.8.14 to 4.8.15 #5988 (scalameta-bot)
- build(deps): Update jsoup from 1.17.1 to 1.17.2 #5987 (scalameta-bot)
- improvement: Add atomic update on TrieMap #5938 (jkciesluk)
- bugfix: Fix StacktraceAnalyser in case of empty package #5981 (tgodzik)
- bugfix: Use buildServerName instead of executableName in BSP #5957 (jkciesluk)
- bugfix: Wrong span in extension methods in context functions #5979 (jkciesluk)
- chore: Unignore tests after merging to Dotty #5980 (tgodzik)
- bugfix: Don't show all classes when searching for implementations of abstract type #5969 (tgodzik)
- build(deps): Update guava from 32.1.3-jre to 33.0.0-jre #5973 (scalameta-bot)
- bugfix: Fix java support for different files #5964 (tgodzik)
- chore: Remove Pants specific checks #5968 (jkciesluk)
- improvement: Only log if failed to resolve mtags at all #5967 (tgodzik)
- chore: delete remote language server #5963 (kasiaMarek)
- bugfix: Retry check for the latest Metals version #5961 (tgodzik)
- chore: Add missing tests to TestGroups #5960 (tgodzik)
- improvement: Support completions for implicit classes #5904 (tgodzik)
- chore: Add support for Scala 3.3.2-RC1 #5958 (tgodzik)
- Update millw to 0.4.11 #5954 (sake92)
- improvement: add custom bsp as possible build tool #5791 (kasiaMarek)
- improvement: log when invalid
textDocument
uri inbuild/publishDignostics
#5950 (kasiaMarek) - build(deps): Update sbt, scripted-plugin from 1.9.7 to 1.9.8 #5946 (scalameta-bot)
- build(deps): Update sbt-jmh from 0.4.6 to 0.4.7 #5947 (scalameta-bot)
- fix: extract method with empty lines #5949 (kasiaMarek)
- fix: use client commands inside of BSP status #5944 (ckipp01)
- feature: Add option to run verbose compilation #5937 (tgodzik)
- fix: close conn w/ db when checking if should update #5941 (kasiaMarek)
- improvement: fetch missing dependency sources #5819 (kasiaMarek)
- chore: upgrade h2 database #5917 (kasiaMarek)
- chore: Add release notes for Metals 1.1.1 #5929 (tgodzik)