C_Cpp.vcFormat.space.beforeConstructorColon inverted effect
Environment
- OS and Version: Arch Linux 2022-12-11
- VS Code Version: 1.73.1 6261075646f055b99068d3688932416f2346dd3b x64
- C/C++ Extension Version: v1.13.7
- Other extensions you installed (and if the issue persists after disabling them): NA
- If using SSH remote, specify OS of remote machine: NA
- A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).
The setting C_Cpp.vcFormat.space.beforeConstructorColon has inverted effect, that is when set to true (default), there is no space between function declaration end parenthesis and colon before initialiser list eg
WithSignalBlocked::WithSignalBlocked(int signum): signum(signum)
with the setting false we obtain
WithSignalBlocked::WithSignalBlocked(int signum) : signum(signum)
Bug Summary and Steps to Reproduce
Create a .cpp file with the following
struct WithSignalBlocked {
int signum;
WithSignalBlocked(int signum);
~WithSignalBlocked();
};
WithSignalBlocked::WithSignalBlocked(int signum): signum(signum) {} /* LINE X */
Observe how the formatter does not insert a space before the : on the line with comment 'LINE X'.
Now toggle the setting to false in settings, and rerun the formatter; a space is inserted.
Expected behavior
The setting's effect should be inverted
Code sample and Logs
NA
Screenshots
No response
Additional context
No response
Thank you for submitting this issue. We will look to get a fix out as soon as possible.
This may actually be an existing bug with Visual Studio, I am currently investigating further.
This may actually be an existing bug with Visual Studio, I am currently investigating further. this bug is still exists!
@moondie Thanks for the ping. We should have a fix in the next update.
Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.15.2 .