Code formatter [message #218686] |
Fri, 11 November 2005 05:14  |
Eclipse User |
|
|
|
Hi,
I am looking for an option in the code formatter which inserts braces and
line breaks in the following situation:
if (x == 1) return 5;
The result should look like this:
if (x == 1) {
return 5;
}
Searching the help did not get me on with this. Could someone please help
me, if there is an option or what else I can do?
Thanks
Michael
|
|
|
|
|
|
|
|
Re: Code formatter [message #218743 is a reply to message #218736] |
Fri, 11 November 2005 11:34   |
Eclipse User |
|
|
|
Originally posted by: scheglov_ke.nlmk.ru
Benno Baumgartner wrote:
Exactly. I need just apply changes, without any
questions/dialogs/wizards, I know what I have configured and need to apply
styling only for unit that I currently change.
Show wizard and then press "Finish", as you suggested in bug report, is
not fast enough. :-) "Light" version would be great.
If settings in wizard are per-project it is enough to apply last
selected clean ups. If not, I think that per-project preference page is
better, like JDT supports not project specific formatting settings.
> I could provide a "light" clean up wich does execute the clean ups on the
> current cu without showing a dialog/preview. If this is what you want? The
> clean ups would be those which have been selected last time in the wizard or
> maybe in a preference page.
> Regards
> Benno
> "Konstantin Scheglov" <scheglov_ke@nlmk.ru> wrote in message
> news:dl224a$4n5$1@news.eclipse.org...
>> Mario Ivankovits wrote:
>>
>> See https://bugs.eclipse.org/bugs/show_bug.cgi?id=87537
>>
>> I have separate plugin that allows add/remove () and {}. In reallity I
>> already can not live without it. :-)
>>
>> However I don't like idea that it should be accessible only from "Clean
>> Up" wizard, because this will have it too heavy. Just separate action
>> "Change code style", same as "Organize imports" or "Format" is better
>> IMHO. It can be in "Clean Up", but we need also something easy to invoke.
>> I press Organize_imports/Change_code_style(my)/Format every several
>> seconds. :-)
>>
>>
>>> Michael Hausl wrote:
>>>
>>>> if (x == 1) return 5;
>>>>
>>>> The result should look like this:
>>>>
>>>> if (x == 1) {
>>>> return 5;
>>>> }
>>>
>>>
>>> I searched, but wasnt able to find it too.
>>>
>>> In case it is not possible yet: I would like to have this too.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.14550 seconds