This revision was automatically updated to reflect the committed changes.
Closed by commit rC328627: [clang-format] Do not insert space before closing
brace in ObjC dict literal (authored by benhamilton, committed by ).
Changed prior to commit:
benhamilton added a comment.
I filed https://bugs.llvm.org/show_bug.cgi?id=36919 to follow up and make ObjC
dictionary literal spacing consistent with ObjC array literals.
Repository:
rC Clang
https://reviews.llvm.org/D44816
___
cfe-commits
djasper accepted this revision.
djasper added a comment.
Yeah, it's one of these things where neither way would be totally intuitive to
everyone.
Repository:
rC Clang
https://reviews.llvm.org/D44816
___
cfe-commits mailing list
benhamilton added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:2484
+ if (Right.is(tok::r_brace) && Right.MatchingParen &&
+ Right.MatchingParen->is(TT_DictLiteral) &&
+ Right.MatchingParen->Previous &&
djasper wrote:
> Could you use
benhamilton updated this revision to Diff 139930.
benhamilton marked an inline comment as done.
benhamilton added a comment.
- Use `Right.MatchingParen->endsSequence(TT_DictLiteral, tok::at)`
Repository:
rC Clang
https://reviews.llvm.org/D44816
Files:
lib/Format/TokenAnnotator.cpp
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Generally looks good, one minor simplification.
Comment at: lib/Format/TokenAnnotator.cpp:2484
+ if (Right.is(tok::r_brace) && Right.MatchingParen &&
+
benhamilton created this revision.
benhamilton added reviewers: djasper, jolesiak, Wizard.
Herald added subscribers: cfe-commits, klimek.
Previously, `clang-format` would sometimes insert a space
before the closing brace in an Objective-C dictionary literal.
Unlike array literals (which obey