| Summary: | [Hover] Folding (closing) a comment section causes hovers over annotations to appear in the wrong spot | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Eric Moffatt <emoffatt> |
| Component: | Client | Assignee: | Curtis Windatt <curtis.windatt.public> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | curtis.windatt.public, Silenio_Quarti |
| Version: | unspecified | ||
| Target Milestone: | 10.0 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 450152 | ||
|
Description
Eric Moffatt
To reproduce: open tooltip.js and hover over one of the unused 'event' annotations (roughtly line 64). Note that the tooltip appears directly below the annotation. Now go to the top of the file and close the copyright comment and then go back a re-hover over the initial annotation...now the annotation appears well below (and offset in X) where it should be... *** Bug 463018 has been marked as a duplicate of this bug. *** http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=03b26d43b3346b34b6ab9a1648e65f0d44127263 Fixed in master The offsets given for annotations and hovering are from the text model that is not adjusted for folded contents (that would be projection text model). The fix is to map the offsets to the parent model. It still appears to be failing in some of my test files with multiple comment sections. Reopening. In javascript, the contributed hovers can provide more accurate offsets for the token the user is hovering over (ex: selecting the entire function name including punctuation vs using the closest word). The offsets calculated in the hover, using a passed in textView, already account for the collapsed comments. Silenio mentioned that annotation offsets are always in the base model. We just need to be consistent about which model we use where. Opened Bug 473966 because the JS hovers no longer provide hints on the anchor area. There is a different code path when calculating the enclosing word that uses findNextOffset(). findNextOffset needs to have the offsets adjusted to the projection model or it throws exceptions, Bug 473956. http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=ad3a8a17cbbb4d65f64a8b48bd44d73826e3f40e This fix will adjust the offsets for the folded comments in both scenarios (plug-in provides offsets hints or using findNextOffset to get the enclosing word). |