[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion
Shu Anzai via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Jun 23 11:48:38 PDT 2020
gedatsu217 added inline comments.
================
Comment at: lldb/source/Interpreter/CommandInterpreter.cpp:1875-1878
+ if (entry.startswith(line)) {
+ llvm::StringRef res = entry.substr(line.size());
+ result = res.str();
+ return result;
----------------
labath wrote:
> ```
> if (entry.consume_front(line)) {
> result = entry.str();
> return result; // Why is this returning the result both as a proper return value and a by-ref argument?
> }
> ```
That is because using the llvm::Optional as a return value instead of void would make it more obvious what the function returns in case there is no suggestion.
We've discussed this issue before, so please see the comments above.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81001/new/
https://reviews.llvm.org/D81001
More information about the lldb-commits
mailing list