I installed VSCode C/C++ extension and I think that it is a very good C/C++ extension for VSCode and it has surprised intellisense.
But now I am meeting a trouble about this extension: I could not disable the clang-format of it.
Because clang-format will format my code automatic format my code using different indents and style with my original style no matter what I configure.
So, Has it way to disable clang-format and how to do?
Thanks.
:-)
A future release will add a clang-format enable/disable capability. However, there shouldn't be any automatic formatting by default. Could you give more info on how you are invoking the code formatting? Is your intent to use another formatter?
Actually, I using VSCode to write web project before write C/C++ project.
So I turn on the opinion format on type ( "editor.formatOnType": true ) for the purpose of format my javascript code easily and automatically. And I installed another formatter for web languages(js, css, html), and they don't influence C/C++ codes.
I found that turn off the opinion format on type ( "editor.formatOnType": false ) in the workspace could turn off the automatic clang-format . But my other language codes will be not automatic format if I have other language files in the same workspace.
So will being able to disable our C/C++ formatter be sufficient or did you want to specifically just disable the C/C++ formatOnType setting?
I think that it's nice if I could just disable C/C++ formatOnType setting. Because there are Nodejs codes and C codes in my active project. So if I turn off editor.formatOnType settings in this workspace, I will get not any automatic format in my javascript files.
Yes, but we've already added a general C/C++ formatting setting, and not a C++ specific formatOnType setting, so when you turn the C/C++ formatting setting off, it won't do formatOnType for the other languages, but the disadvantage is the manual C/C++ formatting won't be available. Is that okay? If not, we might be able to add a C++ specific formatOnType later.
I think that add a C++ specific formatOnType opinion would be a nice idea.
I don't know how other expert C++ programmer think it, maybe you can refer more user idea.
(P.s. I write Javascript and Java more than C/C++, so I don't like many C/C++ special code style( : -) ) lead to I wanna turn off the C/C++ formatter)
This should be fixable via using the new language-specific settings added to VS Code:
"[cpp]": {
"editor.formatOnType": false
},
"[c]": {
"editor.formatOnType": false
}
Most helpful comment
This should be fixable via using the new language-specific settings added to VS Code:
"[cpp]": { "editor.formatOnType": false }, "[c]": { "editor.formatOnType": false }