spawnSync clang-format ENOENT
Hello.
I installed your great extension. However always when i use Ctrl + Shift + I I get this error:
spawnSync clang-format ENOENT
OS: Linux Mint 19.1
VSCode 1.32.1 (Latest version)
Hi, you need to have clang-format in you path
@zxh0 would it be possible to add a config setting to specify the clang-format path? That is how other extensions usually solve this issue :)
macos: brew install clang-format linux: sudo apt install clang-format
I have the following config:
{
"protoc": {
"path": "/usr/bin/clang-format-6.0"
}
}
but it still gives the same error. I don't see anything in the logs.
@gracenoah This path config for protoc isn't going to work. The extension tries to call clang-format on save (if you have "format on save" enabled).
You can create a symbolic link since your clang-format binary is not strictly clang-format but clang-format-6.0:
ln -s /usr/bin/clang-format-6.0 /usr/bin/clang-format
https://marketplace.visualstudio.com/items?itemName=xaver.clang-format
This extension will attempt to find clang-format on your PATH. Alternatively, the clang-format executable can be specified in your vscode settings.json file:
{
"clang-format.executable": "/absolute/path/to/clang-format"
}
Is there a way to disable formatting, because there is no way of setting the tab size via settings.json.
Or you can add the ability to set the tab size via the clang-format option like you did with the style option, e.g. "clang-format.indentWidth": 4 or "clang-format.tabSize": 4
Add this line into settings.json ?
"editor.formatOnSave": false,
@Techassi you can have a look at this https://github.com/zxh0/vscode-proto3/issues/79 , you are able to tune the settings directly from vscode