diff --git a/compiler/src/dotty/tools/dotc/interactive/Completion.scala b/compiler/src/dotty/tools/dotc/interactive/Completion.scala index bb552191fc36..8c19671293e0 100644 --- a/compiler/src/dotty/tools/dotc/interactive/Completion.scala +++ b/compiler/src/dotty/tools/dotc/interactive/Completion.scala @@ -300,7 +300,8 @@ object Completion { case name: TermName if include(denot, name) => Some((denot, name)) case _ => None - types.flatMap { tpe => + types.flatMap { tp => + val tpe = tp.widenExpr tpe.membersBasedOnFlags(required = ExtensionMethod, excluded = EmptyFlags) .collect { case DenotWithMatchingName(denot, name) => TermRef(tpe, denot.symbol) -> name } } diff --git a/compiler/test/dotty/tools/repl/TabcompleteTests.scala b/compiler/test/dotty/tools/repl/TabcompleteTests.scala index cbf267e7c846..540147bcd211 100644 --- a/compiler/test/dotty/tools/repl/TabcompleteTests.scala +++ b/compiler/test/dotty/tools/repl/TabcompleteTests.scala @@ -132,4 +132,10 @@ class TabcompleteTests extends ReplTest { @Test def i6415 = fromInitialState { implicit s => assertEquals(List("Predef"), tabComplete("object Foo { opaque type T = Pre")) } + + @Test def i12600 = fromInitialState { implicit s => + assertEquals(List("select", "show", "simplified"), + tabComplete("import quoted.* ; def fooImpl(using Quotes): Expr[Int] = { import quotes.reflect.* ; TypeRepr.of[Int].s")) + } + } diff --git a/language-server/test/dotty/tools/languageserver/CompletionTest.scala b/language-server/test/dotty/tools/languageserver/CompletionTest.scala index 615e8f3b4049..5aa12f425371 100644 --- a/language-server/test/dotty/tools/languageserver/CompletionTest.scala +++ b/language-server/test/dotty/tools/languageserver/CompletionTest.scala @@ -842,4 +842,19 @@ class CompletionTest { |object Main { "abc".xx${m1} }""".withSource .completion(m1, Set()) } + + @Test def i13365: Unit = { + code"""|import scala.quoted._ + | + |object Test { + | def test(using Quotes)(str: String) = { + | import quotes.reflect._ + | val msg = Expr(str) + | val printHello = '{ print("sdsd") } + | val tree = printHello.asTerm + | tree.sh${m1} + | } + |}""".withSource + .completion(m1, Set(("show",Method, "(using x$2: x$1.reflect.Printer[x$1.reflect.Tree]): String"))) + } }