Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions compiler/src/dotty/tools/dotc/interactive/Completion.scala
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,9 @@ object Completion:

// 1. The extension method is visible under a simple name, by being defined or inherited or imported in a scope enclosing the reference.
val extMethodsInScope = scopeCompletions.names.toList.flatMap:
case (name, denots) => denots.collect:
case d: SymDenotation if d.isTerm && d.termRef.symbol.is(Extension) => (d.termRef, name.asTermName)
case (name, denots) =>
denots.collect:
case d if d.isTerm && d.symbol.is(Extension) => (d.symbol.termRef, name.asTermName)

// 2. The extension method is a member of some given instance that is visible at the point of the reference.
val givensInScope = ctx.implicits.eligible(defn.AnyType).map(_.implicitRef.underlyingRef)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2275,3 +2275,16 @@ class CompletionSuite extends BaseCompletionSuite:
|""".stripMargin,
"test: Int"
)

@Test def `macros` =
check(
"""
|object Macro:
| import scala.quoted.*
| def dbgImpl[A](a: Expr[A])(using Quotes): Expr[A] =
| import quotes.reflect.*
| a.asTer@@
|
|""".stripMargin,
"asTerm: Term"
)
Loading