Bug 571121 - code mining text drawn (on top of actual text) before line spacing is set
Summary: code mining text drawn (on top of actual text) before line spacing is set
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.17   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.23   Edit
Assignee: Mickael Istria CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 572387 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-02-11 06:30 EST by Lars Vogel CLA
Modified: 2021-11-19 01:06 EST (History)
7 users (show)

See Also:


Attachments
Screencast (386.64 KB, image/gif)
2021-02-15 06:32 EST, Lars Vogel CLA
no flags Details
Overlapped Rendering (229.01 KB, image/png)
2021-03-26 14:51 EDT, Gayan Perera CLA
no flags Details
screencast_codemining_rendering (455.51 KB, video/mp4)
2021-03-27 09:22 EDT, Gayan Perera CLA
no flags Details
correctly rendered code (374.75 KB, image/png)
2021-03-28 05:15 EDT, Gayan Perera CLA
no flags Details
rendering issue 1 (375.03 KB, image/png)
2021-03-28 05:16 EDT, Gayan Perera CLA
no flags Details
rendering issue 2 (366.46 KB, image/png)
2021-03-28 05:17 EDT, Gayan Perera CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2021-02-11 06:30:36 EST
The editor content is frequently full with cheese if I activate code minings.

I have not seen that in the last releases, maybe something changed recently? I know some performance improvements were done.
Comment 1 Lars Vogel CLA 2021-02-11 06:31:00 EST
Eclipse SDK
Version: 2021-03 (4.19)
Build id: I20210208-1800
OS: Windows 10, v.10.0, x86_64 / win32
Java version: 15.0.1
Comment 2 Christoph Laeubrich CLA 2021-02-11 06:51:59 EST
Maybe a screenshot can help? I have no clue what kind of cheese you are referring to :-)

There was a bug the has performed code-mining computation multiple times in a row, that might has hidden some glitches that are now more visible?
Comment 3 Lars Vogel CLA 2021-02-11 07:38:41 EST
(In reply to Christoph Laeubrich from comment #2)
> Maybe a screenshot can help? I have no clue what kind of cheese you are
> referring to :-)

