C++ の EditorConfig プロパティ: インデントとアライメント
インデント
連続線インデント
プロパティ名:
[resharper_]cpp_continuous_line_indent , [resharper_]continuous_line_indent
使用可能な値:
none: なしsingle: 単一double: ダブル
例:
なし |
|---|
int x = foo1() +
foo2(); |
シングル |
|---|
int x = foo1() +
foo2(); |
ダブル |
|---|
int x = foo1() +
foo2(); |
関数宣言および呼び出し括弧で連続行インデントを使用する
プロパティ名:
[resharper_]cpp_use_continuous_line_indent_in_method_pars , [resharper_]use_continuous_line_indent_in_method_pars
使用可能な値:
true | false
例:
true |
|---|
void Method(
int parameter1,
int parameter2
)
{
Method(
parameter1,
parameter2
);
} |
false |
|---|
void Method(
int parameter1,
int parameter2
)
{
Method(
parameter1,
parameter2
);
} |
初期化子リストで連続行インデントを使用する
プロパティ名:
[resharper_]cpp_use_continuous_line_indent_in_expression_braces , [resharper_]use_continuous_line_indent_in_expression_braces
使用可能な値:
true | false
例:
true |
|---|
int a[3] =
{
1, 2, 3
}; |
false |
|---|
int a[3] =
{
1, 2, 3
}; |
インデントネームスペースのメンバー
プロパティ名:
[resharper_]cpp_namespace_indentation , [resharper_]namespace_indentation
使用可能な値:
none: インデントしないinner: 内部の名前空間にのみインデントするall: インデントすべて
例:
なし |
|---|
namespace ns
{
void a();
namespace inner
{
void b();
};
}; |
インナー |
|---|
namespace ns
{
void a();
namespace inner
{
void b();
};
}; |
すべて |
|---|
namespace ns
{
void a();
namespace inner
{
void b();
};
}; |
インデントリンケージ指定ブロックメンバー
プロパティ名:
[resharper_]cpp_linkage_specification_indentation , [resharper_]linkage_specification_indentation
使用可能な値:
none: インデントしないinner: 内部の名前空間にのみインデントするall: インデントすべて
例:
なし |
|---|
extern "C++" {
void a();
extern "C++" {
void b();
};
}; |
インナー |
|---|
extern "C++" {
void a();
extern "C++" {
void b();
};
}; |
すべて |
|---|
extern "C++" {
void a();
extern "C++" {
void b();
};
}; |
エクスポート宣言ブロックメンバーのインデント
プロパティ名:
[resharper_]cpp_indent_export_declaration_members , [resharper_]indent_export_declaration_members
使用可能な値:
true | false
例:
true |
|---|
export
{
void a();
}; |
false |
|---|
export
{
void a();
}; |
クラスからアクセス指定子をインデントする
プロパティ名:
[resharper_]cpp_indent_access_specifiers_from_class , [resharper_]indent_access_specifiers_from_class
使用可能な値:
true | false
例:
true |
|---|
class C
{
public:
void a();
}; |
false |
|---|
class C
{
public:
void a();
}; |
アクセス指定子からクラスメンバーをインデントする
プロパティ名:
[resharper_]cpp_indent_class_members_from_access_specifiers , [resharper_]indent_class_members_from_access_specifiers
使用可能な値:
true | false
例:
true |
|---|
class C
{
public:
void a();
}; |
false |
|---|
class C
{
public:
void a();
}; |
メンバー初期化子リストのインデント
プロパティ名:
[resharper_]cpp_indent_member_initializer_list , [resharper_]indent_member_initializer_list
使用可能な値:
true | false
例:
true |
|---|
class C
{
C(int x)
: y(x)
{
}
int y;
}; |
false |
|---|
class C
{
C(int x)
: y(x)
{
}
int y;
}; |
型の後に関数定義または宣言がラップされている場合にインデントする
プロパティ名:
[resharper_]cpp_indent_wrapped_function_names , [resharper_]indent_wrapped_function_names
使用可能な値:
true | false
例:
true |
|---|
void
foo()
{
} |
false |
|---|
void
foo()
{
} |
'switch' から 'case' をインデント
プロパティ名:
[resharper_]cpp_indent_switch_labels , [resharper_]indent_switch_labels
使用可能な値:
true | false
例:
true |
|---|
switch (expression)
{
case 0:
{
foo();
break;
}
} |
false |
|---|
switch (expression)
{
case 0:
{
foo();
break;
}
} |
インデント関数の宣言の括弧
プロパティ名:
[resharper_]cpp_indent_method_decl_pars , [resharper_]indent_method_decl_pars
使用可能な値:
inside: 括弧内 (BSD/K&R スタイル)outside: 括弧内と等しく (ホワイトスミススタイル)outside_and_inside: 括弧 1x、2x の内側 (GNU スタイル)none: インデントしない
例:
内部 |
|---|
void Method(
int parameter1,
int parameter2
); |
外側 |
|---|
void Method(
int parameter1,
int parameter2
); |
outside_and_inside |
|---|
void Method(
int parameter1,
int parameter2
); |
なし |
|---|
void Method(
int parameter1,
int parameter2
); |
インデントメソッド呼び出しの括弧
プロパティ名:
[resharper_]cpp_indent_invocation_pars , [resharper_]indent_invocation_pars
使用可能な値:
inside: 括弧内 (BSD/K&R スタイル)outside: 括弧内と等しく (ホワイトスミススタイル)outside_and_inside: 括弧 1x、2x の内側 (GNU スタイル)none: インデントしない
例:
内部 |
|---|
Method(
parameter1,
parameter2
); |
外側 |
|---|
Method(
parameter1,
parameter2
); |
outside_and_inside |
|---|
Method(
parameter1,
parameter2
); |
なし |
|---|
Method(
parameter1,
parameter2
); |
インデント文(if、while、for など)括弧
プロパティ名:
[resharper_]cpp_indent_statement_pars , [resharper_]indent_statement_pars
使用可能な値:
inside: 括弧内 (BSD/K&R スタイル)outside: 括弧内と等しく (ホワイトスミススタイル)outside_and_inside: 括弧 1x、2x の内側 (GNU スタイル)none: インデントしない
例:
内部 |
|---|
if (
condition1 &&
condition2
)
return; |
外側 |
|---|
if (
condition1 &&
condition2
)
return; |
outside_and_inside |
|---|
if (
condition1 &&
condition2
)
return; |
なし |
|---|
if (
condition1 &&
condition2
)
return; |
プリプロセッサーディレクティブインデント
プロパティ名:
[resharper_]cpp_indent_preprocessor_directives , [resharper_]indent_preprocessor_directives
使用可能な値:
none: インデントしないnormal: インデントdo_not_change: 変更しない
例:
なし |
|---|
void sections()
{
#pragma omp sections
{
int x;
}
} |
正常 |
|---|
void sections()
{
#pragma omp sections
{
int x;
}
} |
do_not_change |
|---|
void sections()
{
#pragma omp sections
{
int x;
}
} |
インデント C++ /CLI ジェネリクス制約
プロパティ名:
[resharper_]cpp_indent_type_constraints , [resharper_]indent_type_constraints
使用可能な値:
true | false
例:
true |
|---|
generic<class T1>
class C1
where T1 : I1
{}; |
false |
|---|
generic<class T1>
class C1
where T1 : I1
{}; |
インデントコメントは最初の列から始まります
プロパティ名:
[resharper_]cpp_indent_comment , [resharper_]indent_comment
使用可能な値:
true | false
例:
true |
|---|
namespace N
{
// Some comment
class C1
{
};
}; |
false |
|---|
namespace N
{
// Some comment
class C1
{
};
}; |
コードをコメントアウトするときは、最初の列にコメントを配置する
プロパティ名:
[resharper_]cpp_place_comments_at_first_column , [resharper_]place_comments_at_first_column
使用可能な値:
true | false
複数行構成要素を整列
宣言された宣言子
プロパティ名:
[resharper_]cpp_align_multiple_declaration , [resharper_]align_multiple_declaration
使用可能な値:
true | false
例:
true |
|---|
int first,
second |
false |
|---|
int first,
second |
関数パラメーター
プロパティ名:
[resharper_]cpp_align_multiline_parameter , [resharper_]align_multiline_parameter
使用可能な値:
true | false
例:
true |
|---|
double average(double first,
double second); |
false |
|---|
double average(double first,
double second); |
引数呼び出し
プロパティ名:
[resharper_]cpp_align_multiline_argument , [resharper_]align_multiline_argument
使用可能な値:
true | false
例:
true |
|---|
object.method(first,
second); |
false |
|---|
object.method(first,
second); |
最初の引数を '('
プロパティ名:
[resharper_]cpp_align_first_arg_by_paren , [resharper_]align_first_arg_by_paren
使用可能な値:
true | false
例:
true |
|---|
object.method(
first,
second); |
false |
|---|
object.method(
first,
second); |
初期化子リストの引数
プロパティ名:
[resharper_]cpp_align_multiline_expression_braces , [resharper_]align_multiline_expression_braces
使用可能な値:
true | false
例:
true |
|---|
int a[6] = {1, 2, 3
4, 5, 6}; |
false |
|---|
int a[6] = {1, 2, 3
4, 5, 6}; |
テンプレート宣言のテンプレートパラメーター
プロパティ名:
[resharper_]cpp_align_multiline_type_parameter , [resharper_]align_multiline_type_parameter
使用可能な値:
true | false
例:
true |
|---|
template <typename K,
typename V>
struct map; |
false |
|---|
template <typename K,
typename V>
struct map; |
テンプレート引数
プロパティ名:
[resharper_]cpp_align_multiline_type_argument , [resharper_]align_multiline_type_argument
使用可能な値:
true | false
例:
true |
|---|
std::map<char*,
MyStruct> my_map; |
false |
|---|
std::map<char*,
MyStruct> my_map; |
クラス基本節の基底クラス
プロパティ名:
[resharper_]cpp_align_multiline_extends_list , [resharper_]align_multiline_extends_list
使用可能な値:
true | false
例:
true |
|---|
struct MyStruct : Base1,
Base2
{
}; |
false |
|---|
struct MyStruct : Base1,
Base2
{
}; |
メンバー初期化子リストのメンバー初期化子
プロパティ名:
[resharper_]cpp_align_multiline_ctor_init , [resharper_]align_multiline_ctor_init
使用可能な値:
true | false
例:
true |
|---|
struct MyStruct
{
MyStruct() : first(f),
second(s)
{
}
}; |
false |
|---|
struct MyStruct
{
MyStruct() : first(f),
second(s)
{
}
}; |
アウトデントコンマ
プロパティ名:
[resharper_]cpp_outdent_commas , [resharper_]outdent_commas
使用可能な値:
true | false
例:
true |
|---|
class Class<
T1
, T3> :
Base
, SomeInterface
{
void fooCall(
int firstParameter
, int secondParameter)
{
fooCall(
firstParameter
, secondParameter);
}
} |
false |
|---|
class Class<
T1
, T3> :
Base
, SomeInterface
{
void fooCall(
int firstParameter
, int secondParameter)
{
fooCall(
firstParameter
, secondParameter);
}
} |
?: オペレーター
プロパティ名:
[resharper_]cpp_align_ternary , [resharper_]align_ternary
使用可能な値:
align_all: 位置合わせalign_not_nested: ネストされている場合を除いて整列するnone: 整列していない
例:
align_all |
|---|
int var = 56 + (cond1
? result1
: cond2
? result2
: result3); |
align_not_nested |
|---|
int var = 56 + (cond1
? result1
: cond2
? result2
: result3); |
なし |
|---|
int var = 56 + (cond1
? result1
: cond2
? result2
: result3); |
インデントを揃えましたか? : オペレーター
プロパティ名:
[resharper_]cpp_indent_aligned_ternary , [resharper_]indent_aligned_ternary
使用可能な値:
true | false
例:
true |
|---|
int var = 56 + (cond1
? result1
: cond2
? result2
: result3); |
false |
|---|
int var = 56 + (cond1
? result1
: cond2
? result2
: result3); |
チェーンメソッド呼び出し
プロパティ名:
[resharper_]cpp_align_multiline_calls_chain , [resharper_]align_multiline_calls_chain
使用可能な値:
true | false
例:
true |
|---|
struct X
{
X foo(X x)
{
x.foo()
.foo()
.foo();
}
}; |
false |
|---|
struct X
{
X foo(X x)
{
x.foo()
.foo()
.foo();
}
}; |
アウトデント「.」連鎖メソッド呼び出しの '->'
プロパティ名:
[resharper_]cpp_outdent_dots , [resharper_]outdent_dots
使用可能な値:
true | false
例:
true |
|---|
auto a =
MyVar
.SomeMethod()
->OtherMethod()
.ThirdMethod();
auto b = MyVar
.SomeMethod()
->OtherMethod()
.ThirdMethod(); |
false |
|---|
auto a =
MyVar
.SomeMethod()
->OtherMethod()
.ThirdMethod();
auto b = MyVar
.SomeMethod()
->OtherMethod()
.ThirdMethod(); |
連鎖二項式
プロパティ名:
[resharper_]cpp_align_multiline_binary_expressions_chain , [resharper_]align_multiline_binary_expressions_chain
使用可能な値:
true | false
例:
true |
|---|
int var = 1
+ 2
+ 3; |
false |
|---|
int var = 1
+ 2
+ 3; |
類似のコードを列に整列する
隣接する行の列の配置を修正
プロパティ名:
[resharper_]cpp_int_align_fix_in_adjacent , [resharper_]int_align_fix_in_adjacent
使用可能な値:
true | false
代入
プロパティ名:
[resharper_]cpp_int_align_eq , [resharper_]int_align_eq
使用可能な値:
true | false
例:
true |
|---|
const char* x = "x";
SomeClass xxxxx = "xxxxx";
int xxx;
int& y = xxx; |
false |
|---|
const char* x = "x";
SomeClass xxxxx = "xxxxx";
int xxx;
int& y = xxx; |
宣言名
プロパティ名:
[resharper_]cpp_int_align_declaration_names , [resharper_]int_align_declaration_names
使用可能な値:
true | false
例:
true |
|---|
const char* x = "x";
SomeClass xxxxx = "xxxxx";
int xxx;
int& y = xxx; |
false |
|---|
const char* x = "x";
SomeClass xxxxx = "xxxxx";
int xxx;
int& y = xxx; |
列挙型初期化子
プロパティ名:
[resharper_]cpp_int_align_enum_initializers , [resharper_]int_align_enum_initializers
使用可能な値:
true | false
例:
true |
|---|
enum class Direction
{
up = 0b00000001,
down = 0b00000010,
left = 0b00000100,
right = 0b00001000
}; |
false |
|---|
enum class Direction
{
up = 0b00000001,
down = 0b00000010,
left = 0b00000100,
right = 0b00001000
}; |
ビットフィールドのサイズ
プロパティ名:
[resharper_]cpp_int_align_bitfield_sizes , [resharper_]int_align_bitfield_sizes
使用可能な値:
true | false
例:
true |
|---|
struct C
{
int first : 1;
int second : 2;
}; |
false |
|---|
struct C
{
int first : 1;
int second : 2;
}; |
コメントの終了
プロパティ名:
[resharper_]cpp_int_align_comments , [resharper_]int_align_comments
使用可能な値:
true | false
例:
true |
|---|
void foo()
{
DoSomething(); // I'm
auto y = 6; // forced
while (y > 0) y--; // to
DoSomethingElse(); /* document */
auto z = 10; /* my code */
while (z < 100) z++; /* profusely */
} |
false |
|---|
void foo()
{
DoSomething(); // I'm
auto y = 6; // forced
while (y > 0) y--; // to
DoSomethingElse(); /* document */
auto z = 10; /* my code */
while (z < 100) z++; /* profusely */
} |