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

[Linux] Format Error

Open Galarius opened this issue 1 year ago • 0 comments

          Hi, I have a problem when running on Ubuntu, I've tried setting the absolute path to the formatter:
"OpenCL.formatting.name": "/home/<my username>/.vscode/extensions/ms-vscode.cpptools-1.14.5-linux-x64/LLVM/bin/clang-format"

However whenever I try to format a .cl file, I get this popup:

[OpenCL Formatter] Failed to format document. Check the console in dev tools to find errors when formatting.

And when I go to Output -> Extension Host I see

2023-03-31 12:21:28.793 [error] [galarius.vscode-opencl] provider FAILED
2023-03-31 12:21:28.793 [error] undefined

What works for me is installing clang-format directly with sudo apt install clang-format and then setting the path to its binary

"OpenCL.formatting.name": "/usr/bin/clang-format"

Originally posted by @geeshta in https://github.com/Galarius/vscode-opencl/issues/49#issuecomment-1491696282

Galarius avatar Apr 30 '23 12:04 Galarius