Metals v0.10.6 - Tungsten
We're happy to announce the release of Metals v0.10.6, which brings about new Scala 3 versions and JDK 17 support in addition to some new interesting features.
Commits since last release | 173 |
Merged PRs | 74 |
Contributors | 16 |
Closed issues | 25 |
New features | 4 |
For full details: https://github.com/scalameta/metals/milestone/41?closed=1
Metals is a language server for Scala that works with VS Code, Vim, Emacs, Sublime Text and Eclipse. Metals is developed at the Scala Center and VirtusLab with the help from Lunatech along with contributors from the community.
TL;DR
Check out https://scalameta.org/metals/, and give Metals a try!
- Automatically adjust indentation on paste.
- New code actions.
- Allow organize imports on unsaved code.
- [Scala 3] support for Scala 3.0.2 and 3.1.0-RC1.
- JDK 17 support.
Automatically adjust indentation on paste
Starting with Scala 3 developers can use optional braces, which we mentioned in some of the previous release notes. One of the main problems with it is making sure that users are able to properly paste code into existing blocks. Previously we could just paste into braced blocks and adjusted the indentation later, but now it really matters that indentation is changed properly in order to make to code compile correctly.
To help with that @Giggiux adjusted the existing range formatting to account for indentation in the pasted blocks. Starting from this release Metals will adjust the indentation to match that of the enclosing block irrelevant of whether it has braces or not. A number of improvements has also been done to make sure the cursor ends up on the correct indentation level upon writing a newline.
If you encounter any issues, please don't hesitate to report them since the
functionality is new and there might be some edge cases where it doesn't work.
This was tested internally over the past month, but that doesn't account for all
the different styles of how people write their code. You can turn off on paste
formatting in Visual Studio Code in the settings using the
editor.formatOnPaste
property. This feature will only work with the editors
that support range formatting.
New code actions
This release benefits from adding two new code actions. Actions are based on particular scenarios, where we might automate some mundane coding and their behaviour is usually clearly specified. Please let us know if there are any other particular situations, which might be automated, via the the Metals's feature requests repository.
Refactor pattern match with placeholder
Thanks to kpodsiad it's now possible to
automatically rewrite lambdas with _ match
expressions to partial functions:
Replace () with in functions and vice versa
It's quite often that in Scala we might want to change to a simple lambda to a multiline one or vice versa. This has previously been a manual chore, but now whenever possible you can do it via a code action:
Allow organize imports on unsaved code
In previous version it was only possible to organize imports in files that were saved and compiled. We're happy to report that this requirement has been lifted and users can organize imports whenever needed.
Miscellaneous
- Fix completions for definitions from other files in Ammonite scripts.
- Support for Apple M1 and JDK 17. @dos65
- [Scala 3] Show extension methods in hover.
- Support brackets in multiline strings. @kpodsiad
- Automatically convert $ to $$ when changing to string interpolation.
- Filter out wrong reference results from unrelated build targets. @dos65
- Greatly improved parent code lenses performance and turned it on by default in VS Code. @tanishiking
- Properly show folding ranges in Scala 3 indented blocks. @tpasternak
- Fix comments erasing all later variables in .env file.
- Fix file watcher in large projects on macOS. @pvid
- Fix memory leak issue in Scala 3 projects. @dos65
Contributors
Big thanks to everybody who contributed to this release or reported an issue!
$ git shortlog -sn --no-merges v0.10.5..v0.10.6
Tomasz Godzik
Luigi Frunzio
Vadim Chelyshov
Adrien Piquerez
Chris Kipp
Pavol Vidlicka
Gabriele Petronella
Kamil Podsiadlo
Oliver Schrenk
Ólafur Páll Geirsson
Rikito Taniguchi
Tomasz Pasternak
Merged PRs
v0.10.6 (2021-09-06)
Merged pull requests:
- Fix issue with tmp directory popping up in random places #3105 (tgodzik)
- Ident on paste - bunch of fixes #3080 (dos65)
- s/horizontal/vertical #3102 (oschrenk)
- s/defalt/default #3101 (oschrenk)
- Add support for Scala 3.1.0-RC1 #3100 (tgodzik)
- Add support for Scala 3.0.2 #3095 (tgodzik)
- Update mdoc-interfaces to 2.2.23 #3094 (scala-steward)
- Update munit to 0.7.29 #3088 (scala-steward)
- Update scalafix-interfaces to 0.9.30 #3089 (scala-steward)
- Update jsoup to 1.14.2 #3086 (scala-steward)
- Update file-tree-views to 2.1.7 #3084 (scala-steward)
- Bump olafurpg/setup-scala from 12 to 13 #3090 (dependabot[bot])
- Update mdoc, mdoc-interfaces, sbt-mdoc to 2.2.23 #3087 (scala-steward)
- Update flyway-core to 7.14.0 #3085 (scala-steward)
- Update jackson-databind to 2.12.5 #3083 (scala-steward)
- Update sbt-scalafix, scalafix-interfaces to 0.9.30 #3082 (scala-steward)
- Run tests on JDK 17 #3028 (tgodzik)
- Fix file watcher in large projects on macOS #3021 (pvid)
- Allow organize imports on unsaved code #3055 (tgodzik)
- Update Bloop to the newest nightly #3003 (tgodzik)
- Jar indexing - fix issue with empty jar source #3069 (dos65)
- Fix comments erasing all later variables in .env file #3070 (tgodzik)
- Update next Scala 3 RC version to 3.0.2-RC2 #3065 (tgodzik)
- Add action to replace () with in functions and vice versa #3061 (tgodzik)
- Handle Scala 3 style blocks of code without braces #3058 (tpasternak)
- Add tests explicitly to tests shard #3049 (tgodzik)
- Remove complicated asSeenFrom logic #3047 (tgodzik)
- Add documentation about GitHub Codespaces and GitHub.dev support #3046 (gabro)
- Simplify super method lens using overriddenSymbols #3045 (tanishiking)
- Update scalafmt to 3.0.0-RC7 #3042 (tgodzik)
- [Scala3] Fix memory usage spike on empty completions #3043 (dos65)
- Update sbt-sourcegraph to 0.3.3 #3035 (scala-steward)
- Update scalameta, semanticdb-scalac, ... to 4.4.27 #3041 (scala-steward)
- Update scalafmt-core to 3.0.0-RC7 #3039 (scala-steward)
- Update munit to 0.7.28 #3038 (scala-steward)
- Update flyway-core to 7.13.0 #3037 (scala-steward)
- Update undertow-core to 2.2.10.Final #3036 (scala-steward)
- Alternative version of #2999: Add more tests on using sbt as the build server #3006 (adpi2)
- Update scalameta to 4.4.26 #3027 (tgodzik)
- Fix indentation when pasting part of the line #3025 (tgodzik)
- References - filter out wrong results from unrelated build targets #2980 (dos65)
- Upgrade to the latest sbt-sourcegraph #3022 (olafurpg)
- Merge sourcegraph branch into main. #3017 (ckipp01)
- Make the SemanticDB compiler options used by mtags configurable. #3018 (olafurpg)
- Minimize file rewrites in
.metals/readonly/dependencies
#3004 (dos65) - Automatic refactor - pattern match with placeholder #3002 (kpodsiad)
- Bump coursier/cache-action from 6.2 to 6.3 #3015 (dependabot[bot])
- Update mdoc, sbt-mdoc to 2.2.22 #3013 (scala-steward)
- Update flyway-core to 7.11.4 #3012 (scala-steward)
- Update undertow-core to 2.2.9.Final #3011 (scala-steward)
- Update mill-contrib-testng to 0.9.9 #3010 (scala-steward)
- Automatically convert $ to $$ when changing to string interpolation #2996 (tgodzik)
- Support brackets in multiline strings #2995 (kpodsiad)
- [Scala3] Additional completion pos fix for
Select
tree #2998 (dos65) - Mention new run/test commands in the VS Code editor page #2993 (tgodzik)
- Point to coc.nvim for defaults rather than have them in here. #2988 (ckipp01)
- Include parens on lambda in Scala 3 when inserting type in params with brace. #2989 (ckipp01)
- Correctly paste extension groups #2987 (tgodzik)
- [Scala 3] Support extension methods in hover #2978 (tgodzik)
- Intend on paste #2815 (Giggiux)
- Update default version for bug report #2984 (dos65)
- Update mdoc to 2.2.22 #2981 (tgodzik)
- [Scala 3] Filter out -print-lines and -print-tasty options #2979 (tgodzik)
- Replace the usage of nuprocess #2933 (dos65)
- Mtags3 - exclude scala2 depedencies. #2971 (dos65)
- Fix ammonite type completions #2974 (tgodzik)
- Update munit to 0.7.27 #2967 (scala-steward)
- Update jsoup to 1.14.1 #2965 (scala-steward)
- Update flyway-core to 7.11.2 #2964 (scala-steward)
- Bump cache-action to latest. #2970 (ckipp01)
- Update jackson-databind to 2.12.4 #2963 (scala-steward)
- Update scalafmt-core to 3.0.0-RC6 #2968 (scala-steward)
- Upgrade snapshot version #2957 (dos65)
- fix release notes date #2958 (dos65)
- 0.10.5 - release notes #2953 (dos65)