mprobst / ClangFormatIJ

clang-format for IntelliJ based IDEs
Apache License 2.0
15 stars 9 forks source link

Not work for AppCode #1

Open KelaKing opened 8 years ago

KelaKing commented 8 years ago

cannot reformat Objective-C code. but i can reformat by clang-format command.

mprobst commented 8 years ago

Do you get an error message, or silent failure? Generally speaking this should work. Have you tried re-binding the key binding?

KelaKing commented 7 years ago

@mprobst no error message error

mprobst commented 7 years ago

Are you sure clang-format is triggering at all? The break in the middle of a keyword looks very strange, no idea how that could happen.

KelaKing notifications@github.com schrieb am Mi., 7. Sep. 2016 um 20:44 Uhr:

@mprobst https://github.com/mprobst no error message [image: error] https://cloud.githubusercontent.com/assets/13584044/18336375/4afda460-75b9-11e6-8935-9dca366943bd.gif

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/mprobst/ClangFormatIJ/issues/1#issuecomment-245485541, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAcKLYBEOlP2KILP5AEAMKbAMxjhjK4ks5qn4SVgaJpZM4Jzg3K .

kbtombul commented 7 years ago

I am experiencing the same issue. ClangFormat-Xcode and command line works fine but ClangFormatIJ seems to fail. I tried both AppCode 2016.2.2 and 2016.3 EAP.

Here is the simplest example:

#import "Foo.h"
#import "Bar.h"
#import "Baz.h"

becomes

##import "Bar.h"
#import "Baz.h"
#import "Foo.h"

Note that the order of the imports is correct so clang-format definitely ran. However, it looks like there is an off-by-one error, the first # is left out and the last new line disappeared.

ghost commented 7 years ago

@KelaKing @kbtombul @mprobst The Clang-format return wrong answer under the mac os with -output-replacements-xml key when the code uses the utf encoding. For example length of '©' symbol is equals 2.
As a temporary solution to this problem, I propose to try use the following fork: https://github.com/CheslavBochko/ClangFormatIJ

mprobst commented 7 years ago

I'm happy to take pull requests on this @CheslavBochko (I'm not entirely sure I follow your fix in fork though).

0x11901 commented 6 years ago

same error with appcode(2017.3.3).

MeGaPk commented 4 years ago

same error on appcode 2019.3 EAP