Skip to content

Conversation

Duhemm
Copy link
Contributor

@Duhemm Duhemm commented Aug 21, 2018

The first scenario described in #4978 is fixed by this PR. Fixing the second case (completion of renamed imports) requires #4977.

@@ -94,13 +94,22 @@ object Interactive {
private def safely[T](op: => List[T]): List[T] =
try op catch { case ex: TypeError => Nil }

private def addExtraImports(extraImports: List[untpd.Import], ctx: Context): Context = {
extraImports.foldLeft(ctx) { case (c, i) => c.importContext(i, i.symbol(c)) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.symbol on untyped tree?

@allanrenucci
Copy link
Contributor

I have an alternative fix in #4915: the REPL make sure to call completions with a context that is aware of the imports and contextOfPath then use this context as a base (instead of the run context) for the newly computed context

@allanrenucci
Copy link
Contributor

Closed in favour of #4915

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants