Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to format method with more parameter in eclipse?

Tags:

java

eclipse

I know CTRL+ SHIFT + F for formatting method but it gives 3-4 parameters in line. I want one parameter in one line

foe eg:

method(a,b,c,d,e,f)

I want below result

method(a,
       b,
       c,
       d,
       e,
       f)
like image 383
Janak Patel Avatar asked Apr 18 '14 12:04

Janak Patel


People also ask

What is the fastest way to format code in Eclipse?

Go to Source | Format Document or press Ctrl+Shift+F.


1 Answers

This is an option in Eclipse formatter.

  1. Go to Window > Preferences
  2. Then in the tree on the left, go to Java > Code Style > Formatter
  3. Go to "Line Wrapping" tab
  4. In the tree, choose Method Declaration > Parameters or Function Calls > Arguments
  5. In "Line Wrapping Policy" combo box, choose:

Wrap all elements, every element on a new line.

like image 84
Joffrey Avatar answered Oct 24 '22 19:10

Joffrey