diff options
author | Martin Probst <martin@probst.io> | 2017-08-14 16:09:08 +0000 |
---|---|---|
committer | Martin Probst <martin@probst.io> | 2017-08-14 16:09:08 +0000 |
commit | 325ff7c5e00760b111d455608c7bf2257d093f95 (patch) | |
tree | e56bfcbeedfbcd43ad326b8c522c7d7b46aa48c5 /clang/lib/Tooling/Refactoring/Rename/RenamingAction.cpp | |
parent | 83e0220b3ff81cd265e93d3d6029cb330b3fd87a (diff) | |
download | bcm5719-llvm-325ff7c5e00760b111d455608c7bf2257d093f95.tar.gz bcm5719-llvm-325ff7c5e00760b111d455608c7bf2257d093f95.zip |
clang-format: [JS] wrap optional properties in type aliases.
Summary:
clang-format wraps object literal keys in an object literal if they are
marked as `TT_SelectorName`s and/or the colon is marked as
`TT_DictLiteral`. Previously, clang-format would accidentally work
because colons in type aliases were marked as `TT_DictLiteral`. r310367
fixed this to assing `TT_JsTypeColon`, which broke wrapping in certain
situations. However the root cause was that clang-format incorrectly
didn't skip questionmarks when detecting selector name.
This change fixes both locations to (1) assign `TT_SelectorName` and (2)
treat `TT_JsTypeColon` like `TT_DictLiteral`.
Previously:
type X = {
a: string, b?: string,
};
Now:
type X = {
a: string,
b?: string,
};
Reviewers: djasper, sammccall
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D36684
llvm-svn: 310852
Diffstat (limited to 'clang/lib/Tooling/Refactoring/Rename/RenamingAction.cpp')
0 files changed, 0 insertions, 0 deletions