Metals v1.2.0 - Bismuth
We're happy to announce the release of Metals v1.2.0, which continues to improve reporting mechanisms and reached full feature parity between Scala 2 and 3. This means that most new releases will focus on stability instead of adding new features, unless those features contribute to making Metals more reliable.
Commits since last release | 149 |
Merged PRs | 115 |
Contributors | 14 |
Closed issues | 41 |
New features | 5 |
For full details: https://github.com/scalameta/metals/milestone/62?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.
TL;DR
Check out https://scalameta.org/metals/, and give Metals a try!
- Use presentation compiler for synthetic decorations
- Base Metals view on indexing information
- Go to definition for scaladoc
- Custom project root setting
- Bsp errors in status
- Add back unintentionally removed support for 2.11.x
- Changes for plugin authors
Use presentation compiler for synthetic decorations
Up until this release Metals would use the semanticdb information for displaying synthetic decorations such as inferred types or implicit conversions. This was not ideal as it meant that the information was not always up to date and could be inconsistent with the current state of code.
To fix that jkciesluk switched to using the presentation compiler for this information. This means that each time code changes the decorations will be refreshed. This also added a number of new decorations that were not previously available for Scala 3 and it will be on par with the Scala 2 ones.
This also makes the decorations show proper names in case of name conflicts. So for example if you have two classes with the same name within a single scope, they will have a proper prefix shown to help differentiate it.
Base Metals view on indexing information
Metals tree view enables users to navigate their workspace in a more structured way by directly showing the build modules and their packages, classes, objects etc. It would also allow users to navigate their dependency jars. Previously, this was based on special Scala 2 signature information, which means it wouldn't work in Scala 3.
From this release we changed it to use the same information that is used for indexing in case of jars and semanticdb for local workspace files. This means that Scala 3 is fully supported and this has been the last big feature missing for full parity between Scala 2 and 3.
All the existing features should now work for Scala 3 as well. This includes the reveal command which allows to quickly reveal the current file in the tree view including inside jars.
Additionally, we improved icons used by the tree view. They will now use the default VS Code icons for the most part, which should make them more consistent with the rest of the editor.
Go to definition for scaladoc
When writing scaladoc for your methods or classes you can use links, which are
of a form [[name.name.ClassName]]
. Thanks to
kasiaMarek Metals will now allow you to
navigate to the target of the link via normal go to definition.
To learn more about linking in scaladoc check out the Scala documentation
Custom project root setting
Metals currently will try to find the proper build tool root for your project, which is useful especially if you open a parent directory that doesn't contain a build tool configuration. However, this can be problematic if you have a less traditional setup and you need to be able to control the root directory. For example if you have an sbt source dependency and you still want to have that dependency open in the same window.
To help with that we added a new setting metals.customProjectRoot
that allows
you to specify the root directory for your project. This setting is available in
the settings UI and can be set to a path relative to the workspace root.
Another amazing feature from kasiaMarek
Bsp errors in status
In the previous release Metals started showing more errors from the build server with the intention on making it clearer to the user what is going on. However, showing a message request for the user could be quite invasive and not always relevant.
To help with that kasiaMarek added a new status bar item that will show the number of errors in the build server. This will be shown only if there are any errors and will be hidden once the reports connected to them are removed.
Add back unintentionally removed support for 2.11.x
For the most of the releases Scala 2.11.12 support was not being actively tested, which led to some of the features not working properly. This release brings back the support for 2.11.12 and adds a CI job to make sure it is working properly. The support is still on the best effort basis, so we highly recommend to migrate to newer versions of Scala, which feature numerous bugfixes and security fixes.
It's highly possible that we will stop supporting new features for 2.11.x in the near future, but it seems for the time being there is still a number of contributors that require it.
Changes for plugin authors
Tree view icons changed and use a number of default VS Code ones. If previously icons were show in other editors, this change could cause them to stop being shown properly. Full list of icon names can be found here.
Another change is the addition of the custom project root setting
metals.customProjectRoot
, which should be accounted for in the user facing
editor interface.
Contributors
Big thanks to everybody who contributed to this release or reported an issue!
$ git shortlog -sn --no-merges v1.1.0..v1.2.0
43 Tomasz Godzik
30 Jakub Ciesluk
29 Katarzyna Marek
26 Scalameta Bot
7 Jędrzej Rochala
3 dependabot[bot]
2 Chris Kipp
2 Karan Ahlawat
2 Lucas Nouguier
1 Arthur McGibbon
1 Jamie Thompson
1 Lorenzo Gabriele
1 Seth Tisue
1 naferx
Miscellaneous
This Metals version includes a large number of fixes and improvements and a lot of them could improve your experience significantly. We highly recommend looking at the list below to see what changed. Please remember that you can always reach out to us and we will will try to fix any issues you might have.
- improvement: Only re-index workspace on onBuildTargetChanged instead of reconnecting. tgodzik
- [Scala 2] bugfix: Remove custom metals types that could break more complicated completions. tgodzik
- bugfix: Don't show semanticdb warning when using Mill BSP. lolgab
- bugfix: Add multiline comment completion. kasiaMarek
- bugfix: Choose correct workspace folder for jars and build target files. kasiaMarek
- bugfix: Fix SymbolNotFound regex used for suggesting import symbol code action. KaranAhlawat
- improvement: show correct bsp status for focused workspace folder. kasiaMarek
- [Scala 2] bugfix: workaround for printing Tuple1 kasiaMarek
- bugfix: Use platform Java from BSP instead of default used by metals tgodzik
- improvement: recompile focused file if depends on last compiled build target kasiaMarek
- bugfix: Properly backtick named arguments if needed. jkciesluk
- bugfix: report compile progress when using sbt BSP. bishabosha
- bugfix: Fix document highlight on named arguments jkciesluk
- improvement: Try to use Scala CLI's scalafmt config if it exists. tgodzik
- [Scala 3] improvement: Completions should prepend instead of replace to match Scala 2 behaviour. rochala
- bugfix: Properly show case completions for tuple type. jkciesluk
- [SCala 3] bugfix: Rename end marker for local definitions. kasiaMarek
- [Scala 3] bugfix: Completions for named args in wrong order jkciesluk
- bugfix: Add output classes directory to classpath for PC to help with Mill BSP issues. jkciesluk
- bugfix: Show build target information for mill-build. #5816 (jkciesluk)
- improvement: Forward debug errors properly to the user editor. tgodzik
- improvement: Color vals of module type as classes jkciesluk
- [Scala 2] bugfix: Fix document highlight on anonymous function parameters in #5876 (jkciesluk)
- [Scala 2] bugfix: hover for select chains ending with function kasiaMarek
- bugfix: Adjust auto import position for shebang jkciesluk
- [Scala 2] bugfix: Fix inconsistent highlight on class constructor jkciesluk
- improvement: add semantic tokens for escape sequences kasiaMarek
- [Scala 3] Extract member action for opaque type kasiaMarek
- bugfix: Fix go to definition for extension methods in the same scope kasiaMarek
- bugfix: Don't add import for extension if there is a same named value in scope jkciesluk
Merged PRs
v1.2.0 (2023-12-11)
Merged pull requests:
- bugfix: fix workaround for wrong spans in extension method call #5927 (kasiaMarek)
- bugfix: Extension method completion with name conflict #5913 (jkciesluk)
- bugfix: Document highlight on generic class init in scala 3 #5878 (jkciesluk)
- chore: adjust completions tests for value forwarders #5912 (jkciesluk)
- chore: Ignore docs suite on Scala 2 nightlies #5924 (tgodzik)
- Extract member action for opaque type #5889 (kasiaMarek)
- build(deps): Update scribe, scribe-file, scribe-slf4j from 3.12.2 to 3.13.0 #5925 (scalameta-bot)
- build(deps): Update semanticdb-java from 0.9.7 to 0.9.8 #5926 (scalameta-bot)
- chore: Update Bloop to 1.5.13 #5865 (tgodzik)
- improvement: base64-encode bloop error ids #5920 (kasiaMarek)
- chore: automatically close issues needs more info issues after 30 days #5919 (kasiaMarek)
- Revert creating .scala-build in temporary directory #5918 (tgodzik)
- chore: Add test to close issue 2555 #5914 (jkciesluk)
- build(deps): Update scala-debug-adapter from 3.1.4 to 3.1.5 #5896 (scalameta-bot)
- improvement: add semantic tokens for escape sequences #5915 (kasiaMarek)
- bugfix: Inconsistent highlight on class constructor #5909 (jkciesluk)
- improvement: Don't publish diagnostics for dependencies #5910 (tgodzik)
- bugfix: don't show implicit conversions for synthetics #5911 (kasiaMarek)
- build(deps): Update cli_3, scala-cli-bsp from 1.0.6 to 1.1.0 #5898 (scalameta-bot)
- improvement: Check if Scala file exists before calculating md5 #5908 (jkciesluk)
- bugfix: Adjust auto import position for shebang #5860 (jkciesluk)
- chore: Update website dependencies #5906 (tgodzik)
- build(deps): Update jsoup from 1.16.2 to 1.17.1 #5897 (scalameta-bot)
- build(deps): bump actions/setup-java from 3 to 4 #5899 (dependabot[bot])
- bugfix: don't show inferred type for val def bind #5891 (kasiaMarek)
- bugfix: hover for select chains ending with function Scala 2 #5883 (kasiaMarek)
- bugfix: Fix some of the tests in the nightly CI #5886 (tgodzik)
- Worksheets documentation imprecision #5888 (iusildra)
- build(deps): Update ammonite-util from 3.0.0-M0-59-cdeaa580 to 3.0.0-M0-60-89836cd8 #5879 (scalameta-bot)
- fix: workaround for wrong span in hover scala 3.3.1 #5882 (kasiaMarek)
- align pc constructor with PC constructor #5826 (rochala)
- bugfix: Fix tests for new file provider due to changed template #5880 (tgodzik)
- bugfix: Document highlight on anon-fun parameters in Scala 2 #5876 (jkciesluk)
- bugfix: Remove incorrect synthetic decorations in partial functions #5875 (jkciesluk)
- build(deps): Update semanticdb-java from 0.9.6 to 0.9.7 #5872 (scalameta-bot)
- build(deps): Update mill-contrib-testng from 0.11.5 to 0.11.6 #5871 (scalameta-bot)
- build(deps): Update coursier from 2.1.7 to 2.1.8 #5873 (scalameta-bot)
- improvement: create
scala-cli
.scala-build
in a tmp directory #5822 (kasiaMarek) - improvement: Color vals of module type as classes #5862 (jkciesluk)
- bugfix: Don't search for symbol occurrence with empty position #5867 (tgodzik)
- improvement: Forward DAP errors properly to the client #5864 (tgodzik)
- improvement: Add debug information when no references are shown #5852 (tgodzik)
- Bsp errors in status #5726 (kasiaMarek)
- bugfix: Fix PcCollector for Scala 2 in anon-fun parameters #5841 (jkciesluk)
- bugfix: Remove synthetic decorations for script wrapper #5861 (jkciesluk)
- build(deps): Update scalameta, semanticdb-scalac, ... from 4.8.13 to 4.8.14 #5859 (scalameta-bot)
- build(deps): Update ammonite-util from 3.0.0-M0-58-9ccdff7c to 3.0.0-M0-59-cdeaa580 #5857 (scalameta-bot)
- build(deps): Update mdoc, mdoc-interfaces, sbt-mdoc from 2.4.0 to 2.5.0 #5823 (scalameta-bot)
- build(deps): Update scalafmt-core, scalafmt-dynamic from 3.7.15 to 3.7.17 #5849 (scalameta-bot)
- build(deps): Update cli_3, scala-cli-bsp from 1.0.4 to 1.0.5 #5795 (scalameta-bot)
- chore: remove leftover distinct #5850 (jkciesluk)
- build(deps): Update protobuf-java from 3.25.0 to 3.25.1 #5846 (scalameta-bot)
- build(deps): Update sbt-welcome from 0.3.2 to 0.4.0 #5845 (scalameta-bot)
- chore: Fix decoration test for sbt #5851 (jkciesluk)
- build(deps): Update ammonite-util from 3.0.0-M0-56-1bcbe7f6 to 3.0.0-M0-58-9ccdff7c #5847 (scalameta-bot)
- improvement: Set icons properly for all parts of tree view #5827 (tgodzik)
- bugfix: Don't show synthetics if not an inline decorations provider #5844 (tgodzik)
- chore: run scalafmt after merging PC-Decorations #5842 (jkciesluk)
- Handle missing bsp info better #5813 (Arthurm1)
- improvement: Use PC for synthetic decorations #5585 (jkciesluk)
- bugfix: Fix formatting after merge #5838 (tgodzik)
- chore: Bring back cross tests for Scala 2.11 #5825 (jkciesluk)
- bugfix: BuildTargetInfo for mill-build #5816 (jkciesluk)
- build(deps): Update scalameta, semanticdb-scalac, ... from 4.8.12 to 4.8.13 #5832 (scalameta-bot)
- bugfix: Add output classes directory to classpath for PC #5814 (jkciesluk)
- bugfix: Completions for named args in wrong order #5728 (jkciesluk)
- fix: pc wrapper for dotty nightly #5821 (kasiaMarek)
- feature: Add benchmarks for some of the presentation compiler features #5818 (tgodzik)
- improvement: Base Metals view on indexing information #5622 (tgodzik)
- bugfix: rename end marker for local definitions #5803 (kasiaMarek)
- test: fix hover doc suite for jdk22 #5817 (kasiaMarek)
- build(deps): Update protobuf-java from 3.24.4 to 3.25.0 #5810 (scalameta-bot)
- build(deps): bump @docusaurus/core from 2.4.3 to 3.0.0 in /website #5805 (dependabot[bot])
- Change method to work with explicit nulls #5802 (rochala)
- chore: Minor refactor to help with edge cases in BSP #5812 (tgodzik)
- build(deps): Update gradle-bloop from 1.6.1 to 1.6.2 #5809 (scalameta-bot)
- bugfix: Case completions for tuple type #5292 (jkciesluk)
- Completions should prepend instead of replace to match Scala 2 behaviour #5808 (rochala)
- chore: fix ci tests for 2.13.13 #5799 (kasiaMarek)
- build(deps): bump @docusaurus/plugin-client-redirects from 2.4.3 to 3.0.0 in /website #5804 (dependabot[bot])
- remove some lingering Bintray references #5798 (SethTisue)
- improvement: Try to use scala CLI format if it exists #5559 (tgodzik)
- build(deps): Update mdoc, mdoc-interfaces, sbt-mdoc from 2.3.8 to 2.4.0 #5793 (scalameta-bot)
- build(deps): Update scalafmt-core, scalafmt-dynamic from 3.7.14 to 3.7.15 #5794 (scalameta-bot)
- build(deps): Update xnio-nio from 3.8.11.Final to 3.8.12.Final #5792 (scalameta-bot)
- remove duplicated word #5790 (naferx)
- feature: add go to definition for scaladoc #5730 (kasiaMarek)
- bugfix: Remove old semanticdb files when not needed #5789 (tgodzik)
- bugfix: Document highlight on named arguments #5782 (jkciesluk)
- build(deps): Update mdoc, mdoc-interfaces, sbt-mdoc from 2.3.7 to 2.3.8 #5744 (scalameta-bot)
- report sbt's build progress #5788 (bishabosha)
- bugfix: Backticked named arguments #5725 (jkciesluk)
- improvement: recompile focused file if depends on last compiled bt #5785 (kasiaMarek)
- bugfix: Use platform Java from BSP instead of metals one #5781 (tgodzik)
- refactor: Use default concurrency queue #5787 (tgodzik)
- docs: add in schema for the new
errorReports
field in Doctor #5786 (ckipp01) - bugfix: Take into account JVM_OPTS and SBT_OPTS env variables #5784 (tgodzik)
- feat: custom project root setting #5769 (kasiaMarek)
- improvement: make new file independent of workspace root #5752 (kasiaMarek)
- improvement: show correct bsp status for focused workspace folder #5772 (kasiaMarek)
- fix: workaround for printing Tuple1 #5778 (kasiaMarek)
- refactor: differentiate between files and directories in sources #5767 (ckipp01)
- build(deps): Update sbt, scripted-plugin from 1.9.6 to 1.9.7 #5777 (scalameta-bot)
- bugfix: Add back unintentionally removed support for 2.11.x #5770 (tgodzik)
- build(deps): Update jsoup from 1.16.1 to 1.16.2 #5776 (scalameta-bot)
- bugfix: move bsp config for detected project root #5768 (kasiaMarek)
- bugfix: fix SymbolNotFound regex #5771 (KaranAhlawat)
- bugfix: choose correct workspace folder for jars and build target files #5764 (kasiaMarek)
- bugfix: add multiline comment completion #5739 (kasiaMarek)
- Skip sourceroot and targetroot for in JavaTarget when semanticDbEnabl… #5762 (lolgab)
- fix: don't throw on reset build server when the same option reselected #5766 (kasiaMarek)
- bugfix: Remove PrettyType which might often fail in the compiler #5763 (tgodzik)
- bugfix: Future filter error during connecting to build server #5765 (jkciesluk)
- improvement: Only reindex workspace on onBuildTargetChanged #5737 (tgodzik)
- Add release notes v1.1.0 #5738 (kasiaMarek)