Metals v0.10.7 - Tungsten
We're happy to announce the release of Metals v0.10.7, which mostly focuses on support for Scala 2.12.15 and refines the indent on paste functionality.
Commits since last release | 42 |
Merged PRs | 14 |
Contributors | 6 |
Closed issues | 4 |
New features | 1 |
For full details: https://github.com/scalameta/metals/milestone/42?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!
- Scala 2.12.15 and 3.1.0-RC2 support.
- Indent on paste improvements.
- Show TASTy command.
Indent on paste improvements
In Metals 0.10.6 we introduced a new feature that would adjust the indentation of any pasted snippet. You can read about it in previous release notes.
The feature was not fully mature and despite our best intentions it could cause a lot of issues for the users. To help with that we introduced two changes.
Firstly, we will now use the current indentation of the cursor and adjust any pasted snippet to use that level of indentation.
For example in case of a simple snippet like:
def hello() =
println("Hello!")
if we paste it into:
def main() =
println("Main")
|
after pasting we will have:
def main =
println("Main")
def hello() =
println("Hello!")
However, if we move the cursor back:
def main() =
println("Main")
|
the result will be different:
def main =
println("Main")
def hello() =
println("Hello!")
You can use it to paste anything at the indentation level you need.
Moreover, we also added a new setting metals.enableIndentOnPaste
, which you
can use to turn the feature on and off. Currently, it's off by default. We
highly recommend turning it on, testing out some more and reporting any new
issues.
We also included a number of fixes for indentation in the Visual Studio Code extension, which should fix some problems in the Scala 3 optional braces code.
Show TASTy command
What is TASTy? According to the official Scala documentation:
TASTy is an acronym that comes from the term Typed Abstract Syntax Trees. It's a high-level interchange format for Scala 3, and in this document we'll refer to it as Tasty. Tasty files are generated by the scalac compiler, and contain all of the information about your source code, including the syntactic structure of your program, and complete information about types, positions, and even documentation.
Thanks to kpodsiad, Metals can now show TASTy of
a currently opened file using the new metals.show-tasty
command. However, keep
in mind that currently, this feature works only for Scala 3 sources. You can use
this new command already in nvim-metals and Visual Studio Code.
Contributors
Big thanks to everybody who contributed to this release or reported an issue!
$ git shortlog -sn --no-merges v0.10.6..v0.10.7
Kamil Podsiadlo
Tomasz Godzik
Vadim Chelyshov
Merged PRs
v0.10.7 (2021-09-16)
Merged pull requests:
- Add setting to enable indentation on paste #3129 (tgodzik)
- Bump Scala 3 RC version to 3.1.0-RC2 #3131 (tgodzik)
- Use the current indentation as reference when pasting #3127 (tgodzik)
- Show TASTy for open file command #3063 (kpodsiad)
- Add support for Scala 2.12.15 #3126 (tgodzik)
- Fix overindenting when the indentation is more than expected #3109 (tgodzik)
- Update Bloop to 1.4.9 #3124 (tgodzik)
- Fix renaming class hierarchy inside a method #3116 (kpodsiad)
- Update flyway-core to 7.14.1 #3122 (scala-steward)
- Update ujson to 1.4.1 #3121 (scala-steward)
- bug report template - downgrade version #3117 (dos65)
- Fix process exiting #3112 (dos65)
- Fix message about unsupported version for RC Scala 3 versions #3114 (tgodzik)
- Make sure that classpath does not contain invalid files #3111 (tgodzik)
- bump snapshot version to 0.10.7 #3106 (kpodsiad)
- Add release notes for Metals v0.10.6 #3104 (tgodzik)