Skip to main content

Metals v0.7.2 - Thorium

We are excited to announce the release of Metals v0.7.2 - codename "Thorium" 🎉 The release includes mostly bug fixes with some smaller new features. We are skipping over 0.7.1 due to a critical bug we discovered

Metals is a language server for Scala that works with VS Code, Atom, Vim, Sublime Text and Emacs. Metals is developed at the Scala Center and VirtusLab along with contributors from the community.

In this release we merged 39 PRs and closed 11 issues, full details: https://github.com/scalameta/metals/milestone/14?closed=1

TL;DR#

Check out the website and give Metals a try: https://scalameta.org/metals/

  • support for Scala 2.12.9
  • fix completions in case of inline comments
  • add support for non-directory sources
  • automatically add package definition to new source files
  • automatically insert pipes in multiline string
  • a lot of miscellaneous fixes

Fix completions in case of inline comments#

Previously, completions after a comment and newline would yield no results:

val List(1,2,3)
.map(num => num + 1) // comment
@@

This was fixed by the Metals team in the presentation compiler itself for 2.12.9 and 2.13.1, however we also added a workaround for all supported older Scala versions.

Add support for non-directory sources#

In case that your build tool supports having single files as sources, we now offer full support for them. That corresponds to the most recent BSP specification request

Automatically add package definition to new source files#

For every new Scala file we automatically add package definition based on the relative path between the new source file and source root. This is done using applyWorkspaceEdit method, which causes the change to be done in editor and this can easily be rewerted like any other change you would type.

add-package

We also added support for package objects. Whenever you create package.scala file, we will automatically create the barebone definition of the package object.

package-object

There is still some work to be done about moving files between packages, which will be addressed in the next release.

Big thanks to the first time contributor from VirtusLab Tomasz Dudzik for implementing most of the functionality! 🎉

Automatically insert pipes in multiline string#

We finally managed to properly support adding | in multiline strings using the onTypeFormatting method. Previous implementation was very naive and often added pipes in wrong places.

pipes

To enable the functionality you need to enable onTypeFormatting inside your editor if it's not enabled by default.

In Visual Studio Code this needs to be done in settings by checking Editor: Format On Type:

on-type

You will also need the newest version of the Visual Studio Code plugin.

There is still some possible improvements in case of copy pasting entire text fragments, but that needs some more work.

Big thanks to another of our first time contributors from VirtusLab Karolina Bogacka! Great work! 🎉

Add support for Scala 2.12.9#

Metals now supports Scala 2.12.9! No new Scala version has been deprecated in this release, since it is possible that Scala 2.12.10 version with some important fixes will be released soon.

Big thanks to @gabro for again leading the effort! This took considerably more time and effort than expected.

Miscellaneous fixes#

  • erroneous warning for Scala 2.11 is no longer displayed
  • don't infer build target for non-readonly files
  • fix several small issues in the tree view protocol spec
  • set h2.bindAddress to avoid exposing open ports (thanks @blast-hardcheese!)
  • resolve symlinks that are used within workspaces
  • fix issues when import was requested multiple times without any change
  • detect openjdk as a valid jdk home
  • warn when java sources were not found
  • string interpolation completions now work properly in multiline string
  • add ReloadDoctor to the list of all commands (thanks @kurnevsky!)
  • add correct mill version in the predef script when running bloopInstall
  • SemanticDB plugin issues are no longer reported in java only projects
  • check if SeamnticDB really exists and only report issue when it doesn't
  • update default scalafmt to 2.0.1
  • use recommended version for build tools in UI message
  • fix file leak when importing large Gradle workspaces

Contributors#

Big thanks to everybody who contributed to this release, a lot more people joined this time to make the release better!

$ git shortlog -sn --no-merges v0.7.0..v0.7.2
Gabriele Petronella
Tomasz Godzik
Ólafur Páll Geirsson
Evgeny Kurnevsky
Marek Żarnowski
Lucas Satabin
Ayoub Benali
Chris Birchall
Compro Prasad
Devon Stewart
Jesús Martínez
Karolina Bogacka
Tomasz Dudzik
Chris Kipp
Rikito Taniguchi

Merged PRs#

v0.7.2 (2019-08-29)#

Full Changelog

Merged pull requests:

  • Fix not closing streams when using Files.list #892 (tgodzik)
  • Avoid file leaks when digesting Gradle builds #889 (olafurpg)
  • Fix broken tests #888 (olafurpg)
  • Bump Metals Scala version to 2.12.9 #887 (tgodzik)
  • Add check mark for formatting under vim #885 (satabin)
  • Recommend a recent version of the build tool when incompatible or unknown #881 (gabro)
  • Use BuildInfo.scalaCompilerVersion over Properties.versionNumberString #876 (olafurpg)
  • Remove use of early intializers #877 (gabro)
  • Catch ShutdownReq exception from stopping a presentation compiler. #873 (olafurpg)
  • Transpose features/editors table #875 (gabro)
  • Make presentation compiler work on 2.12.9 #872 (gabro)
  • Scala 2.12.9 support #867 (gabro)
  • Automatically add package objects when creating package.scala file #866 (tgodzik)
  • Automatically add package declaration when creating a file #862 (tdudzik)
  • Fix TreeViewSlowSuite tests #864 (gabro)
  • Update scalafmt to 2.0.1 #863 (tanishiking)
  • Add support for non-directory sources #857 (tgodzik)
  • Report an issue only if SemanticDB file doesn't really exist. #853 (tgodzik)
  • Do not report issues in Java only projects #850 (tgodzik)
  • Emacs supports client commands now #848 (kurnevsky)
  • Fix issue if exact query is longer than the class name #843 (tgodzik)
  • Fix issue with wrong mill version in predef script and update millw scripts #842 (tgodzik)
  • Fix Mercury blog post date by adding an unlisted redirect #836 (gabro)
  • Update sublime doc regarding autoimport #839 (ayoub-benali)
  • Improve handling of the java sources #825 (marek1840)
  • Add exact libraries that are expected and fix the test #837 (tgodzik)
  • Add ReloadDoctor to the list of all commands. #830 (kurnevsky)
  • Install use-package if not already installed #828 (Compro-Prasad)
  • Fix multiline edits #826 (tgodzik)
  • Timestamps should use currentTimeMillis #822 (tgodzik)
  • resolve symlinks from client requests #824 (marek1840)
  • Setting h2.bindAddress to avoid exposing open ports #821 (blast-hardcheese)
  • Use Scalafmt 2.0.0 when setting the version in .scalafmt.conf #806 (gabro)
  • Don't infer build target for non-readonly files. #810 (olafurpg)
  • Fix versions in docs - wrong number of @ was used #820 (tgodzik)
  • Update the list of supported Scala binary versions #818 (cb372)
  • Bump mill version #817 (satabin)
  • Send treeViewDidChange only when the client supports it #816 (kurnevsky)
  • Fix issue with missing completions after comment and newline. #814 (tgodzik)
  • Fix several issues in the tree view protocol spec #811 (olafurpg)
  • Make test-release.sh script check that artifacts have synced to Maven #812 (olafurpg)
  • nvim version and updated info about required java versions #807 (ckipp01)
  • Lost a word in the last PR and adding it now #805 (tgodzik)
  • Use sonatype:public in our own meta build #803 (gabro)
  • Fix an issue with wrong deprecation warning for 2.11 and update snapshot version #804 (tgodzik)
  • Fix version typo #802 (JesusMtnez)