Community
Participate
Working Groups
Created attachment 282658 [details] MethodQuickDiffError Quick Diff highlights code mining lines instead of the source code line. This happens when changing a method signature which has header code mining like unit tests code mining for example.
In the screenshot you can see that the quick diff highlight the header code mining line instead of the actual source code line in the method signature.
Seems like the CodeMiningHeaders are not taken into account when calculating the widgetLine where the Quick diff is painted. @Mickael @Angelo didn't we handled this scenario when we introduce codeminng into Eclipse?
(In reply to Gayan Perera from comment #2) > Seems like the CodeMiningHeaders are not taken into account when calculating > the widgetLine where the Quick diff is painted. @Mickael @Angelo didn't we > handled this scenario when we introduce codeminng into Eclipse? Many "old" pieces of code in Eclipse Text framework do assume that all lines are same standard height and have built on top of that assumptions. Code Mining has changed the habits and reveals some limitations here and there about those faulty parts of the legacy code. It was expected that there would be such glitches, and many were found before code minings were enabled by default, but some were missed and need to be fixed now. This marker is one of them ;)
@Mickael Do you have time to provide a fix? Or can you point where to look at to see a possible fix?
(In reply to Gayan Perera from comment #4) > @Mickael > Do you have time to provide a fix? Not really, I'm dealing with a bunch of other stuff that are higher prioriy to me. > Or can you point where to look at to see a possible fix? I don't know, sorry. That would require to read the code of Quickdiff to see what it actually uses and how. It's most likely somewhere in eclipse.platform.team repo, in the org.eclipse.compare bundle.
I think the problem is at org.eclipse.jface.text.JFaceTextUtil.computeLineHeight(StyledText, int) I guess here the widget has more line than the model right? So is the intended way to treat these virtual lines added for codemining to be connected with the model like as well? So for example the codemining line and actual code line should be highlighted is it?
(In reply to Gayan Perera from comment #6) > I guess here the widget has more line than the model right? So is the > intended way to treat these virtual lines added for codemining to be > connected with the model like as well? So for example the codemining line > and actual code line should be highlighted is it? No, the code mining are actually a single line on the widget. Code Minings manager change the line height to leave room for code minings and then print extra info, but it's still one (bigger) line, and the content is still the actual content of the line. The widget doesn't have a clue nor care about whether some code mining are drawn or not.