Skip to content

incorrect clang-format -style formatting #2524

@yagehu

Description

@yagehu

After I correctly set C_Cpp.clang_format_path and format a cpp document, the file doesn't get formatted, and there is no error output. I have verified that error gets printed to output correctly by setting C_Cpp.clang_format_path to some non-existent path. e.g.

/not/a/real/path -style={ BasedOnStyle: LLVM } -fallback-style=LLVM -sort-includes=0 -assume-filename=<some cpp file>
  Can't find or run process_name

If I run the command clang-format -style={ BasedOnStyle: LLVM } -fallback-style=LLVM -sort-includes=0 -assume-filename=<some cpp file> on the command line, clang-format errors out because -style={ BasedOnStyle: LLVM } should be -style='{ BasedOnStyle: LLVM }'. I suspect this is the reason for the file to not get formatted.

On Linux btw.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language Servicebuginvestigate: reproThis issue's repro steps needs to be investigated/confirmedmore info neededThe issue report is not actionable in its current statenot reproingWe're not able to reproduce the issue (it's unlikely to get fixed until we find one).

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions