Skip to content

IDE: fix signature help for Java and Scala 2 methods #5927

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 3 commits into from
Feb 15, 2019

Conversation

smarter
Copy link
Member

@smarter smarter commented Feb 14, 2019

Asking for the signature of a method not defined in sources or in Tasty
used to throw an exception because the symbol passed to defPath must
have a span. The call to defPath was only used to determine which
parameters were implicit, but this can be done in an easier way by
checking isImplicitMethod, so we can get rid of it at no loss.

(note that right now launchIDE is broken, this is being fixed in #5917)

Asking for the signature of a method not defined in sources or in Tasty
used to throw an exception because the symbol passed to `defPath` must
have a span. The call to `defPath` was only used to determine which
parameters were implicit, but this can be done in an easier way by
checking `isImplicitMethod`, so we can get rid of it at no loss.
@smarter smarter force-pushed the fix/ide-signature-exception branch 2 times, most recently from bc87c99 to 6b01b5d Compare February 14, 2019 22:16
It's a hack, but this should be less confusing for students, and it's
only temporary until 2.13 is out.
@smarter smarter force-pushed the fix/ide-signature-exception branch from 6b01b5d to 804c31c Compare February 14, 2019 22:29
This is more legitimate than hiding CanBuildFrom since there's never any
reason to pass a DummyImplicit instance explicitly, and DummyImplicit is
used in the 2.13 standard library to avoid erased signature clashes
between overloads.
if (isNewCollections)
ctx.requiredClass("scala.<:<")
else
ScalaPredefModule.requiredClass("<:<")

def DummyImplicitClass(implicit ctx: Context): ClassSymbol =
Copy link
Contributor

Choose a reason for hiding this comment

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

For my own understanding: Why was this class moved?

Copy link
Member Author

@smarter smarter Feb 15, 2019

Choose a reason for hiding this comment

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

I moved it along with <:< and =:= in scala/scala#7350 to keep Predef as lean as possible, classes can be defined at the top-level so I didn't see why these ones in particular should be nested in Predef.

@odersky odersky assigned smarter and unassigned odersky Feb 15, 2019
@smarter smarter merged commit 844754f into scala:master Feb 15, 2019
@allanrenucci allanrenucci deleted the fix/ide-signature-exception branch February 15, 2019 15:21
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