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

clang-format cannot apply Google format on Linux and on MacOs... #175

Open
minwang-ai opened this issue Oct 17, 2024 · 0 comments
Open

clang-format cannot apply Google format on Linux and on MacOs... #175

minwang-ai opened this issue Oct 17, 2024 · 0 comments

Comments

@minwang-ai
Copy link

minwang-ai commented Oct 17, 2024

Here is my user setting JSON:

{
    "workbench.colorTheme": "Default Dark+",
    "terminal.integrated.inheritEnv": false,
    "remote.SSH.connectTimeout": 60,
    "security.workspace.trust.untrustedFiles": "open",
    "editor.accessibilitySupport": "on",
    "files.autoSave": "afterDelay",
    "editor.fontSize": 24,
    "[cpp]": {
        "editor.defaultFormatter": "xaver.clang-format"
    },
    "clang-format.fallbackStyle": "Google",  // Use a valid fallback like Google
    "clang-format.style": "file",            // Look for the .clang-format file in your project
    "clang-format.executable": "/usr/local/bin/clang-format",
    "C_Cpp.formatting": "clangFormat",
    "C_Cpp.clang_format_fallbackStyle": "Google",
    "C_Cpp.clang_format_path": "/usr/local/bin/clang-format",
    "C_Cpp.clang_format_style": "file"
}

The resulting format of a simple code is always like this default format:

#include <iostream>

int main() { std::cout << "Hello world!\n"; }`

I also tried command like clang-format -style=google -i hello.cpp

However, google format should be something similar to this:

#include <iostream>
int main() {
  std::cout << "Hello world!" << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant