VS code clang-format extension not working in wsl

Viewed 414

I am using vscode and the Xaver Clang-format extension via Wsl with a custon .clang-format file. The extension does nothing when I save the file and when I select the option from the right click menu, I am however able to use clang format via the wsl terminal with clang-format -style=file -i "Path to my file"

"editor.formatOnSave": true,
"clang-format.executable": "/home/fede/skyward-boardcore/.clang-format",
"clang-format.style": "file",

This is the part relative to the extension in my settings.json file. I am using Windows 11 pro Version 10.0.22000 Build 22000 with Ubuntu 20.04.3 and vscode version 1.63. Does anybody know how to fix this? Thanks for your time

1 Answers

clang-format.executable would be the location of clang-format:

"clang-format.executable": "/usr/bin/clang-format",
Related