Community
Participate
Working Groups
Created attachment 249325 [details] screenshot 1. Open a JS file 2. Enable Mark Occurrences 3. Put the cursor over an occurrence. You end up with an unhelpful hover showing the same code you're already looking at (see screenshot).
I think the intention with the projection hover was so if you hover on the rulers you can see the line of code it is talking about. We don't yet track where the annotation comes from (left ruler, right ruler, text). In Bug 453554 we want to use this info to not display quickfixes when hovering over the left ruler.
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=dae14bdad766aef9a457ed733a9e7b1d2a144061 Fixed in master Now that I have context of the tooltip source, it no longer displays the projection text if you are hovering in the editor. It still displays if you hover over the ruler.
Curtis, I've reverted this change since it broke most of the rest of the hovers... The root cause was an interaction between the new 'context' field you added and some existing code about line ~284 in tooltip.js Mike has a suggested fix wher we change that code to look like this.. if (this.hover && info.offset !== undefined && !contents) { var context; if (info.context){ context = info.context; context.offset = info.offset; } else { context = {offset: info.offset}; } this._hoverInfo = this.hover.computeHoverInfo(context); } Rather than just commit that fix I'd prefer to go over the logic a bit first (i.e. was the clash with the existing 'context' accidental...).
(In reply to Eric Moffatt from comment #3) > Mike has a suggested fix wher we change that code to look like this.. This would be a better fix: if (this.hover && info.offset !== undefined && !contents) { var context = Object.create(null); if (info.context){ context = info.context; } context.offset = info.offset; this._hoverInfo = this.hover.computeHoverInfo(context); }
(In reply to Michael Rennie from comment #4) > This would be a better fix: > > if (this.hover && info.offset !== undefined && !contents) { > var context = Object.create(null); > if (info.context){ > context = info.context; > } > context.offset = info.offset; > this._hoverInfo = this.hover.computeHoverInfo(context); > } http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=4b933ea8703c45e3f0342529f3a9c4377b21506f Used this logic, reapplied my fix and tested js hovers, js nav hovers, css hovers, annotations in the ruler, diff and blame.