vscode-proto3 icon indicating copy to clipboard operation
vscode-proto3 copied to clipboard

clang-format not found

Open litichevskiydv opened this issue 5 years ago • 13 comments

Hello! After each saving proto-file I see message "spawnSync clang-format ENOENT", source vscode-proto3. VSCode version: 1.29.1 ms-vscode.cpptools version: 0.20.1 message

litichevskiydv avatar Nov 22 '18 09:11 litichevskiydv

hi @litichevskiydv , maybe you enabled "editor.formatOnSave" . to solve this problem, you can disable this option for the project (by modifying .vscode/settings.json). or you can just install clang-format and put it in the path .

zxh0 avatar Nov 23 '18 10:11 zxh0

@zxh0, you right, option "editor.formatOnSave" is enabled, but it was enabled long ago and before updating VSCode I've never seen such error. I found clang-format in the directory of the ms-vscode.cpptools extension, for my version it is ms-vscode.cpptools-0.20.1\LLVM\bin\ , is it compatible with the extension? Is it possible somehow to restore old behavior of the extension when it doesn't need to disable option "editor.formatOnSave" or add clang-format to path?

litichevskiydv avatar Nov 25 '18 14:11 litichevskiydv

sorry for this problem : ( i will try my best to solve it in next release

zxh0 avatar Nov 25 '18 23:11 zxh0

@zxh0, thank you!

litichevskiydv avatar Nov 26 '18 10:11 litichevskiydv

How can I find the clang-format install path,because I install by extention store.

UTC-Six avatar Jun 02 '19 06:06 UTC-Six

How can I find the clang-format install path,because I install by extention store.

If you're using Windows, you should be able to execute

where clang-format.exe

jpreese avatar Jun 18 '19 17:06 jpreese

How can I find the clang-format install path,because I install by extention store.

If you're using Windows, you should be able to execute

where clang-format.exe

what if mac?

justlikeliuen avatar Jul 03 '19 06:07 justlikeliuen

@justlikeliuen which clang-format

zxh0 avatar Jul 03 '19 09:07 zxh0

Check https://formulae.brew.sh/formula/clang-format if you have homebrew installed.

hc-danieltiziani avatar Jan 07 '20 17:01 hc-danieltiziani

You don't have to disabled anything, just install clang-format using brew install clang-format then install clang-format plugin for vscode.

alinz avatar Feb 03 '20 18:02 alinz

Indeed brew install clang-format and installing clang-format pluging this solves the problem for me (on a Mac), but does this mean additional installation instructions are needed somewhere?

anselanza avatar Mar 25 '20 08:03 anselanza

I just noticed this same issue on Windows. My C++ plugins work fine with clang-format, but for a protobuf file, I get the exact same error message as in this bug report. I never knowingly installed clang-format, is it somehow independently integrated into the microsoft c++ plugins? For now, I will also disable editor.formatOnSave for protobuf schemas.

macdew avatar Sep 25 '20 15:09 macdew

Hello! After each saving proto-file I see message "spawnSync clang-format ENOENT", source vscode-proto3. VSCode version: 1.29.1 ms-vscode.cpptools version: 0.20.1 message

Just install clang-format using homebrew. brew install clang-format It will install and set the path for clang-format.

devminnu avatar Oct 05 '20 09:10 devminnu