Remove single line comment line breaks in java editor [message #216053] |
Sat, 01 October 2005 11:42  |
Eclipse User |
|
|
|
I use the source formatting of Eclipse quite often but have issues when
I have a multiline comment, format, edit the comment, and then reformat
the comment. The problem is that when allowing Eclipse to reformat a
comment it honors line breaks. So if I have a comment like the following:
// Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In
// at diam. Nunc lacinia, neque sed dapibus convallis, mauris
// arcu vulputate est, in blandit odio mauris quis elit. Duis
// tortor. Sed vitae mauris. Curabitur mattis tincidunt massa.
// Etiam pulvinar, orci congue semper viverra, est quam varius
// sem, vitae interdum ligula turpis.
then remove the first 3 words of the third line:
// Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In
// at diam. Nunc lacinia, neque sed dapibus convallis, mauris
// in blandit odio mauris quis elit. Duis
// tortor. Sed vitae mauris. Curabitur mattis tincidunt massa.
// Etiam pulvinar, orci congue semper viverra, est quam varius
// sem, vitae interdum ligula turpis.
When I reformat I get no change even though I'd like for the fourth line
to fill the available space on line 3.
The question is, is there a way in Eclipse to quickly and easily convert
this back to a one line comment and then reformat? I would think the
reason that it doesn't automatically assume that the comments are a part
of one comment because // is suppose to be a single line comment and
making that assumption could combine separate comment statements. I
guess the other option is to use /* */ for my comments but ctrl+/ is
just way to easy and for some reason // just looks better in my code.
Thanks,
Brad
|
|
|
Re: Remove single line comment line breaks in java editor [message #217411 is a reply to message #216053] |
Thu, 20 October 2005 08:07  |
Eclipse User |
|
|
|
In this scenario you should use multi-line comments, which are correctly
handled by the formatter.
Cheers
Toby
"Brad Reynolds" <bradleyjames@gmail.com> wrote in message
news:dhmapt$gjh$1@news.eclipse.org...
>I use the source formatting of Eclipse quite often but have issues when I
>have a multiline comment, format, edit the comment, and then reformat the
>comment. The problem is that when allowing Eclipse to reformat a comment
>it honors line breaks. So if I have a comment like the following:
>
> // Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In
> // at diam. Nunc lacinia, neque sed dapibus convallis, mauris
> // arcu vulputate est, in blandit odio mauris quis elit. Duis
> // tortor. Sed vitae mauris. Curabitur mattis tincidunt massa.
> // Etiam pulvinar, orci congue semper viverra, est quam varius
> // sem, vitae interdum ligula turpis.
>
> then remove the first 3 words of the third line:
>
> // Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In
> // at diam. Nunc lacinia, neque sed dapibus convallis, mauris
> // in blandit odio mauris quis elit. Duis
> // tortor. Sed vitae mauris. Curabitur mattis tincidunt massa.
> // Etiam pulvinar, orci congue semper viverra, est quam varius
> // sem, vitae interdum ligula turpis.
>
> When I reformat I get no change even though I'd like for the fourth line
> to fill the available space on line 3.
>
> The question is, is there a way in Eclipse to quickly and easily convert
> this back to a one line comment and then reformat? I would think the
> reason that it doesn't automatically assume that the comments are a part
> of one comment because // is suppose to be a single line comment and
> making that assumption could combine separate comment statements. I guess
> the other option is to use /* */ for my comments but ctrl+/ is just way to
> easy and for some reason // just looks better in my code.
>
> Thanks,
> Brad
|
|
|
Powered by
FUDForum. Page generated in 0.04899 seconds