As soon as I press "Take screnshot" in the windows screenshot tool the editor updates itself. I think it is scared of getting exposed. :-) I tried to make a screencast later.
Comment 4 Christoph Laeubrich CLA 2021-02-11 08:21:07 EST
Try [Prnt] / [Drucken] key instead and insert it into MS Paint afterwards from the clipboard.
Comment 5 Mickael Istria CLA 2021-02-11 08:23:05 EST
I also see some issues, not sure they're the same ones though.
The issues I see is that sometimes, the code mining text is printed over the actual line text. I think it would be relatively easy to put a guard in the drawing part to verify we draw only when the line height is properly set.
Comment 6 Lars Vogel CLA 2021-02-11 08:41:05 EST
(In reply to Mickael Istria from comment #5)
> I also see some issues, not sure they're the same ones though.
> The issues I see is that sometimes, the code mining text is printed over the
> actual line text. I think it would be relatively easy to put a guard in the
> drawing part to verify we draw only when the line height is properly set.

+1, yes the code mining text is printed over the actual line text.
Comment 7 Christoph Laeubrich CLA 2021-02-11 09:05:49 EST
What I have observed if there are really many minings and one scrolls fast it sometimes draws the minings over the text but that might be a different issue?
Comment 8 Lars Vogel CLA 2021-02-11 09:30:17 EST
(In reply to Christoph Laeubrich from comment #7)
> What I have observed if there are really many minings and one scrolls fast
> it sometimes draws the minings over the text but that might be a different
> issue?

I don't scroll, I only edit and suddenly I get cheese.
Comment 9 Eclipse Genie CLA 2021-02-11 16:37:36 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.text/+/176155
Comment 10 Mickael Istria CLA 2021-02-12 08:42:57 EST
This should be fixed now. Please reopen if you still see this problem in next I-Build.
Comment 12 Lars Vogel CLA 2021-02-15 06:32:54 EST
Created attachment 285554 [details]
Screencast

Thanks Mickael, I can still see "cheese", I re-tested on Linux.
Comment 13 Lars Vogel CLA 2021-02-15 06:33:15 EST
.
Comment 14 Kalyan Prasad Tatavarthi CLA 2021-03-02 02:05:40 EST
Moving to 4.20. Please re target as required.
Comment 15 Gayan Perera CLA 2021-03-26 14:51:00 EDT
Created attachment 285962 [details]
Overlapped Rendering
Comment 16 Gayan Perera CLA 2021-03-27 09:15:12 EDT
Take the following example

package app;

import java.io.File;
import java.nio.file.Paths;
import java.util.Set;

public class HelloTest {
	
	private File file;
	
	@org.junit.Test
	public void testHello() {
		Set<String> strings;
		this.file = new File("");
		Paths
	}
}


Now make sure your imports are collapase, and then remove the "Paths" reference and organize imports.

The source code rendering is not done properly to reflect the changes. This happens on when codeminings are available. I will attache a video which shows it in action
Comment 17 Gayan Perera CLA 2021-03-27 09:22:08 EDT
Created attachment 285963 [details]
screencast_codemining_rendering
Comment 18 Gayan Perera CLA 2021-03-27 09:23:01 EDT
@Mickael let me know if you need more information or support in verifying fixes.
Comment 19 Mickael Istria CLA 2021-03-28 00:53:19 EDT
Can you please precise "The source code rendering is not done properly to reflect the changes" ? Without details, it's hard to know where to focus attention.
Comment 20 Gayan Perera CLA 2021-03-28 05:15:59 EDT
Created attachment 285964 [details]
correctly rendered code
Comment 21 Gayan Perera CLA 2021-03-28 05:16:39 EDT
Created attachment 285965 [details]
rendering issue 1

After organizing imports and moving your mouse this the first issue you can see
Comment 22 Gayan Perera CLA 2021-03-28 05:17:17 EDT
Created attachment 285966 [details]
rendering issue 2

After moving your mouse and clicking on the editor, this happens.
Comment 23 Mickael Istria CLA 2021-03-28 09:50:16 EDT
@Gayan: those seem to be different issues as the one that triggered this bug report. Please open specific tickets for each issue.
Comment 24 Rolf Theunissen CLA 2021-03-29 05:58:59 EDT
*** Bug 572387 has been marked as a duplicate of this bug. ***
Comment 25 Christoph Laeubrich CLA 2021-03-29 06:06:30 EDT
I don't know how the codeminings work internally to calculate the required spaces and so on but I recently came across a bug (it might be worth to try to make a repoducer) on windows where creating a temporary GC+painting on it under windows yields very strange results: 
The painted parts appear randomly on the screen, painting even on the title-bar and so on. Interestingly on some setups it help to switch off the second monitor while on my laptop it was evident always.

So I wonder if the effect is visible on windows or also on linux/mac?
Comment 26 Ed Willink CLA 2021-03-29 06:30:50 EDT
The Bug 572387 duplicate complains that

a) Code Minings that may be useful for the *.target editor infect the Text and Generic Text Editors that should be more trustworthy.

b) that the infection in the Text Editor is initially an overtype giving unreadable text in the screen shot but which clarifies after a redisplay separates the overtyped lines.
Comment 27 Christoph Laeubrich CLA 2021-03-29 06:58:15 EDT
See Bug 572400 for demonstration of bad GC behavior under windows. I discovered this while I'm trying to measure text sizes "offscreen" so maybe Codeminings try to use similar and hit this bug also?
Comment 28 Gayan Perera CLA 2021-03-29 10:18:13 EDT
(In reply to Mickael Istria from comment #23)
> @Gayan: those seem to be different issues as the one that triggered this bug
> report. Please open specific tickets for each issue.

Sure i will report a different bug with attachments. And this happens also when the file is small. Basically when the top of the file where your imports are no inside the view port.
Comment 29 Gayan Perera CLA 2021-04-20 13:27:45 EDT
new bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=573016
Comment 30 Kalyan Prasad Tatavarthi CLA 2021-06-04 00:56:34 EDT
Mass move out of 4.20
Comment 31 Kalyan Prasad Tatavarthi CLA 2021-11-19 01:06:27 EST
Mass move out of 4.22