ReSharper 2025.3 ヘルプ

C++ の EditorConfig プロパティ: 波括弧レイアウト

波括弧レイアウト

名前空間宣言

プロパティ名:

[resharper_]cpp_namespace_declaration_braces[resharper_]cpp_brace_style[resharper_]namespace_declaration_braces[resharper_]brace_style

使用可能な値:

  • end_of_line : 行末 (K&R スタイル)

  • end_of_line_no_space : 行末 (空白なし)

  • next_line : 次の行に (BSD スタイル)

  • next_line_shifted : 次の行のインデント時に (ホワイトスミススタイル)

  • next_line_shifted_2 : 次の行インデント 2 (GNU スタイル)

例:

end_of_line

namespace ns { void a(); }

end_of_line_no_space

namespace ns{ void a(); }

next_line

namespace ns { void a(); }

next_line_shifted

namespace ns { void a(); }

next_line_shifted_2

namespace ns { void a(); }

リンケージ仕様

プロパティ名:

[resharper_]cpp_linkage_specification_braces[resharper_]cpp_brace_style[resharper_]linkage_specification_braces[resharper_]brace_style

使用可能な値:

  • end_of_line : 行末 (K&R スタイル)

  • end_of_line_no_space : 行末 (空白なし)

  • next_line : 次の行に (BSD スタイル)

  • next_line_shifted : 次の行のインデント時に (ホワイトスミススタイル)

  • next_line_shifted_2 : 次の行インデント 2 (GNU スタイル)

例:

end_of_line

extern "C++" { void a(); }

end_of_line_no_space

extern "C++"{ void a(); }

next_line

extern "C++" { void a(); }

next_line_shifted

extern "C++" { void a(); }

next_line_shifted_2

extern "C++" { void a(); }

エクスポート申告

プロパティ名:

[resharper_]cpp_export_declaration_braces[resharper_]cpp_brace_style[resharper_]export_declaration_braces[resharper_]brace_style

使用可能な値:

  • end_of_line : 行末 (K&R スタイル)

  • end_of_line_no_space : 行末 (空白なし)

  • next_line : 次の行に (BSD スタイル)

  • next_line_shifted : 次の行のインデント時に (ホワイトスミススタイル)

  • next_line_shifted_2 : 次の行インデント 2 (GNU スタイル)

例:

end_of_line

export { void a(); }

end_of_line_no_space

export{ void a(); }

next_line

export { void a(); }

next_line_shifted

export { void a(); }

next_line_shifted_2

export { void a(); }

型宣言

プロパティ名:

[resharper_]cpp_type_declaration_braces[resharper_]cpp_brace_style[resharper_]type_declaration_braces[resharper_]brace_style

使用可能な値:

  • end_of_line : 行末 (K&R スタイル)

  • end_of_line_no_space : 行末 (空白なし)

  • next_line : 次の行に (BSD スタイル)

  • next_line_shifted : 次の行のインデント時に (ホワイトスミススタイル)

  • next_line_shifted_2 : 次の行インデント 2 (GNU スタイル)

例:

end_of_line

class C { public: void a(); };

end_of_line_no_space

class C{ public: void a(); };

next_line

class C { public: void a(); };

next_line_shifted

class C { public: void a(); };

next_line_shifted_2

class C { public: void a(); };

名前空間定義を同じ行に配置する

プロパティ名:

[resharper_]cpp_place_namespace_definitions_on_same_line , [resharper_]place_namespace_definitions_on_same_line

使用可能な値:

true | false

例:

true

namespace A { namespace B { void a(); }}

false

namespace A { namespace B { void a(); } }

関数宣言

プロパティ名:

[resharper_]cpp_invocable_declaration_braces[resharper_]cpp_brace_style[resharper_]invocable_declaration_braces[resharper_]brace_style

使用可能な値:

  • end_of_line : 行末 (K&R スタイル)

  • end_of_line_no_space : 行末 (空白なし)

  • next_line : 次の行に (BSD スタイル)

  • next_line_shifted : 次の行のインデント時に (ホワイトスミススタイル)

  • next_line_shifted_2 : 次の行インデント 2 (GNU スタイル)

例:

end_of_line

void a() { b(); }

end_of_line_no_space

void a(){ b(); }

next_line

void a() { b(); }

next_line_shifted

void a() { b(); }

next_line_shifted_2

void a() { b(); }

ラムダ式

プロパティ名:

[resharper_]cpp_anonymous_method_declaration_braces[resharper_]cpp_brace_style[resharper_]anonymous_method_declaration_braces[resharper_]brace_style

使用可能な値:

  • end_of_line : 行末 (K&R スタイル)

  • end_of_line_no_space : 行末 (空白なし)

  • next_line : 次の行に (BSD スタイル)

  • next_line_shifted : 次の行のインデント時に (ホワイトスミススタイル)

  • next_line_shifted_2 : 次の行インデント 2 (GNU スタイル)

例:

end_of_line

auto a = []() { int x = 0; return x; };

end_of_line_no_space

