A lot has happened since the last stable release. Before releasing v0.5, we should update the website to document new functionality such as
In particular, we should validate all the features work reliably in the supported editors (vim, emacs, sublime, atom).
This is the only remaining issue blocking a v0.5 release! I have published
v0.5.0-M1 so people can try out a non-SNAPSHOT.
I have personally used VS Code + Metals for two weeks now and I'm pretty happy
with the new functionality. It would be great to confirm before the stable
release that the features also work outside of VS Code.
Below is a checklist of features that may need minor tweaking to improve the UX
outside of VS Code. The cursor position is indicated by @@.
In LSP, it's called textDocument/completion but in the editor it may be called
something else.
println@@Predef.println@@.Future@@ and if you select the option Future - scala.concurrent it adds aimport scala.concurrent.Futuredef @@ and itclass Main {
// should show "override def toString(): String` along with hashCode, equals, ...
def @@
}
assert(true, mess@@) should complete message =assert@@ should move the cursorassert(@@)x$1, for example "".substrin@@ should displaysubstring(beginIndex: Int, endIndex: Int): String instead ofsubstring(x$1: Int, x$2: Int): String. I suspect this won't work in Vim orlocally {
val susan = "Susan"
"Hello $susa@@" // should complete into s"Hello $susan"
}
locally {
val numbers = List(1)
s"Hello $numbers.head@@" // should complete into s"Hello ${numbers.head}"
}
Option(1) match {
case S@@ // Should suggest `Some` at the top, not `Seq`
}
Predef.@@ should trigger completion.// before
Option(1) match@@
// after
Option(1) match {
case None => @@
case Some(value) =>
}
List(Option(1)).map {
case@@ // should suggest "case None =>` and `case Some(value) =>`
-Dmetals.signature-help.command: a command ID to automatically triggerassert(@@). In VS Code, this value is"editor.action.triggerParameterHints".-Dmetals.completion.command: a command ID to trigger a follow-up completion"editor.action.triggerSuggest".-Dmetals.override-def-format: valid values are ascii (default) orunicode. If set to unicode, then Metals uses the symbols ⏫ and 🔼 insteadIn LSP, it's called textDocument/hover but in the editor it may be called
something else.
Option(1).ma@@p(_ + 1) should appear like this
.map(_.toString) is-Dmetals.hover.documentation: a boolean true (default) or false. If setIn LSP, it's called textDocument/signatureHelp but in the editor it may be
called something else.

y: Int in the image above.math.max has( should automatically trigger signature help.-Dmetals.signature-help.documentation: a boolean true (default) orfalse. If set to false, then the docstring is left empty, which can beIn LSP, it's called textDocument/foldingRange but in the editor it may be
called something else.

In LSP, it's called textDocument/documentHighlight but in the editor it may be
called something else.

I've been using metals with Emacs for the past two weeks (SNAPSHOTS versions). So far everything I tried worked pretty well.
I'll try to test everything in this issue this weekend or next week to confirm Emacs integration :smile:
Thank you for this amazing work! :clap: :tada:
BTW, to try out v0.5.0-M1
https://scalameta.org/metals/docs/editors/vscode.html#using-latest-metals-snapshot
I found some error messages in vscode's console
bad option: -P:semanticdb:synthetics:on
bad option: -P:semanticdb:failures:warning
I have to manually add the following settings in my build.sbt in case of those errors
addCompilerPlugin("org.scalameta" % "semanticdb-scalac" % "4.1.5" cross CrossVersion.full)
@Atry Thank for trying it out! Please report a separate issue, that looks unrelated to the new release.
I just reported the issue at https://github.com/scalameta/metals/issues/647
Now I am busy uninstalling IntelliJ
Is it expected that the hover docs cannot define the exact collection in a overriden method, like in the image?

I see ${coll} but I can't tell if it's a generic placeholder, or if some substitution should happen, based on the current variable type
@ivanopagano that is a bug with the Scaladoc to Markdown conversion, which is not following the coll variable, defined with a @define declaration.
See

and

/cc @mudsam who worked on this
From https://github.com/scala/scala/blob/v2.12.1/src/library/scala/collection/IterableLike.scala#L1
Tracking this in #648, thanks for reporting!
Fantastic work @olafurpg :tada: !
I'm a long time user of NeoVim and I've been using one of the latest snapshots for a while and I'm pretty impressed with how fast it is!
Just to give you some feedback I got completions working using vim-lsc but I had to tweak it a bit to got it working properly (i.e. disabling showing empty preview window on autocompletion).
I gave coc.vim a go but it was hard to get it working smoothly. I don't know about others, I felt it buggy like it was last time I tried it but I might have tried it with the wrong config or so.
Keep up the amazing work!
Great, work @olafurpg and others involved!
I've been using Metals snapshots with Neovim and vim-lsc pretty steadily at work for a couple of months now. Overall, I've been very pleased. I haven't figured out how to get a working Nix derivation for coc.nvim yet, so I only have data for vim-lsc.
Certain things that I do seem to get it into a state where completion no longer works until I restart Neovim. I don't see anything unusual in the logs when this happens, and I haven't reported it yet, because I don't have a minimal example to reproduce it. I'll keep an eye on it but thought that this might be a good time to put it on someone's radar.
I've regularly used most of the features described here. Below are my results walking through them just now. Most things just work. I've listed below things that don't work quite as desired (I haven't mentioned the things that _do_ work perfectly).
import Future@@ works, but local import isn't added for something like Future@@ (with vim-lsc).assert($0) and the cursor is not inside the parentheses. I think that this is a known limitation of using Metals with vim-lsc?x$1 on vim-lsc.s at the beginning of your string, which is missing in the example${numbers.head$0}, which I think is consistent with completion templates generally being wonky when using Metals with vim-lsc.Option(1) match { case None => $0 case Some(x) =>
Most helpful comment
This is the only remaining issue blocking a v0.5 release! I have published
v0.5.0-M1 so people can try out a non-SNAPSHOT.
I have personally used VS Code + Metals for two weeks now and I'm pretty happy
with the new functionality. It would be great to confirm before the stable
release that the features also work outside of VS Code.
vim-lsc because coc.nvim implements several advanced completion features
that Metals supports.
Below is a checklist of features that may need minor tweaking to improve the UX
outside of VS Code. The cursor position is indicated by
@@.Completions
In LSP, it's called
textDocument/completionbut in the editor it may be calledsomething else.
println@@Predef.println@@.Future@@and if you select the optionFuture - scala.concurrentit adds alocal
import scala.concurrent.Futuredef @@and itshows methods that can be overridden by the superclass
assert(true, mess@@)should completemessage =assert@@should move the cursorinside parentheses like
assert(@@)x$1, for example"".substrin@@should displaysubstring(beginIndex: Int, endIndex: Int): Stringinstead ofsubstring(x$1: Int, x$2: Int): String. I suspect this won't work in Vim orSublime, you may need to trigger a command in Emacs.
inside a plain literal
member name of a spliced identifier inside a string interpolator
Predef.@@should trigger completion."match (exhaustive)` completion
Server configuration
-Dmetals.signature-help.command: a command ID to automatically triggersignature help (parameter hints) when a completion snippet moves the cursor
into parentheses
assert(@@). In VS Code, this value is"editor.action.triggerParameterHints".-Dmetals.completion.command: a command ID to trigger a follow-up completionin the editor after selecting certain completions. In VS Code, this value is
"editor.action.triggerSuggest".-Dmetals.override-def-format: valid values areascii(default) orunicode. If set to unicode, then Metals uses the symbols ⏫ and 🔼 insteadof "override def" and "def" to save horizontal space in the UI.
Hover (aka. show type at point)
In LSP, it's called
textDocument/hoverbut in the editor it may be calledsomething else.
Option(1).ma@@p(_ + 1)should appear like this.map(_.toString)isnot highlighted
Server configuration
-Dmetals.hover.documentation: a booleantrue(default) orfalse. If setto false, then the docstring is left empty, which can be desirable if you only
care about seeing the expression type and symbol signature.
Signature help (aka. parameter hints)
In LSP, it's called
textDocument/signatureHelpbut in the editor it may becalled something else.
Example,
y: Intin the image above.math.maxhasfour overloads that can be cycled through by clicking the up/down arrows in
the image above.
(should automatically trigger signature help.Server configuration
-Dmetals.signature-help.documentation: a booleantrue(default) orfalse. If set to false, then the docstring is left empty, which can bedesirable if you only care about seeing the symbol signature.
Folding ranges
In LSP, it's called
textDocument/foldingRangebut in the editor it may becalled something else.
Document highlight
In LSP, it's called
textDocument/documentHighlightbut in the editor it may becalled something else.
of that symbol in the current file