clang-format icon indicating copy to clipboard operation
clang-format copied to clipboard

Is a noop. Returns (clang-format: success) in mini buffer

Open appetrosyan opened this issue 5 years ago • 5 comments

Steps to reproduce open any file with extension .cpp. and run clang-format-buffer.

  • expected behaviour: file changes

  • actual behaviour noop.

appetrosyan avatar Jan 28 '20 01:01 appetrosyan

Yes, same for me. Worked for years, but currently it seems to be broken (just doesn't do anything)

Paethon avatar Feb 16 '20 13:02 Paethon

I had the same issue, and managed to fix the problem by replacing clang-format.el from melpa with the one in the newest clang installation.

hojoon-lee avatar Mar 31 '20 14:03 hojoon-lee

Finally, I figured it out. It only works if you have a .clang-format file:

https://emacs.stackexchange.com/a/55650/8261

Otherwise, it will use the fallback style. I changed it now to:

Clang Format Fallback Style: llvm

By default, it is none, which explains why nothing changed.

philipp-classen avatar May 07 '20 16:05 philipp-classen

Thanks @philipp-classen , i-t works for me.

haifenghan avatar May 19 '20 02:05 haifenghan

Copy from the stackexchange:

(*) To generate a .clang-format file, you can use:

clang-format -style=llvm -dump-config > .clang-format

haifenghan avatar May 19 '20 02:05 haifenghan