VSCodeでC++でコーディングをするとき、コンストラクタの:が改行されてしまうが、改行されずに横並び(1行)に収めたい
問題のコード
cPP
1struct A { 2 int x; 3 A(int newX) 4 : x(newX) 5 { 6 cout << "A(int newX) is called.\n"; 7 } 8};
cPP
1struct Person { 2 string name; 3 int age; 4 Person() {} 5 6 Person(const string &newName, int newAge) 7 : name(newName) 8 , age(newAge) 9 { 10 } 11};
実現したいコード
cpp
1struct A { 2 int x; 3 A(int newX) : x(newX) 4 { 5 cout << "A(int newX) is called.\n"; 6 } 7};
cpp
1struct Person { 2 string name; 3 int age; 4 Person() {} 5 6 Person(const string &newName, int newAge) : name(newName, age(newAge {} 7};
試したこと
clang-formatのbracewrappingの見直し、BreakConstructorInitializersBeforeComma: falseの設定
追記
普段はBreakBeforeBracesはStroustrupです。
拡張機能はC/C++、Clang command adapter configulationです。(調節関係ありそうなのは)
回答1件
あなたの回答
tips
プレビュー