This is an archive of the discontinued LLVM Phabricator instance.

[lldb] tab completion for 'command delete/unalias'
ClosedPublic

Authored by MrHate on Jun 3 2020, 7:06 PM.

Details

Summary

Provided dedicated tab completions for command delete/unalias.

Diff Detail

Event Timeline

JDevlieghere added inline comments.Jun 3 2020, 10:20 PM
lldb/source/Commands/CommandObjectCommands.cpp
624

Spurious newline

628

Given that this is tied to the for loop I'd expect the newline before rather than after this line.

629

Can we use a range-based for loop?

teemperor requested changes to this revision.Jun 4 2020, 1:45 AM
teemperor added inline comments.
lldb/test/API/functionalities/completion/TestCompletion.py
405

I think this should be a longer command name than just 'f' that you can test searching the prefix. E.g. "long_command" (and complete from "long_". Also maybe add a second command that doesn't match the prefix to make sure we don't hit that ("other_command").

This revision now requires changes to proceed.Jun 4 2020, 1:45 AM
MrHate updated this revision to Diff 268389.EditedJun 4 2020, 2:08 AM
  1. modified newlines;
  2. using range-based for-loop now;
  3. modified the test case.
teemperor accepted this revision.Jul 6 2020, 2:26 AM

LGTM now, thanks!

lldb/source/Commands/CommandObjectCommands.cpp
719

FWIW, I think you can just inline the variable into the loop. I can do that for you when I merge this.

This revision is now accepted and ready to land.Jul 6 2020, 2:26 AM
JDevlieghere added inline comments.Jul 7 2020, 10:48 AM
lldb/source/Commands/CommandObjectCommands.cpp
628
for (const auto& alias : m_interpreter.GetAliases()) {
719

+1

This revision was automatically updated to reflect the committed changes.