Bug 545037 - [bidi] Wrong text direction for sample code in content assist panel
Summary: [bidi] Wrong text direction for sample code in content assist panel
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.11   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-04 20:53 EST by Jin Shi CLA
Modified: 2023-04-03 09:12 EDT (History)
2 users (show)

See Also:


Attachments
wrong text direction for sample code of content assist (14.49 KB, image/png)
2019-03-04 20:53 EST, Jin Shi CLA
no flags Details
Bug 545037 - pseudo translations (52.92 KB, image/png)
2019-03-06 21:08 EST, Kit Lo CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jin Shi CLA 2019-03-04 20:53:48 EST
Created attachment 277763 [details]
wrong text direction for sample code of content assist

Version:
I20190207-1800

Issue:
The source code lines in content assist panel should have a LTR text direction thus the code will be readable.

How to reproduce:
Create service provider method
https://www.eclipse.org/eclipse/news/4.11/jdt.php#service-provider-quick-fix
Comment 1 Dani Megert CLA 2019-03-06 09:42:24 EST
Usually the additional info is considered normal text. We also treat Javadoc info the same. Therefore the RTL orientation is correct.

I would assume that one could fix this in the translations.

Kit?
Comment 2 Kit Lo CLA 2019-03-06 21:08:30 EST
Created attachment 277790 [details]
Bug 545037 - pseudo translations

Dani, I tested the scenario with pseudo translations. See attachment.

It's true that translator could use Unicode right-to-left mark (RLM) or left-to-right mark (LRM) to fix the "normal text" in the additional info popup. However, the "preview code" for this proposal is generated (not externalized). The only externalized string is the TODO comment. Translator could not add RLM or LRM to fix this "preview code".

Is it possible to add a check when generating the "preview code" and set the text orientation to be the same as the editor?
Comment 3 Dani Megert CLA 2019-03-19 04:19:56 EDT
(In reply to Kit Lo from comment #2)
> Created attachment 277790 [details]
> Bug 545037 - pseudo translations
> 
> Dani, I tested the scenario with pseudo translations. See attachment.
> 
> It's true that translator could use Unicode right-to-left mark (RLM) or
> left-to-right mark (LRM) to fix the "normal text" in the additional info
> popup. However, the "preview code" for this proposal is generated (not
> externalized). The only externalized string is the TODO comment. Translator
> could not add RLM or LRM to fix this "preview code".
I see.


> Is it possible to add a check when generating the "preview code" and set the
> text orientation to be the same as the editor?
The problem is that many Quick Assists/Fixes do have natural text (like Javadoc) that's why we use RTL direction for that shell. We would have to fully externalize all the additional infos so that the (preview) code can be injected. Given it is like that since day one I suggest to defer this.
Comment 4 Eclipse Genie CLA 2021-03-09 14:14:03 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 5 Eclipse Genie CLA 2023-04-03 09:12:20 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.