This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Fix completion of 'settings set' values
ClosedPublic

Authored by kastiglione on Sep 22 2022, 9:18 PM.

Details

Summary

Some time ago, a refactor (1153dc960) broke completion for assigning settings
values (settings set). This was most annoying for enum settings, where you'd
have to get the valid enum names separately.

This restores the logic in the post-refactor completion function, as well as
adding a test to catch future regressions.

Event Timeline

kastiglione created this revision.Sep 22 2022, 9:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 22 2022, 9:18 PM
kastiglione requested review of this revision.Sep 22 2022, 9:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 22 2022, 9:18 PM
DavidSpickett added a subscriber: DavidSpickett.
DavidSpickett added inline comments.
lldb/test/API/functionalities/completion/TestCompletion.py
409

settings

410

Could you add to the comment why this one was chosen in particular? Something like:

Checks that we can complete a setting that has enum values.

Since there is a settings set test above but clearly that wasn't enough coverage.

DavidSpickett added inline comments.Sep 23 2022, 2:24 AM
lldb/test/API/functionalities/completion/TestCompletion.py
409

And these comments are rather redundant but it's the local style so it's fine to stick with it.

Rename test and change the docstring to be meaningful.

kastiglione added inline comments.Sep 23 2022, 9:49 AM
lldb/test/API/functionalities/completion/TestCompletion.py
410

done, I also renamed the test to describe why not what.

kastiglione added inline comments.Sep 23 2022, 10:57 AM
lldb/test/API/functionalities/completion/TestCompletion.py
410

correction: to describe what, not how.

DavidSpickett accepted this revision.Sep 26 2022, 1:11 AM

LGTM, thanks for the fix!

This revision is now accepted and ready to land.Sep 26 2022, 1:11 AM
This revision was automatically updated to reflect the committed changes.