@@ -35,6 +35,8 @@ import dotty.tools.dotc.core.Constants
3535import dotty .tools .dotc .core .TypeOps
3636import dotty .tools .dotc .core .StdNames
3737
38+ import java .util .logging .Logger
39+
3840/**
3941 * One of the results of a completion query.
4042 *
@@ -48,6 +50,8 @@ case class Completion(label: String, description: String, symbols: List[Symbol])
4850
4951object Completion :
5052
53+ private val logger = Logger .getLogger(this .getClass.getName)
54+
5155 def scopeContext (pos : SourcePosition )(using Context ): CompletionResult =
5256 val tpdPath = Interactive .pathTo(ctx.compilationUnit.tpdTree, pos.span)
5357 val completionContext = Interactive .contextOfPath(tpdPath).withPhase(Phases .typerPhase)
@@ -599,7 +603,11 @@ object Completion:
599603 val tpe = asDefLikeType(tree.typeOpt.dealias)
600604 termRef.denot.asSingleDenotation.mapInfo(_ => tpe)
601605 }
602- catch case NonFatal (_) => None
606+ catch case NonFatal (ex) =>
607+ logger.warning(
608+ s " Exception when trying to apply extension method: \n ${ex.getMessage()}\n ${ex.getStackTrace().mkString(" \n " )}"
609+ )
610+ None
603611
604612 def extractMemberExtensionMethods (types : Seq [Type ]): Seq [(TermRef , TermName )] =
605613 object DenotWithMatchingName :
@@ -703,7 +711,11 @@ object Completion:
703711
704712 interactiv.println(i " implicit conversion targets considered: ${conversions.toList}%, % " )
705713 conversions
706- } catch case NonFatal (_) => Set .empty
714+ } catch case NonFatal (ex) =>
715+ logger.warning(
716+ s " Exception when searching for implicit conversions: \n ${ex.getMessage()}\n ${ex.getStackTrace().mkString(" \n " )}"
717+ )
718+ Set .empty
707719
708720 /** Filter for names that should appear when looking for completions. */
709721 private object completionsFilter extends NameFilter :
0 commit comments