scalameta / metals

Scala language server with rich IDE features 🚀
https://scalameta.org/metals/
Apache License 2.0
2.08k stars 330 forks source link

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

Open megri opened 4 months ago

megri commented 4 months ago

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

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:

Additional context

Search terms

mill bsp quick fix auto import

tgodzik commented 4 months ago

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 https://github.com/com-lihaoyi/mill/issues/3165