Community
Participate
Working Groups
I prefer my "throws" clauses to appear indented by one on the line following a method's parameter list: public void foo(..) throws SomeException { } It seems impossible to achieve this effect using the current Code Formatter. Also, consider the following situation public void foo(..)<caret is here> throws SomeException { } When I hit enter, the "throws" clause lands on the following line in the same column as "public": public void foo(..) throws SomeException { } I would prefer "throws" to be auto-indented, and as far as I recall, Eclipse 2.1.x behaved that way.
There was no auto-intendation with 2.1.x in this case (when you hit return throws clause lands on same column than public). There was also no possibility to change this using code formatter in 2.1.x... However, in 3.0, code formatter allows you to have this formatting: Go on "Line Wrapping" tab, then select MethodDeclaration->'throws' clause and choose: 'Line wrapping policy' = "Always wrap first element, others when necessary" 'Indentation policy' = "Default indentation" Force split = ON Then you should see you 'throws' clause go one line below and indented as you're expected... Note that you have many other policies ("Wrap all alements...") which will put 'htrows' clause on next line and indented. The difference will be only on how following classes in clause will be formatted.