auto a = [](){ int x = 0; return x; };

next_line

auto a = []() { int x = 0; return x; };

next_line_shifted

auto a = []() { int x = 0; return x; };

next_line_shifted_2

auto a = []() { int x = 0; return x; };

'case' ラベルにブロック

プロパティ名:

[resharper_]cpp_case_block_braces[resharper_]cpp_brace_style[resharper_]case_block_braces[resharper_]brace_style

使用可能な値:

  • end_of_line : 行末 (K&R スタイル)

  • end_of_line_no_space : 行末 (空白なし)

  • next_line : 次の行に (BSD スタイル)

  • next_line_shifted : 次の行のインデント時に (ホワイトスミススタイル)

  • next_line_shifted_2 : 次の行インデント 2 (GNU スタイル)

例:

end_of_line

switch (expression) { case 0: { foo(); break; } }

end_of_line_no_space

switch (expression) { case 0: { foo(); break; } }

next_line

switch (expression) { case 0: { foo(); break; } }

next_line_shifted

switch (expression) { case 0: { foo(); break; } }

next_line_shifted_2

switch (expression) { case 0: { foo(); break; } }

式が必要です

プロパティ名:

[resharper_]cpp_requires_expression_braces , [resharper_]requires_expression_braces

使用可能な値:

  • end_of_line : 行末 (K&R スタイル)

  • end_of_line_no_space : 行末 (空白なし)

  • next_line : 次の行に (BSD スタイル)

  • next_line_shifted : 次の行のインデント時に (ホワイトスミススタイル)

  • next_line_shifted_2 : 次の行インデント 2 (GNU スタイル)

例:

end_of_line

template <typename T> concept C = requires { typename T::inner1; typename T::inner2; };

end_of_line_no_space

template <typename T> concept C = requires{ typename T::inner1; typename T::inner2; };

next_line

template <typename T> concept C = requires { typename T::inner1; typename T::inner2; };

next_line_shifted

template <typename T> concept C = requires { typename T::inner1; typename T::inner2; };

next_line_shifted_2

template <typename T> concept C = requires { typename T::inner1; typename T::inner2; };

その他のステートメントとブロック

プロパティ名:

[resharper_]cpp_other_braces[resharper_]cpp_brace_style[resharper_]other_braces[resharper_]brace_style

使用可能な値:

  • end_of_line : 行末 (K&R スタイル)

  • end_of_line_no_space : 行末 (空白なし)

  • next_line : 次の行に (BSD スタイル)

  • next_line_shifted : 次の行のインデント時に (ホワイトスミススタイル)

  • next_line_shifted_2 : 次の行インデント 2 (GNU スタイル)

例:

end_of_line

if (condition) { foo(); } else { foo(); }

end_of_line_no_space

if (condition){ foo(); } else{ foo(); }

next_line

if (condition) { foo(); } else { foo(); }

next_line_shifted

if (condition) { foo(); } else { foo(); }

next_line_shifted_2

if (condition) { foo(); } else { foo(); }

その他の波括弧

プロパティ名:

[resharper_]cpp_expression_braces , [resharper_]expression_braces

使用可能な値:

  • inside : 括弧内 (BSD/K&R スタイル)

  • outside : 括弧内と等しく (ホワイトスミススタイル)

  • outside_and_inside : 括弧 1x、2x の内側 (GNU スタイル)

  • none : インデントしない

例:

内部

int a[10] = { 1, 2, 3 };

外側

int a[10] = { 1, 2, 3 };

outside_and_inside

int a[10] = { 1, 2, 3 };

なし

int a[10] = { 1, 2, 3 };

空の波括弧フォーマット

プロパティ名:

[resharper_]cpp_empty_block_style , [resharper_]empty_block_style

使用可能な値:

  • multiline : 異なる行

  • together : 波括弧を一緒に配置する

  • together_same_line : 一緒に同じ行に

例:

multiline

class C { }; void foo() { for (;;) { } }

together

class C {}; void foo() { for (;;) {} }

together_same_line

class C {}; void foo() { for (;;) {} }

単純な複合文を 1 行にまとめる

プロパティ名:

[resharper_]cpp_simple_block_style , [resharper_]simple_block_style

使用可能な値:

  • do_not_change : 変更しない

  • on_single_line : 強制的に 1 行に入れる

  • line_break : 強制改行

例:

do_not_change

int foo() { return 0; }

on_single_line

int foo() { return 0; }

line_break

int foo() { return 0; }

ブロックを開始するマクロの正規表現

プロパティ名:

[resharper_]cpp_macro_block_begin , [resharper_]macro_block_begin

ブロックを終了するマクロの正規表現

プロパティ名:

[resharper_]cpp_macro_block_end , [resharper_]macro_block_end

'{' の後のコメントを許可する

プロパティ名:

[resharper_]cpp_allow_comment_after_lbrace , [resharper_]allow_comment_after_lbrace

使用可能な値:

true | false

例:

true

if (condition) { // comment statement; }

false

if (condition) { // comment statement; }
2024 年 5 月 26 日