2017-08-17 4 views
0

この中でanswerメソッドの宣言とメソッド呼び出しでIntelliJが自動書式の行折り返しをどのように行うかをカスタマイズできますか?

これは、IntelliJでの自動改行を有効にする方法を示しています。

さらにカスタマイズすることはできますか?例えば

、120のラインラップ値を持つあなたは、オートフォーマットこの場合:

public void someMethodWithLotsOfArguments(int thisIsValue1, int thisIsValue2, int thisIsValue3, int thisIsValue4asdfasdfasdfasdfasdf, Double thisIsValue, int thisIsValue6, int thisIsValue7) { 

ことになるだろう:

public void someMethodWithLotsOfArguments(int thisIsValue1, int thisIsValue2, int thisIsValue3, int 
     thisIsValue4asdfasdfasdfasdfasdf, Double thisIsValue, int thisIsValue6, int thisIsValue7) { 

それはこのことについて賢くなるために取得する方法はありますなどにフォーマット:

public void someMethodWithLotsOfArguments(int thisIsValue1, 
    int thisIsValue2, 
    int thisIsValue3, 
    int thisIsValue4asdfasdfasdfasdfasdf, 
    int thisIsValue5, 
    int thisIsValue6, 
    int thisIsValue7) { 

または非常に少なくとも、のような:

public void someMethodWithLotsOfArguments(int thisIsValue1, int thisIsValue2, int thisIsValue3, 
     int thisIsValue4asdfasdfasdfasdfasdf, Double thisIsValue, int thisIsValue6, int thisIsValue7) { 

パラメータ名からパラメータタイプを分割しないものは、大したものになります。バックFile > Settings > Editor > Code Style > Java > Wrapping and Braces

中と設定Method declaration parametersWrap always

答えて

2

行く方法

public void someMethodWithLotsOfArguments(int thisIsValue1, int thisIsValue2, int thisIsValue3, int thisIsValue4asdfasdfasdfasdfasdf, Double thisIsValue, int thisIsValue6, int thisIsValue7) { 
} 

、そうは

public void someMethodWithLotsOfArguments(int thisIsValue1, 
     int thisIsValue2, 
     int thisIsValue3, 
     int thisIsValue4asdfasdfasdfasdfasdf, 
     Double thisIsValue, 
     int thisIsValue6, 
     int thisIsValue7) { 
} 
+0

優秀次のようにフォーマットされます。また、メソッド呼び出し引数をこの方法で整列させることもできます。よく働く。 –

関連する問題