Metals v0.10.8 - Tungsten
We're happy to announce the release of Metals v0.10.8, which brings a lot of new features in addition to Scala 3.1.0 support!
Commits since last release | 162 |
Merged PRs | 70 |
Contributors | 16 |
Closed issues | 11 |
New features | 4 |
For full details: https://github.com/scalameta/metals/milestone/43?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!
- Expression evaluator for Scala 2
- [Scala 2] Type annotations on code selection
- Source file analyzer
- Find text in dependency JAR files
- VSCode - workspace symbol search fix
- Scala 3.1.0 and completion improvements
Expression Evaluator
The long awaited issue #3051 was close to celebrating its 2 years birthday but due to the impressive work by @tdudzik and help from @adapi and @tgodzik Metals finally has support for expression evaluation during debugging! The implementation is based on the initial idea from @smarter's for expression evaluation in the Dotty Language Server.
Currently, it's implemented only for Scala 2, however the work on Scala3 support is in progress.
Since expression evaluation is a complex feature there might still be some bugs that we didn't account for, so do not hesitate to report anything that doesn't look right.
Editors support: every client that implements DAP
Type annotations on code selection
Thanks to @KacperFKorban, yet another long awaited issue #3059 was closed. Previously, hover in Metals was limited by the LSP protocol and only worked for a single position, however it turns out that it was possible to work around this limitation.
Editors support: VS Code, nvim-metals
Source file analyzer
The Show Tasty command
from the previous release was extended. Now, Metals
also can show javap and semanticdb outputs from the source. Thanks
@Arthurm1 for javap/semanticdb implementation and
@kpodsiad for aligning all views into a single
feature.
The full list of commands:
metals.show-tasty
metals.show-javap
metals.show-javap-verbose
metals.show-semanticdb-compact
metals.show-semanticdb-detailed
metals.show-semanticdb-proto
In VS Code you can notice that there is a new Metals Analyze Source
submenu in
file pop-up menu that provides a list of all these commands.
Editors support: VS Code, nvim-metals
Find text in dependency JAR files
This release also introduces another helpful feature, it's possible now to do text search through files in classpath jars and source-jars. Thanks to @ Z1kkurat for his contribution!
Editors support: VS Code, nvim-metals
VSCode extension - workspace symbol search fix
Initially, workspace symbol search in Metals allowed you to extend the search in a couple of ways:
-
It was possible to look through all the dependencies by adding the semicolon
;
at the end or to search. This was done by default if no results were found in the current workspace. -
Users could use the full path for symbols such as
j.n.f.Path
forjava.nio.file.Path
.
Unfortunately, this stopped being possible in some later Visual Studio Code
versions. To work around that issue a new command was added:
metals.symbol-search
, which allows for the additional search features. This
already works for all other editors. In addition, Metals extension now overrides
default keybing for symbol search: Ctrl+T
/Cmd+T
executes this Metals
command.
An important notice: we can't fix the default workspace symbol search. It still uses default VS Code implementation.
Scala 3.1.0 and completion improvements
And lastly this new Metals release comes with a new compiler version support -
3.1.0. As well as support for the next release candidate 3.1.1-RC1
, which will
be later updated in the SNAPSHOT Metals versions in case of further release
candidates. We also further improved the support for Scala 3:
- Completion items ordering were reworked and now it should match the behaviour of Scala 2
- Type descriptions in completion now shows the precise type for generic methods
Miscellaneous
- Fix type decorations for sbt/standalone files @tgodzik
- Use Scala 3 syntax by default. @smarter
- Support more scenarios in rewrite parent/braces code action. @kpodsiad
- Fix go to parent code lenses for local symbols. tgodzik
- Strip out [info] for stacktraces. ckipp01
- [sbt server] Fix meta-build-target configuration. adpi2
- Add build server version to the doctor view. kpodsiad
Contributors
Big thanks to everybody who contributed to this release or reported an issue!
$ git shortlog -sn --no-merges v0.10.7..v0.10.8
25 Tomasz Godzik
20 Vadim Chelyshov
13 Z1kkurat
10 Adrien Piquerez
8 Kamil Podsiadlo
4 ckipp01
3 Gabriele Petronella
2 tdudzik
2 Ólafur Páll Geirsson
1 Alexandre Archambault
1 Arthur McGibbon
1 Guillaume Martres
1 Kacper Korban
Merged PRs
v0.10.8 (2021-10-26)
Merged pull requests:
- Compilers: try to fix NPE #3227 (dos65)
- Print exact type for expressions containing generics #3223 (tgodzik)
- Update debug adapter to 2.0.8 #3226 (tdudzik)
- Always show hover on a non empty range selection #3222 (tgodzik)
- Reset diagnostics on build import #3220 (Z1kkurat)
- Add Scala 3.1.0 support #3212 (dos65)
- Update Bloop to 1.4.10 #3218 (tgodzik)
- Bump debug adapter #3216 (adpi2)
- [Scala3] Completions - show applied type for
Select
#3188 (dos65) - Allow to generate run lenses for bsp servers which have debug capability #3210 (kpodsiad)
- Use sbt-debug-adapter explicity in metals.sbt #3211 (adpi2)
- Use SemanticdbPlugin in sbt-metals #3200 (adpi2)
- Workflows: ignore sourcegraph upload error #3208 (dos65)
- EndpointLogger: close trace writer #3207 (dos65)
- Bump Bloop and scala-debug-adapter #3209 (adpi2)
- Update scribe, scribe-file, scribe-slf4j to 3.6.0 #3205 (scala-steward)
- Update flyway-core to 8.0.1 #3206 (scala-steward)
- Update ujson to 1.4.2 #3204 (scala-steward)
- Update sbt-debug-adapter to 2.0.5 #3203 (scala-steward)
- Find in jar minor fixes #3198 (dos65)
- Fix flaky cancel compile suite #3202 (dos65)
- Add new suites to TestGroups #3199 (dos65)
- [sbt server] Fix meta-build-target configuration #3194 (adpi2)
- Decode file refactor #3160 (kpodsiad)
- Don't use
window/showMessage
to report generic Scalafix error #3192 (olafurpg) - Wait with loading compiler and compilation #3190 (tgodzik)
- Implement 'find in JAR files' LSP extension #3093 (Z1kkurat)
- Don't throw an exception is compiling semanticdb times out #3187 (tgodzik)
- Wait for build tool information when generating semanticdb #3184 (tgodzik)
- Bump bloop to fix some debug issues #3185 (adpi2)
- Remove unused
bspEnabled := false
#3186 (adpi2) - Updage scalafmt + use optional braces syntax for scala3 #3165 (dos65)
- Don't create file system when debugging #3183 (tgodzik)
- Remove extra boolean from the
goto-position
server command inStacktraceAnalyzer
#3179 (ckipp01) - Upgrade scala3 rc version #3182 (dos65)
- Strip out [info] for stacktraces. #3180 (ckipp01)
- Avoid IllegalArgumentException when trying to get type of range. #3178 (ckipp01)
- Make sure generate-sources phase is always run for Maven #3164 (tgodzik)
- Update scala-java8-compat to 1.0.1 #3175 (scala-steward)
- Try to fix flaky tests #3163 (tgodzik)
- Update scalafmt-dynamic to 3.0.5 #3177 (scala-steward)
- Update jsoup to 1.14.3 #3174 (scala-steward)
- Update flyway-core to 7.15.0 #3173 (scala-steward)
- Update undertow-core to 2.2.12.Final #3172 (scala-steward)
- Update guava to 31.0.1-jre #3171 (scala-steward)
- Update metaconfig-core to 0.9.15 #3170 (scala-steward)
- Update jackson-databind to 2.13.0 #3169 (scala-steward)
- Add completion support to expression evaluator #3159 (tgodzik)
- Reconnect to BSP server upon buildTarget/didChange #3145 (alexarchambault)
- Don't search for all symbols in go-to-parent code lenses #3161 (tgodzik)
- Bump Bloop and sbt-debug-adapter #3166 (adpi2)
- Create dependency files on step if they don't exist #3167 (tgodzik)
- Fix go to parent code lenses for local symbols #3154 (tgodzik)
- Don't close source jars #3162 (tgodzik)
- Add position to show tasty command #3148 (kpodsiad)
- Use scala-debug-adapter 2.x to enable code evaluation #2959 (adpi2)
- Type annotation on code selection #3060 (KacperFKorban)
- Make commands parametrized and easier to use #3149 (tgodzik)
- Generate symbol information for standalone files, worksheets and sbt files #3019 (tgodzik)
- Update Sourcegraph workflow to use
lsif-java index
command. #3152 (olafurpg) - Only set sbt dialect when file has indeed .sbt extension #3144 (tgodzik)
- Support more scenarios with 'replace () with ' code action #3130 (kpodsiad)
- add javap/semanticdb file viewer #3107 (Arthurm1)
- Add build server version to the doctor view #3141 (kpodsiad)
- Update scalafix to 0.9.31 #3138 (tgodzik)
- Add docs for Metals custom search command #3139 (gabro)
- [Scala3] Improve completions ordering #3115 (dos65)
- Set the default fallbackScalaVersion to scala 3 instead of 2.12 #3134 (smarter)
- Bump Scalafmt version #3137 (gabro)
- Add release notes for Metals v0.10.7 #3132 (tgodzik)