Skip to content

Missing Context bound completions in extension constructs #19971

Closed
@rochala

Description

@rochala

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.

Metadata

Metadata

Assignees

Labels

area:presentation-compilerRelated to the presentation compiler module used by Metals and possibly other toolsitype:bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions