From e9a4aaa1ffcfc1af47d5da9ddc136fd57ab3ae98 Mon Sep 17 00:00:00 2001 From: Kien Dang Date: Tue, 5 Nov 2024 12:04:31 +0800 Subject: [PATCH] Fix a Scala 3 completion error --- .../dotty/ammonite/compiler/AmmCompletion.scala | 3 ++- .../scala-3.3.2+/dotty/ammonite/compiler/AmmCompletion.scala | 3 ++- .../scala-3.4.2+/dotty/ammonite/compiler/AmmCompletion.scala | 3 ++- .../scala-3.5.0+/dotty/ammonite/compiler/AmmCompletion.scala | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/amm/compiler/src/main/scala-3.0.0-3.3.1/dotty/ammonite/compiler/AmmCompletion.scala b/amm/compiler/src/main/scala-3.0.0-3.3.1/dotty/ammonite/compiler/AmmCompletion.scala index e9df76d95..3b6130396 100644 --- a/amm/compiler/src/main/scala-3.0.0-3.3.1/dotty/ammonite/compiler/AmmCompletion.scala +++ b/amm/compiler/src/main/scala-3.0.0-3.3.1/dotty/ammonite/compiler/AmmCompletion.scala @@ -6,6 +6,7 @@ import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.Denotations.SingleDenotation import dotty.tools.dotc.core.Flags._ import dotty.tools.dotc.core.Names.Name +import dotty.tools.dotc.core.Phases import dotty.tools.dotc.core.Symbols.{Symbol, defn} import dotty.tools.dotc.interactive.{Completion, Interactive} import dotty.tools.dotc.util.SourcePosition @@ -23,7 +24,7 @@ object AmmCompletion extends AmmCompletionExtras { path, dependencyCompleteOpt, enableDeep - )(using Interactive.contextOfPath(path)) + )(using Interactive.contextOfPath(path).withPhase(Phases.typerPhase)) } def computeCompletions( diff --git a/amm/compiler/src/main/scala-3.3.2+/dotty/ammonite/compiler/AmmCompletion.scala b/amm/compiler/src/main/scala-3.3.2+/dotty/ammonite/compiler/AmmCompletion.scala index 622adc9a4..b6481b158 100644 --- a/amm/compiler/src/main/scala-3.3.2+/dotty/ammonite/compiler/AmmCompletion.scala +++ b/amm/compiler/src/main/scala-3.3.2+/dotty/ammonite/compiler/AmmCompletion.scala @@ -6,6 +6,7 @@ import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.Denotations.SingleDenotation import dotty.tools.dotc.core.Flags._ import dotty.tools.dotc.core.Names.Name +import dotty.tools.dotc.core.Phases import dotty.tools.dotc.core.Symbols.{Symbol, defn} import dotty.tools.dotc.interactive.{Completion, Interactive} import dotty.tools.dotc.util.SourcePosition @@ -23,7 +24,7 @@ object AmmCompletion extends AmmCompletionExtras { path, dependencyCompleteOpt, enableDeep - )(using Interactive.contextOfPath(path)) + )(using Interactive.contextOfPath(path).withPhase(Phases.typerPhase)) } def computeCompletions( diff --git a/amm/compiler/src/main/scala-3.4.2+/dotty/ammonite/compiler/AmmCompletion.scala b/amm/compiler/src/main/scala-3.4.2+/dotty/ammonite/compiler/AmmCompletion.scala index e9df76d95..3b6130396 100644 --- a/amm/compiler/src/main/scala-3.4.2+/dotty/ammonite/compiler/AmmCompletion.scala +++ b/amm/compiler/src/main/scala-3.4.2+/dotty/ammonite/compiler/AmmCompletion.scala @@ -6,6 +6,7 @@ import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.Denotations.SingleDenotation import dotty.tools.dotc.core.Flags._ import dotty.tools.dotc.core.Names.Name +import dotty.tools.dotc.core.Phases import dotty.tools.dotc.core.Symbols.{Symbol, defn} import dotty.tools.dotc.interactive.{Completion, Interactive} import dotty.tools.dotc.util.SourcePosition @@ -23,7 +24,7 @@ object AmmCompletion extends AmmCompletionExtras { path, dependencyCompleteOpt, enableDeep - )(using Interactive.contextOfPath(path)) + )(using Interactive.contextOfPath(path).withPhase(Phases.typerPhase)) } def computeCompletions( diff --git a/amm/compiler/src/main/scala-3.5.0+/dotty/ammonite/compiler/AmmCompletion.scala b/amm/compiler/src/main/scala-3.5.0+/dotty/ammonite/compiler/AmmCompletion.scala index 963211595..5e9746459 100644 --- a/amm/compiler/src/main/scala-3.5.0+/dotty/ammonite/compiler/AmmCompletion.scala +++ b/amm/compiler/src/main/scala-3.5.0+/dotty/ammonite/compiler/AmmCompletion.scala @@ -6,6 +6,7 @@ import dotty.tools.dotc.core.Contexts._ import dotty.tools.dotc.core.Denotations.SingleDenotation import dotty.tools.dotc.core.Flags._ import dotty.tools.dotc.core.Names.Name +import dotty.tools.dotc.core.Phases import dotty.tools.dotc.core.Symbols.{Symbol, defn} import dotty.tools.dotc.interactive.{Completion, Interactive} import dotty.tools.dotc.util.SourcePosition @@ -23,7 +24,7 @@ object AmmCompletion extends AmmCompletionExtras { path, dependencyCompleteOpt, enableDeep - )(using Interactive.contextOfPath(path)) + )(using Interactive.contextOfPath(path).withPhase(Phases.typerPhase)) } def computeCompletions(