scalameta / metals-zed

Zed plugin for Metals
Apache License 2.0
45 stars 10 forks source link

[bug]: cannot auto-import `tap` #17

Open spaceunifyfifty opened 1 month ago

spaceunifyfifty commented 1 month ago

I write the .tap utility method and expect Zed to allow auto-importing this on keyboard shortcut cmd+.

class Foo
val x = Foo.tap()

When my caret is over .tap() and I press cmd+., no auto-import prompt appears, but instead an error message which demonstrates Zed is even aware of exactly where it needs to import it from.

image
value tap is not a member of object Foo, but could be made available as an extension method.

The following import might fix the problem:

  import scala.util.chaining.scalaUtilChainingOps