Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 127987

Summary: [hovering] BIDI: wrong ordering of Hebrew text in tooltip code window
Product: [Eclipse Project] JDT Reporter: amir <bamir>
Component: TextAssignee: Dani Megert <daniel_megert>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.2 M6   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Screenshot of text in the Editor
none
Screenshot of text in hover
none
Screenshot of text in the Editor
none
Screenshot of text in hover none

Description amir CLA 2006-02-15 04:47:28 EST
1. Create a java project and java class including main method.
2. Type in the main method the following text: System.out.print("ABC" + DEF);
where capital are Hebrew characters.
2. Folding the region the main method, i.e click on the minus icon in the vertical left side of the editor to collapse the code. 
3. Hovering over the folded Java element (on the “+” icon).

Result: When peeking the hidden code the ordering is changed as following:
System.out.print("DEF + "ABC);

Expected result: The text in editor and text in code tooltip should be consistent.
Comment 1 Dani Megert CLA 2006-02-15 04:59:48 EST
Which build id?
How's the orientation in the editor?
Could you attach a screenshot with the editor and one with the hover? Thanks.
Comment 2 amir CLA 2006-02-15 05:22:17 EST
Created attachment 34757 [details]
Screenshot of text in the Editor
Comment 3 amir CLA 2006-02-15 05:23:03 EST
Created attachment 34758 [details]
Screenshot of text in hover
Comment 4 amir CLA 2006-02-15 05:25:42 EST
Build id:
Version: 3.2.0
Build id: I20051215-1506

When typing in editor, there is no LTR ordering. This kind of ordering occurs only in hover. 
Comment 5 Dani Megert CLA 2006-02-15 05:32:22 EST
What kind of attachments are these? They are scrambled when clicking on the links.
Comment 6 Tom Hofmann CLA 2006-02-15 05:44:57 EST
Created attachment 34759 [details]
Screenshot of text in the Editor

It's a jpeg.
Comment 7 Tom Hofmann CLA 2006-02-15 05:45:35 EST
Created attachment 34760 [details]
Screenshot of text in hover

It's a jpeg.
Comment 8 amir CLA 2006-02-15 05:49:28 EST
I don't know what's worng with these screenshots.
Anyway, you can click on Edit in the attachments table and then see it correctly.
If it doesn't help, I will try to attach it again 
Comment 9 Dani Megert CLA 2006-02-15 09:27:06 EST
The source hover uses RTL instead of LTR as the Java editor does.

We should promote the editor's orientation to the hover shell.
Comment 10 Dani Megert CLA 2006-02-15 12:50:49 EST
Also check the CustomSourceInformationControl which is used for the change hover.
Comment 11 Dani Megert CLA 2006-02-16 03:23:03 EST
*** Bug 128026 has been marked as a duplicate of this bug. ***
Comment 12 amir CLA 2006-02-16 03:34:01 EST
The source hover is not uses RTL, but uses LTR. The Java Editor is uses RTL which is good in such case. Thus, I think that the hover shell should be promote to the editor's orientation.
Comment 13 Dani Megert CLA 2006-02-16 03:44:19 EST
Amir, I you just swapped things in your last comment:
>The source hover is not uses RTL, but uses LTR. The Java Editor is uses RTL
The Java editor is LTR and the hover ist RTL.
Comment 14 Dani Megert CLA 2006-02-23 12:21:45 EST
Fixed in HEAD.
Available in builds > N20060223-0010.

Amir, can you verify the fix in next N-build or next I-build? Thanks.
Comment 15 amir CLA 2006-03-19 11:09:03 EST
I checked with Build id: I20060315-1200, but nothing has changed - problem is still exist.
Comment 16 Dani Megert CLA 2006-03-20 11:52:44 EST
Amir, really a good catch. Thanks for verifying this. While the orientation is correct we had a bug when setting up the document for the hover and hence it was not able to detect Java strings and hence it could not correctly render the BIDI segments.

Please try again in builds > N20060326-0010.
Comment 17 amir CLA 2006-04-11 10:16:18 EDT
1. I verified it with Build id: I20060331-2000, and it looks good in the hover. However, when I'm using CTRL+SHIFT+/ (for comment), the ordering is wrong again.

2. I have realized that hover itself should be in LTR direction and not RTL!
See an example in attached screensshot.
Comment 18 Dani Megert CLA 2006-04-11 10:22:08 EDT
Sorry, can't fully follow your last comment.

Is the hover now OK or not? If you comment code, is the code correct but not the hover? Is the hover again RTL instead of LTR?
Comment 19 Dani Megert CLA 2006-04-11 10:25:14 EDT
Just verified that the source hover is LTR (which is the intended behavior).
Comment 20 amir CLA 2006-04-11 10:42:57 EDT
No. I will explain:
I have noticed one change (a good one) in the new build that caused by your fix: this is in the hover poped up when hovering with mouse on the + icon. In this case the problem was fixed.
However, when I try on the same code line to commnet code (Ctrl+Shift+/), the problem was occured.

In a seperate note I tried to explain that I think the hover when hovering with mouse on the code itself, should be in LTR direction. At the moment it is RTL (as shown in last attachment). 
Comment 21 Dani Megert CLA 2006-04-11 10:49:33 EDT
>However, when I try on the same code line to commnet code (Ctrl+Shift+/), the
>problem was occured.
Only in the hover or also in the code?
Comment 22 Dani Megert CLA 2006-04-11 10:58:21 EDT
When hovering over the code you get a Javadoc and not a Source hover. Javadoc has to be RTL. The Source hover can be obtained by pressing 'Shift' while hovering. I just verified that this hover is correctly shown in LTR.

Please file new bug reports if you still see a problem. This bug was about the projection hover (i.e. when over the (+) folding icon) and about strings not shown correctly.

This has been fixed.
Comment 23 amir CLA 2006-04-11 10:59:58 EDT
I meant in the code itself.
Comment 24 Dani Megert CLA 2006-04-11 11:05:24 EDT
>I meant in the code itself.
OK, that's expected: we currently don't have special treatment for strings inside comments - only for strings in the code.
Comment 25 amir CLA 2006-04-17 06:34:56 EDT
Verified with Build id: I20060331-2000.


Just one question, Daniel. You wrote in comment #22:
> "When hovering over the code you get a Javadoc and not a Source hover. Javadoc
has to be RTL."
Why Javadoc has to be RTL? When class/method name contians BIDI text, the Javadoc hover is not readable in RTL ordering. 
Comment 26 Dani Megert CLA 2006-04-17 15:05:03 EDT
Because Javadoc is documentation an we assumed that documentation should be RTL. Is that wrong?
Comment 27 amir CLA 2006-05-07 08:47:47 EDT
This problem has been fixed.