-
Notifications
You must be signed in to change notification settings - Fork 1.1k
IDE: Cannot navigate from left operand of a right-associative infix op #4498
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
Comments
Correction: The fault seems to lie with infix operators, not varargs. If I just write |
|
Duhemm
added a commit
to dotty-staging/dotty
that referenced
this issue
May 11, 2018
Consider the following snippet: ``` val lst = new A :: Nil ``` This is rewritten as: ``` val lst = { val x$0 = new A Nil.::(x$0) } ``` During lifting, we need to assign positions to the trees. We were assigning the position of `new A` in the original code to `x$0` in `Nil.::(x$0)`, and the original position of `new A` to `val x$0 = new A` with a zero-extent. Still considering this snippet, this means that when trying to go to the definition on `new A`, the IDE would think that the user tried to go to the definition of `x$0`, because the IDE would look for the matching tree by position. This commit changes this so that the lifted definition (`val x$0 = new A`) gets the position of the original expression, and the reference gets a synthetic, zero-extent position. With this change, the IDE correctly finds the right tree when selecting `new A` in the original code. Fixes scala#4498
odersky
added a commit
that referenced
this issue
May 11, 2018
Fix #4498: Go to definition in lifted expressions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
dotc.Compiler
, try to navigate from the phases list to the individual phases. E.g. goto definition on "ElimRepeated" gives "no definition found". However, if I copy theElimRepeated
identifier outside the list, navigation works as expected.The text was updated successfully, but these errors were encountered: