Line wrapping for long field definitions [message #484962] |
Wed, 09 September 2009 19:14  |
Eclipse User |
|
|
|
Originally posted by: rbrewer.lava.net
Hello. I'm encountering a problem getting Eclipse Galileo to wrap Java
source lines the way I want.
I'm attempting to keep all Java source lines less than 100 characters.
I've configured the maximum line width in Preferences->Java->Code
Style->Formatter->Line Wrapping to 100. I've also changed all the
statement types in the scrolling list to "Wrap only when necessary".
Unfortunately, Eclipse will not wrap lines like this:
private ConcurrentMap<String, ConcurrentMap<XMLGregorianCalendar,
SensorData>> source2SensorDatasHash;
(not sure if the newsgroup will wrap that line or not, but it comes to 105
characters)
Even more frustratingly, if I manually add a line break to that line and
then Format the file (Source->Format), Eclipse happily rejoins the line
for me.
Is there a preference I just haven't found that will allow me to make the
Eclipse formatter wrap lines like the one above, or is this really a
feature request?
Thanks!
|
|
|
|
Re: Line wrapping for long field definitions [message #505443 is a reply to message #484962] |
Wed, 30 December 2009 11:45   |
Eclipse User |
|
|
|
I see the same problem with method invocations. For example:
TDCR_Ambulate ambulateRecord = new TDCR_Ambulate(TimeMachine.getInstance().getUTCTime(), newAmbulate.getLastItemRcvdTime(), pos, newAmbulate.getItemItem().getName(), newAmbulate.getLastFoundedItemID().toString(), newAmbulate.getOldAmbulationionTime(), newAmbulate.getPnlToday(), newAmbulate.getNumItemsSent(), newAmbulate.getLastAmbulance(), newAmbulate.getNumCadavers(), newAmbulate.getLastTimeOfDeath());
is not wrapped - and if I manually insert a line break... poof: it formats away.
|
|
|
Re: Line wrapping for long field definitions [message #505821 is a reply to message #505443] |
Tue, 05 January 2010 04:37   |
Eclipse User |
|
|
|
Ray Schnitzler wrote:
> I see the same problem with method invocations.
Just make sure you have your formatter preferences set as desired.
Dani
> For example:
>
> TDCR_Ambulate ambulateRecord = new
> TDCR_Ambulate(TimeMachine.getInstance().getUTCTime(),
> newAmbulate.getLastItemRcvdTime(), pos,
> newAmbulate.getItemItem().getName(),
> newAmbulate.getLastFoundedItemID().toString(),
> newAmbulate.getOldAmbulationionTime(), newAmbulate.getPnlToday(),
> newAmbulate.getNumItemsSent(), newAmbulate.getLastAmbulance(),
> newAmbulate.getNumCadavers(), newAmbulate.getLastTimeOfDeath());
>
>
> is not wrapped - and if I manually insert a line break... poof: it
> formats away.
>
>
|
|
|
Re: Line wrapping for long field definitions [message #528532 is a reply to message #484962] |
Tue, 20 April 2010 15:59  |
Eclipse User |
|
|
|
There's currently no line wrapping defined for field declarations (bug 284789 was about method declarations), hence please open an enhancement to ask for it.
Using 3.6, since M5, you have the possibility to do your own formatting on this field declaration and surround it with disabling/enabling tags.
Doing that the formatter will not touch the lines you'll have formatted...
You can setup your own tags to disable and enable the formatter in Preferences->Java->Code Style->Formatter->Off/On Tags tab...
(see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=27079)
|
|
|
Powered by
FUDForum. Page generated in 0.04492 seconds