The details value of completion items from the language server seems to be duplicated into the label field. This causes issues with some editors, notably Emacs, using Eglot for LSP support and Corfu for completion:
If Corfu is configured for TAB-and-Go completion, typing anything to apply the selected configuration results in the scala.collection.mutable part being left in the file, which is undesired.
To reproduce:
Put together an Emacs configuration using Eglot and Corfu configured for TAB-and-Go completion (if a configuration is necessary, mine is available here, although a little overkill for this repro)
Open a Scala file in a project, ensuring Metals is available on the path
Enable Eglot (if it isn't already) with M-x eglot
Into the buffer, type import scala.collection.mutable.Has
Wait for completions to appear, hit TAB to select an option, and continue typing (eg. type .)
The line becomes import scala.collection.mutable.HashMap scala.collection.mutable.
Expected behavior
When step 5 is completed, the line should become import scala.collection.mutable.HashMap.
Describe the bug
The
details
value of completion items from the language server seems to be duplicated into thelabel
field. This causes issues with some editors, notably Emacs, using Eglot for LSP support and Corfu for completion:If Corfu is configured for TAB-and-Go completion, typing anything to apply the selected configuration results in the
scala.collection.mutable
part being left in the file, which is undesired.To reproduce:
M-x eglot
import scala.collection.mutable.Has
TAB
to select an option, and continue typing (eg. type.
)import scala.collection.mutable.HashMap scala.collection.mutable.
Expected behavior
When step 5 is completed, the line should become
import scala.collection.mutable.HashMap.
Operating system
Linux
Editor/Extension
Emacs (other)
Version of Metals
v1.3.5
Extra context or search terms
No response