-
Notifications
You must be signed in to change notification settings - Fork 188
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
fix LineHeaderCodeMining redraw logic on empty lines #2133
fix LineHeaderCodeMining redraw logic on empty lines #2133
Conversation
Test Results 1 209 files - 1 1 209 suites - 1 1h 4m 8s ⏱️ + 9m 23s Results for commit c9a1c2d. ± Comparison against base commit 50061d4. This pull request skips 3 tests.
♻️ This comment has been updated with latest results. |
Can somebody answer this question? |
The jface.text (none-test)-bundle does not have any dependencies to org.eclipse.ide. Only to org.eclipse.swt, org.eclipse.jface and org.eclipse.core.runtime. And org.eclipse.swt also only has basic dependencies (to swt and equinox). @merks, @mickaelistria What do you think? |
Yes, better to move/have the test somewhere that already has the necessary dependencies. |
111abe8
to
a6fc392
Compare
Thanks a lot for the clarification. I moved the test to org.eclipse.ui.editors.tests. |
a6fc392
to
ff5ea3f
Compare
build is failing with
I don't understand this. Is this an infrastructure issue? |
ff5ea3f
to
70ca125
Compare
One of the build errors is due to eclipse-pde/eclipse.pde#1310. |
@tobiasmelcher: Looks like your changes broke org.eclipse.ui.editors.tests.SegmentedModeTest |
70ca125
to
1195450
Compare
thanks a lot for pointing me to this test error. Should be now fixed with 1195450 |
@HeikoKlare: Is this good to go? I am still not able to understand why "pr-head" fails |
The log shows:
I guess this is because the PR branch is not rebased on current master and |
CodeMinings on empty lines and at end of line were not drawn after calling ISourceViewerExtension5#updateCodeMinings. Reason: InlinedAnnotationDrawingStrategy#draw triggered call StyledText#redrawRange with length = 0 which is ignored by SWT and no redraw event was triggered
1195450
to
c9a1c2d
Compare
I think this is good to be merged. |
LineHeaderCodeMinings on empty lines were not drawn after calling ISourceViewerExtension5#updateCodeMinings.
Reason: InlinedAnnotationDrawingStrategy#draw triggered call StyledText#redrawRange with length = 0 which is ignored by SWT and no redraw event was triggered
CodeMiningPdeTest is documenting the problem scenario. It opens a plain text editor and the registered provider org.eclipse.jface.text.tests.codemining.CodeMiningTestProvider wants to contribute code minings.
The StaticContentLineCodeMining at line 1, column 1 with label 'mining' will be immediately rendered when the text editor is opened. It is used as indication in the unit test to verify that the text editor is opened and the code minings are all loaded and rendered properly.
Afterwards the global variable
CodeMiningTestProvider.provideLineHeaderMining= true;
is set which lets the provider also return a LineHeaderCodeMining at the second line. The second line has no text and is empty (there is only one \n character).The unit test is then calling
((ISourceViewerExtension5) viewer).updateCodeMinings();
with the goal to make the additional LineHeaderCodeMining visible.This was not working before and this pull request will fix the scenario.
I hope you can follow the explanation and understand how this pull request wants to fix this scenario.
The redrawRange call in org.eclipse.jface.text.source.inlined.InlinedAnnotationDrawingStrategy did not trigger a repaint event when length has value 0. The pull request sets the length value to the line delimiter length (value 1 in in the unit test)
One question to the PDE test. Is it ok to add an additional PDE test in org.eclipse.jface.text.tests? I needed to add a dependency to the plugins org.eclipse.core.resources and org.eclipse.ui.ide so that the text editor could be opened in the unit test. Is that ok?