Skip to content

Tab-completion doesn't word on imported symbol in REPL #4978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Duhemm opened this issue Aug 21, 2018 · 0 comments
Closed

Tab-completion doesn't word on imported symbol in REPL #4978

Duhemm opened this issue Aug 21, 2018 · 0 comments

Comments

@Duhemm
Copy link
Contributor

Duhemm commented Aug 21, 2018

In the REPL, none of the following would be completed with tab-completion:

scala> import java.util.HashMap
scala> val foo: HashM<tab> // No completion is offered, expected: "HashMap"
scala> import java.util.{HashMap => RenamedImport}
scala> val foo: Rena<tab> // No completion is offered, expected: "RenamedImport"
Duhemm added a commit to dotty-staging/dotty that referenced this issue Aug 21, 2018
allanrenucci added a commit to dotty-staging/dotty that referenced this issue Aug 21, 2018
Completions used to pick the runContext as completion context. However
in the REPL, the run context does not hold the import informations
allanrenucci added a commit to dotty-staging/dotty that referenced this issue Aug 22, 2018
Completions used to pick the runContext as completion context. However
in the REPL, the run context does not hold the import informations
allanrenucci added a commit to dotty-staging/dotty that referenced this issue Aug 28, 2018
We used to collect user defined imports from the parsed tree and
insert them as untyped trees at the top of the REPL wrapper object.
This caused members shadowing issues.

We now introduce a phase in the REPL compiler that collects imports
after type checking and store them as typed tree. We can then create a
context with its imports set in the correct order and use it to compile
future expressions.

This also fixes scala#4978 by having user defined import in the run context.
Auto-completions somehow ignored them when they were part of the
untyped tree.
allanrenucci added a commit to dotty-staging/dotty that referenced this issue Aug 28, 2018
We used to collect user defined imports from the parsed tree and
insert them as untyped trees at the top of the REPL wrapper object.
This caused members shadowing issues.

We now introduce a phase in the REPL compiler that collects imports
after type checking and store them as typed tree. We can then create a
context with its imports set in the correct order and use it to compile
future expressions.

This also fixes scala#4978 by having user defined import in the run context.
Auto-completions somehow ignored them when they were part of the
untyped tree.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant