Skip to content
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

SI-8125 SI-8130 position fixes for presentation compiler #3337

Closed
wants to merge 3 commits into from

Conversation

dotta
Copy link
Contributor

@dotta dotta commented Jan 8, 2014

review by @retronym

@danchia This PR should make you happy ;-)

@retronym
Copy link
Member

retronym commented Jan 8, 2014

LGTM

But additional review, please, by @dragos, last seen in the vicinity of this code: 3415436

@dragos
Copy link
Contributor

dragos commented Jan 8, 2014

Looks like the test I added back then has failed...

@ghost ghost assigned retronym Jan 8, 2014
@dotta
Copy link
Contributor Author

dotta commented Jan 9, 2014

@dragos All the failures seem "expected", and the fix should be as simple as updating the tests with a transparent position (instead of an opaque one) for syntehtic apply. I'm going to do so now.

EDIT: Actually, while what I said above holds for the test t5064.scala, it may be not true for the other two applyDynamic tests. I'll have to understand why my change affects the position of applyDinamic Trees.

EDIT2: Alright, the reason why the applyDynamic tests fail is that there is another bug (https://issues.scala-lang.org/browse/SI-8130). It's easy to fix, and since the fix in this PR for SI-8125 requires SI-8130 to be fixed as well, I'm going to restructure this PR to contain a fix for both tickets. Hopefully, that's ok.

Hyperlinking on `d` should resolve to the declaration of `d`, not the
`applyDynamic` method in class `D`.
No member is returned by the completion test because the positions
assigned to Tree for the `A(` expression are incorrect. In particular,
the qualifier `A` should have an opaque range position, while it
currently has a transparent one (and that explains why no member is
returned in the test).
…icNamed`

* Tickets SI-8125 and SI-8130 turn out to be caused by the same underlying
issue, i.e., sythetic `apply` Tree where created with the wrong kind of
position. The initial fix (look at the first set of changes in
Typers.scala) caused a side-effect in the kind of positions assigned to
`applyDynamicNamed` synthetic Trees, which changed from transparent to
opaque positions. This was fixed by assigning transparent position for
synthetic `applyDynamicNamed` Trees (see the second set of changes in
Typers.scala).

* For test `t8125`, note that `def apply(a: Int): Int` is part of the
result returned by the completion test.

* For test `t8130`, note that hyperlinking on `d` now is correctly resolved
to the declaration of `d`, and not the `applyDynamic` method in class `D`.
@dotta
Copy link
Contributor Author

dotta commented Jan 9, 2014

There is a failing test now in scala-refactoring, I'm looking at it.

@dotta
Copy link
Contributor Author

dotta commented Jan 10, 2014

PLS REBUILD/pr-scala@82852d9

@scala-jenkins
Copy link

(kitty-note-to-self: ignore 32036581)
🐱 Roger! Rebuilding pr-scala for 82852d9. 🚨

@retronym
Copy link
Member

PLS REBUILD ALL

@scala-jenkins
Copy link

(kitty-note-to-self: ignore 32246166)
🐱 Roger! Rebuilding pr-scala for 93106d9, 24e8109, 82852d9. 🚨

@dotta
Copy link
Contributor Author

dotta commented Jan 14, 2014

@retronym this won't work until

  1. SI-8136 Replaced askTypeAt with askEnclosingTreesAt in CompilerControl #3358 is merged in 2.10.x, and 2.10.x is merged into master.
  2. At that point I need to update the Scala IDE codebase to use the new askEnclosingTreesAt instead of askTypeAt, otherwise some hyperlinking tests are failing after the position fix carried out in this PR (as I write, I'm preparing the PR for Scala IDE that uses the new askEnclosingTreesAt)

When the above two PR are merged, then this PR should finally get a green status.

@danchia
Copy link

danchia commented Jan 14, 2014

@dotta although I don't profess to know half of what's going on, this looks very promising for completions =)

@dotta
Copy link
Contributor Author

dotta commented Jan 14, 2014

@danchia It's only because you are missing context. Once you understand how (Range/Transparent)Position affects the IDE behavior, the changes in this PR makes a lot of sense. If you are interested in the subject, I'm happy to elaborate more in the scala-ide-dev ML ;-)

@dotta
Copy link
Contributor Author

dotta commented Jan 14, 2014

I need more work on #3358, and because this PR depends on the former, I think it's wise to not rush it. Therefore, you can consider this one as not targeting M8.

@gkossakowski
Copy link
Member

@dotta: what's the status of this PR?

@dotta
Copy link
Contributor Author

dotta commented Feb 7, 2014

@gkossakowski It needs more work and unfortunately I don't have time to allocate on this - work stealing is of course welcomed.

@retronym
Copy link
Member

retronym commented Feb 7, 2014

Okay, we'll close the PR for now. Let's push again for 2.11.1!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants