Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completions not shown after a method call with a polymorphic function literal #6861

Open
kubukoz opened this issue Oct 18, 2024 · 0 comments
Labels
bug Something that is making a piece of functionality unusable completions Tickets related to completion functionality Scala 3 Generic ticket relating to Scala 3

Comments

@kubukoz
Copy link
Contributor

kubukoz commented Oct 18, 2024

Describe the bug

To reproduce:

  1. Write
//> using scala 3.5.1

trait Builder[Alg] {
  def withTraces: String
}

trait BuilderFactory {

  def transformRouter(
    f: [Alg] => Builder[Alg] => String
  ): BuilderFactory

  def enhance: BuilderFactory
  def build: Unit
}

trait Demo {

  def demo = {
    val factory: BuilderFactory = ???

    val result =
      factory
        .enhance
        .transformRouter([Alg] => _.withTraces)
        // no completions after the above
        .build

    result
  }

}
  1. Try to get completions after .transformRouter(...)<HERE>
  2. See nothing (not even the build method present in code)

Expected behavior

Completions for enhance, build and transformRouter are shown.

Operating system

macOS

Editor/Extension

VS Code

Version of Metals

v1.3.5

Extra context or search terms

  • works fine in scala-cli repl
  • doesn't start working after upgrading to Scala 3 nightlies
  • works fine if the polymorphic function is passed with an identifier rather than as a literal, e.g. val f = [Alg] => (_: Builder[Alg]).withTraces
@kubukoz kubukoz changed the title Completions not shown after a method call with a polymorphic function type Completions not shown after a method call with a polymorphic function literal Oct 18, 2024
@tgodzik tgodzik added bug Something that is making a piece of functionality unusable completions Tickets related to completion functionality Scala 3 Generic ticket relating to Scala 3 labels Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is making a piece of functionality unusable completions Tickets related to completion functionality Scala 3 Generic ticket relating to Scala 3
Projects
Status: Triage
Development

No branches or pull requests

2 participants