scalameta / metals

Scala language server with rich IDE features 🚀

Home Page:https://scalameta.org/metals/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not seeing auto import in quick fix prompt since v1.32.0.

megri opened this issue · comments

Note: To me this only happens in mill-bsp mode; Bloop seems to work as expected.

Activating auto complete or clicking the lightbulb for a quick fix in versions v1.31.0 and below will offer to add an import statement for a class if it's in the index and currently not imported.

From v.1.32.0+ this prompt will not display auto import.

To Reproduce Steps to reproduce the behavior:

I can reproduce this with the following setup

  • Mill, version 0.11.7 (in .mill-version file)
  • def scalaVersion = "3.4.1"
  • Run the Metals: Attempt to generate bsp config for build tool. action — this puts vscode-metals into mill-bsp mode.

After this step a very simple program can be constructed:

@main def App() =
    val x = ListBuffer

Attempting to quick-fix the ListBuffer symbol will trigger the behaviour.

Screenshots
image

image

Installation:

  • Operating system: macOS
  • VSCode version: 1.89.1
  • VSCode extension version: 1.32.0+
  • Metals version: default/not changed by me, but seems to be set to 1.3.0 rather than 1.3.1 🤔

Additional context

Search terms

mill bsp quick fix auto import

Looks like a change in Metals exposed an issue in Mill BSP. We can easily work around it, but in the long run I think it would be worth solving com-lihaoyi/mill#3165