We're happy to announce the release of Metals v0.9.4, which focuses on improvements in Scala 3 worksheets, a couple of new features, and a number of smaller improvements.
|Commits since last release||115|
For full details: https://github.com/scalameta/metals/milestone/27?closed=1
Metals is a language server for Scala that works with VS Code, Vim, Emacs, Sublime Text, Atom and Eclipse. Metals is developed at the Scala Center and VirtusLab with the help from Lunatech along with contributors from the community.
Check out https://scalameta.org/metals/, and give Metals a try!
- Scala 0.26.0 and 0.27.0-RC1 support.
- Analyze stacktrace command
- Customizable package exclusions
Analyze stacktrace command
Thanks to kpbochenek, Metals can now help with
navigating stack traces using the new
metals.analyze-stacktrace command. The
only thing it needs is the actual stack trace string to be input as a parameter
to the command. This new functionality works differently in various editors.
Visual Studio Code
The only thing users need to do is copy the stack trace and run the
Analyze Stacktrace command from the command palette. This will display a new
web view, where it will be possible for users to navigate the files that are
included in the exception.
coc-metals, you just need to copy the stacktrace, whether from sbt,
bloop-cli, or somewhere else into your register. Once you have it copied, you
can just execute the
metals.analyze-stacktracecommand. This will create
.metals/stracktrace.scala file which can be used to navigate through your
stacktrace using code lenses. Keep in mind that you'll want to make sure you
have codeLens.enable set to true in your configuration. Also, since this feature
relies on code lenses (virtual text in Nvim), it's only supported in Nvim.
To make it work with any other editors users need to run the command manually
with the stacktrace as input, similar to the example above with
The command will generate a new file,
.metals/stacktrace.scala, which can be
used to navigate through the stacktrace using code lenses.
Customizable package exclusions
Usually, a number of packages are almost never used by the developers and could clutter the language server output while being of little benefit to the users. Metals would exclude those packages from indexing causing them to not be recommended for completions, symbol searches, and code actions. Previously that list was set in stone and consisted of a number of prefixes:
val defaultExclusions: List[String] = List( "META-INF/", "images/", "toolbarButtonGraphics/", "jdk/", "sun/", "javax/", "oracle/", "java/awt/desktop/", "org/jcp/", "org/omg/", "org/graalvm/", "com/oracle/", "com/sun/", "com/apple/", "apple/" )
This list might work in most cases, but users might also want to customize the list according to their preferences and domain they are working on. Starting with this release it is now possible to define additional exclusions as well as remove some from the default list. This can be done via an additional Metals user setting:
"metals.excluded-packages" : [ "akka.actor.typed.javadsl", "--javax" ]
-- should only be used to remove some of the defaults if they aren't needed
for your project. Thanks to ckipp01 for
contributing this feature!
Some of the smaller improvements to Metals include:
- New recommended Maven Scala template.
- Fix go to source and auto imports in standalone worksheet files.
- Fix missing classes from _empty package in tree view.
- Add a command to quickly create a new worksheet with a default name.
Beside all the core work on the server itself, there have also been a lot of great work done in various other Scalameta projects, which Metals relies on. These projects include mdoc, which powers worksheets and Scalameta, which powers all SemanticDB and parsing powered features. Those contributions helped to unlock and improve Dotty support in Metals. So special thanks to those projects and contributors.
Big thanks to everybody who contributed to this release or reported an issue!
git shortlog -sn --no-merges v0.9.3..v0.9.4 Scala Steward Chris Kipp Tomasz Godzik Krzysztof Bochenek Ethan Atkins Joseph Price
Merged pull requests:
- Bump other reference of coursier/cache #2087 (ckipp01)
- Use built-in fetch depth and bump coursier cache #2086 (ckipp01)
- Refactor NewFileProvider #2085 (ckipp01)
- Strip out
[error]from stacktrace in analyzer. #2083 (ckipp01)
- Update Bloop to 1.4.4-13-408f4d80 #2080 (tgodzik)
- Update mdoc version to 2.2.9 #2079 (tgodzik)
- Change new-scala-file to enable quick creation of a file. #2075 (ckipp01)
- Update sbt-jmh to 0.4.0 #2071 (scala-steward)
- Update xnio-nio to 3.8.2.Final #2067 (scala-steward)
- Update scalameta, semanticdb-scalac, ... to 4.3.22 #2070 (scala-steward)
- Update sbt-mdoc to 2.2.8 #2069 (scala-steward)
- Update mdoc-interfaces to 2.2.8 #2068 (scala-steward)
- Update undertow-core to 2.1.4.Final #2066 (scala-steward)
- Update coursier to 2.0.0-RC6-26 #2065 (scala-steward)
- Update sbt-scalafix to 0.9.20 #2064 (scala-steward)
- Update bloop-config, bloop-launcher to 1.4.3-31-b16d7e50 #2063 (scala-steward)
- Fix wrong definition position for worksheets #2060 (tgodzik)
- Fix typo in StringBloomFilter.scala #2059 (joprice)
- Add support for dotty 0.27.0-RC1 and update mdoc #2058 (tgodzik)
- Don't search for runTest code lenses in Ammonite scripts and worksheets. #2057 (ckipp01)
- Look into ammonite flakiness in tests to see if we can remove it #2054 (ckipp01)
- Add in new version of Ammonite #2056 (ckipp01)
- Fix missing classes from empty package in treeView. #2053 (ckipp01)
- Remove TravisCI stuff #2055 (ckipp01)
- Correct the way userConfig examples are displayed. #2045 (ckipp01)
- Customizable package exclusions #2012 (ckipp01)
- Update interface to 0.0.25 #2038 (scala-steward)
- Update emacs docs to include latest lsp-metals changes #2033 (kpbochenek)
- Update scalameta, semanticdb-scalac, ... to 4.3.21 #2042 (scala-steward)
- Update sbt-munit to 0.7.12 #2041 (scala-steward)
- Update jol-core to 0.13 #2040 (scala-steward)
- Update flyway-core to 6.5.5 #2039 (scala-steward)
- Update coursier to 2.0.0-RC6-25 #2037 (scala-steward)
- Update file-tree-views to 2.1.5 #2036 (scala-steward)
- Update bloop-config, bloop-launcher to 1.4.3-27-dfdc9971 #2035 (scala-steward)
- Update sbt-dotty to 0.4.2 #2034 (scala-steward)
- Fix auto imports and go to sources for worksheets outside sources #2030 (tgodzik)
- Add Maven template to the curated list of templates #2028 (tgodzik)
- Add support for dotty 0.26.0 #2027 (tgodzik)
- Bump memory for test forks to 2GB #2025 (tgodzik)
- Update sbt docs to better explain how to manually install Metals prior to 0.7.6 version #2026 (tgodzik)
- Add parallel tests #1985 (tgodzik)
- Remove old gitignore and graal stuff. #2022 (ckipp01)
- Clear fingerprints when semanticdb hash matches #2021 (tgodzik)
- Change link in blog post to absolute path #2019 (tgodzik)
- Switch file watching library to swoval #2014 (eatkins)
- Move releases to github actions #2015 (tgodzik)
- Analyze stacktrace #1966 (kpbochenek)
- Fix typo in vscode docs #2010 (tgodzik)
- Add release notes for 0.9.3 #2008 (tgodzik)