Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS] Format Error #49

Closed
hexzerodev opened this issue Mar 2, 2023 · 4 comments
Closed

[macOS] Format Error #49

hexzerodev opened this issue Mar 2, 2023 · 4 comments
Assignees
Labels

Comments

@hexzerodev
Copy link

I'm getting this error with the command Format Document on a *.cl file (and also when saving with Format on Save enabled)

[OpenCL Formatter] Failed to find default 'clang-format' binary in 'ms-vscode.cpptools' extension.

Any guesses to what the issue is?

ms-vscode.cpptools installed
VSCode Version: 1.76.0
MacOS 12.3.1
OpenCL: Info works

@Galarius
Copy link
Owner

Galarius commented Mar 4, 2023

Hello, @hexzerodev! Thank you for reporting this. The executable name in ms-vscode.cpptools extension has changed. I will make an adjustment in the upcoming vscode-opencl release.

As a workaround, please specify the absolute clang-format path in the VS Code settings:

{
    "OpenCL.formatting.name": "/Users/<user name>/.vscode/extensions/ms-vscode.cpptools-<version>-darwin-x64/LLVM/bin/clang-format"
}

Replace <user name> and <version> with the appropriate values.

@Galarius Galarius self-assigned this Mar 4, 2023
@Galarius Galarius added the bug label Mar 4, 2023
@geeshta
Copy link

geeshta commented Mar 31, 2023

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"

@Galarius
Copy link
Owner

Galarius commented Apr 2, 2023

@geeshta, thank you for reporting, I'll take a look.

@Galarius Galarius changed the title Format Error [macOS] Format Error Apr 30, 2023
@Galarius
Copy link
Owner

Fixed in 0.8.0 for macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants