Skip to content

Fix #6208, #6605: Properly support toplevel defs in the IDE #6611

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

Merged
merged 1 commit into from
Jun 5, 2019

Conversation

smarter
Copy link
Member

@smarter smarter commented Jun 5, 2019

Toplevel defs are enclosed in an object named <source>$package by
Desugar#packageDef, this didn't work correctly in the IDE because the
name of the VirtualFile was the whole URI of the file. In particular
this lead to double-vision problems ("cannot merge ...") when the
toplevel definition was also present on the classpath.

@smarter smarter added this to the 0.16 Tech Preview milestone Jun 5, 2019
@smarter smarter requested a review from odersky June 5, 2019 13:56
Toplevel defs are enclosed in an object named `<source>$package` by
`Desugar#packageDef`, this didn't work correctly in the IDE because the
name of the VirtualFile was the whole URI of the file. In particular
this lead to double-vision problems ("cannot merge ...") when the
toplevel definition was also present on the classpath.

Also one of the overload of Driver#compile to Driver#compileFromString
for clarity and give better names to VirtualFile it creates since they
could also leak into the names of generated objects.
@smarter smarter force-pushed the fix-ide-toplevel branch from 153b2f2 to 91950d1 Compare June 5, 2019 15:18
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

Yes I noted that behavior and was puzzled by it.

@odersky odersky merged commit 9465001 into scala:master Jun 5, 2019
@allanrenucci allanrenucci deleted the fix-ide-toplevel branch June 5, 2019 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants