Type: General
Describe the bug
Extension installs clang-format 6.0.0, but 7.0.0 is available from: http://releases.llvm.org/download.html
Version: 1.29.1
Commit: bc24f98b5f70467bc689abf41cc5550ca637088e
Date: 2018-11-15T19:07:43.495Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64
[email protected]To Reproduce
$ $HOME/.vscode/extensions/ms-vscode.cpptools-0.20.1/LLVM/bin/clang-format -version
clang-format version 6.0.0 (tags/RELEASE_600/final)
Download location is set here: https://github.com/Microsoft/vscode-cpptools/blob/8c53c027cab1f5b110367cb08ab8286a1a98ea80/Extension/package.json#L1483-L1527
Expected behavior
$ clang-format -version
clang-format version 7.0.0 (tags/RELEASE_700/final)
Thanks!
Yeah, Visual Studio updated to clang-format 7 a while ago, but we were too busy and weren't sure if it had significant enough features bother with, i.e. I think this is the first user request we've had for that. Users who really need it can download it themselves and set the C_Cpp.clang_format_path. It looks like 7.0.1 is getting released next week so maybe we'll wait for that.
The latest version of ClangFormat has a new IndentPPDirective option that I would very much love to have.
Just giving this ticket a little poke in the hopes that the included ClangFormat gets updated with the latest soon.
@xgalaxy If you really want the newer clang-format you can download it and set the clang_format_path setting. It takes us longer to upgrade due to additional stuff we need to do (signing, test changes, publishing, etc.).
The right thing to do is to pick the clang-format in PATH over the VSCode one.
clang-format 9 is out, with tons of new features.
Would be nice to have it bundled with the vscode cpp extension, to avoid the extra work of getting it and configuring it manually.
@xgalaxy If you really want the newer clang-format you can download it and set the clang_format_path setting. It takes us longer to upgrade due to additional stuff we need to do (signing, test changes, publishing, etc.).
do you know where I can download a new clang-format.exe?
@mixandmatch025 Prebuilt binaries section of http://releases.llvm.org/download.html .
Using the clang-format from PATH would be great. Spent quite some time trying to figure out why my clang-format -dump-config wasn't working.
+1 for updating to 9.0.0
The clang AlignConsecutiveMacros formating option is only available with clang 9.0.0.
For those wondering, this macro is helpfull to align preprocessors' definition.
A must-have, in my opinion.
With {AlignConsecutiveMacros : true} :
#define SHORT_NAME 42
#define LONGER_NAME 0x007f
#define EVEN_LONGER_NAME (2)
#define foo(x) (x * x)
#define bar(y, z) (y + z)
@sean-mcmanus Thanks for point out this issue. As I said in issue 4772 it's nice to have the newer version bundled in a team environment with multiple developers using vs code.
One of the features I was looking for was additional controls over what code can be on a single line. The old formatter changes one line statements a bit to often.
As a workaround for the bundled version being old, the clang-format on the PATH should be used as of https://github.com/microsoft/vscode-cpptools/releases/tag/0.26.3 .
Our Insider release ships with clang 9.0.1: https://github.com/microsoft/vscode-cpptools/releases/tag/0.27.0-insiders
Our Insider release ships with clang 9.0.1: https://github.com/microsoft/vscode-cpptools/releases/tag/0.27.0-insiders
Hello, after installed the 0.27.0-insiders2, I still get clang-format 6.0.0.
To Reproduce
$HOME/.vscode/extensions/ms-vscode.cpptools-0.27.0-insiders2/LLVM/bin/clang-format.darwin --version
clang-format version 6.0.0 (tags/RELEASE_600/final)
Hi @baiyongrui . Thanks for reporting this. As a temporary work around, you could delete the contents of LLVM/bin, as well as install.lock. The next time launched, it will download the proper version of clang-format.
Hi @baiyongrui . Thanks for reporting this. As a temporary work around, you could delete the contents of
LLVM/bin, as well asinstall.lock. The next time launched, it will download the proper version of clang-format.
That worked
@baiyongrui 0.27.0-insiders3 should have clang-format 9.0.1 now.
@baiyongrui 0.27.0-insiders3 should have clang-format 9.0.1 now.
It works! Thanks!
Most helpful comment
The right thing to do is to pick the clang-format in PATH over the VSCode one.