-
Notifications
You must be signed in to change notification settings - Fork 341
[lldb/formatter] Format single valued OptionSets w/o brackets #1728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lldb/formatter] Format single valued OptionSets w/o brackets #1728
Conversation
Nice! |
My understanding is that swiftlang/swift#33731 is imminent, so we might want to hold off on actually merging this until the rebranch is complete. (Fingers crossed that it will actually happen soon). |
It's a good practice to add the bug tracking number in your commit/PR so people can get more context/history of what you're working on 🙂 |
@medismailben thanks, done. |
Even better: Since your change doesn't need anything in master-rebranch, you can just do it in swift/master and swift/master-next — and it will be picked up by the rebranch automatically. |
I've retargeted this PR to swift/master. |
@@ -167,6 +167,12 @@ bool lldb_private::formatters::swift::SwiftOptionSetSummaryProvider:: | |||
|
|||
for (auto val_name : *m_cases) { | |||
llvm::APInt case_value = val_name.first; | |||
// Print single valued sets without using enclosing brackets. | |||
if (case_value == value) { | |||
ss << '.' << val_name.second; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be nice to also make this change on line 184 and 187 in a follow-up commit.
Thanks! |
@swift-ci test |
I realized my added test cases needed matching |
@swift-ci test |
Is there also a matching PR for master-next? |
I haven't created one, sounds like I should, I will. |
master-next: #1735 |
Special case formatting of single valued option sets to print the case name without square brackets.
For example, instead producing
[.yellow]
, the output will be.yellow
.rdar://54106278