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

Bug 263817

Summary: [formatter] Provide separate "reindent block" and "wrap comment" commands
Product: [Eclipse Project] JDT Reporter: Jeffrey Yasskin <jyasskin>
Component: CoreAssignee: JDT Core Triaged <jdt-core-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: frederic_fusier
Version: 3.4   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard: stalebug

Description Jeffrey Yasskin CLA 2009-02-05 12:13:44 EST
The Source|Format command seems to be permanently broken (see bugs like 59891, 87185, and 109381 which have been open for years and have been postponed again past 3.5). Until it actually makes sense to use the Format command, you should provide options like Emacs, which lets you say "reindent this line" (with <tab>), "reindent this region without changing any line breaks" (with C-M-\), or "word wrap the surrounding comment" (with M-q). For the second, reindenting the whole file when nothing's selected would be fine but not essential, and for the third, re-wrapping the surrounding expression when not in a comment would be fine but not essential.

Thanks!
Comment 1 Frederic Fusier CLA 2009-02-06 04:55:07 EST
Unless you have a specific test case showing the contrary, point 2) is already in 3.5 using the 'Never join lines' preference in 'Line Wrapping' tab of your own formatter profile and select only the concerned region.

It would be also helpful to provide small test cases to illustrate precisely your needs.
Comment 2 Jeffrey Yasskin CLA 2009-02-06 12:24:05 EST
I'm using the released version of Eclipse (3.4.1), so I can't try out the "Never join lines" preference, but it sounds very cool. I'd be worried at selecting it, though, because I _do_ want to join lines within the same paragraph when I rewrap a comment. For example
if I
rewrapped
this
paragraph, I'd want all of the lines to wind up as close to 80 columns as possible.

On the other hand, if I have my cursor in the above paragraph, with nothing selected and I select the "word wrap comment" command, I don't want it to re-wrap my whole file. In fact, if "Format" when nothing's selected only applied to the immediately surrounding context, rather than the whole file, it might be usable in its current state.
Comment 3 Eclipse Genie CLA 2019-12-09 19:38:32 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.