zxh0 / vscode-proto3

vscode extension for proto3
MIT License
325 stars 74 forks source link

clang-format not found #41

Open litichevskiydv opened 5 years ago

litichevskiydv commented 5 years ago

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

zxh0 commented 5 years ago

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 .

litichevskiydv commented 5 years ago

@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?

zxh0 commented 5 years ago

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

litichevskiydv commented 5 years ago

@zxh0, thank you!

UTC-Six commented 5 years ago

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

jpreese commented 5 years ago

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

justlikeliuen commented 5 years ago

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?

zxh0 commented 5 years ago

@justlikeliuen which clang-format

hc-danieltiziani commented 4 years ago

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

alinz commented 4 years ago

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

anselanza commented 4 years ago

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?

macdew commented 4 years ago

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.

devminnu commented 4 years ago

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.