Skip to content

Missing Context bound completions in extension constructs #19971

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

Closed
rochala opened this issue Mar 18, 2024 · 0 comments · Fixed by #20201
Closed

Missing Context bound completions in extension constructs #19971

rochala opened this issue Mar 18, 2024 · 0 comments · Fixed by #20201
Assignees
Labels
area:presentation-compiler Related to the presentation compiler module used by Metals and possibly other tools itype:bug
Milestone

Comments

@rochala
Copy link
Contributor

rochala commented Mar 18, 2024

Compiler version

3.4.1

Minimized code

  // file dotty/tools/pc/tests/completion/CompletionSuite.scala
  @Test def `context-bound-in-extension` =
    check(
      """
        |object x {
        |  extension [T: Orde@@]
        |}
        |""".stripMargin,
      "Ordering scala.math.Ordering"
    )

Output

No completions are available in this scenario

Expectation

Ordering should be properly completed in this situation.

Tips

The root cause of this problem is in interactive.Completion.scala which has a special way to handle the extension defs, as after desugaring, there is no trace of this definition in typed trees.
It is probably happening when decision whether to use typed or untyped path happens, or at adjustedPath creation site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:presentation-compiler Related to the presentation compiler module used by Metals and possibly other tools itype:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants