-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #2743: Fix hover problem #2744
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
Conversation
Also add an assert in isRef to track down a stackoverflow going infinitely often through this line. Hopefully the assert will track that down.
@@ -297,7 +297,7 @@ class DottyLanguageServer extends LanguageServer | |||
implicit val ctx = driver.currentCtx | |||
|
|||
val pos = sourcePosition(driver, uri, params.getPosition) | |||
val tp = Interactive.enclosingType(driver.openedTrees(uri), pos) | |||
val tp = Interactive.enclosingType(driver.openedTrees.getOrElse(uri, Nil), pos) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's many calls to openedTrees(uri)
in this file, so instead of fixing it here I would change the definition of openedTrees
.
@smarter I followed your suggestion. What about openedFiles? I thought of having that return a NoSource as default, but got pause by this comment in InteractiveDriver:
So we want it to throw that exception? |
No that comment was more here to make me remember to decide how to handle the error cases, but it looks like I didn't :) |
OK, openedFiles gets a default as well. |
@@ -125,7 +125,7 @@ object Types { | |||
def isRef(sym: Symbol)(implicit ctx: Context): Boolean = stripAnnots.stripTypeVar match { | |||
case this1: TypeRef => | |||
this1.info match { // see comment in Namer#typeDefSig | |||
case TypeAlias(tp) => tp.isRef(sym) | |||
case TypeAlias(tp) => assert((tp ne this) && (tp ne this), tp); tp.isRef(sym) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same condition repeated twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be this1. I think it was a merge breakage.
Also add an assert in isRef to track down a stackoverflow going infinitely often
through this line. Hopefully the assert will track that down.