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

Add setting to disable formatting #766

Closed
phoppermann opened this issue Jan 9, 2025 · 3 comments
Closed

Add setting to disable formatting #766

phoppermann opened this issue Jan 9, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@phoppermann
Copy link

The C/C++ extension for Visual Studio Code supports source code formatting using clang-format and vc_format. Both of these formatting options are included in the extension, with clang-format being the default.
[...]
By default, if an .editorconfig file with relevant settings is identified near the code being formatted, the Visual C++ formatting engine is used instead of clang-format.

https://code.visualstudio.com/docs/cpp/cpp-ide#_code-formatting

The clangd extension overwrites this and enforces clang-format. Thus defining the format via .editorconfig is impossible.

Add a setting to disable formatting in the clangd extension and fall back to formatting by the C/C++ extension.

@phoppermann phoppermann added the enhancement New feature or request label Jan 9, 2025
@HighCommander4
Copy link
Contributor

I believe the existing setting "editor.defaultFormatter" should work for this purpose.

@phoppermann
Copy link
Author

I wasn't aware of this setting. Could you add a small hint in https://github.com/clangd/vscode-clangd?tab=readme-ov-file#formatting?

@HighCommander4
Copy link
Contributor

I wasn't aware of this setting. Could you add a small hint in https://github.com/clangd/vscode-clangd?tab=readme-ov-file#formatting?

Sure; I sent out #768.

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

No branches or pull requests

2 participants