[all-commits] [llvm/llvm-project] de9e85: [lldb] Display autosuggestion part in gray if ther...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Fri Aug 14 02:38:24 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: de9e85026fcb7c3e992f12a86594fd50bb101ad3
      https://github.com/llvm/llvm-project/commit/de9e85026fcb7c3e992f12a86594fd50bb101ad3
  Author: Shu Anzai <shu.anzai at gmail.com>
  Date:   2020-08-14 (Fri, 14 Aug 2020)

  Changed paths:
    M lldb/include/lldb/Core/Debugger.h
    M lldb/include/lldb/Core/IOHandler.h
    M lldb/include/lldb/Host/Editline.h
    M lldb/include/lldb/Interpreter/CommandInterpreter.h
    M lldb/packages/Python/lldbsuite/test/lldbpexpect.py
    M lldb/source/Core/CoreProperties.td
    M lldb/source/Core/Debugger.cpp
    M lldb/source/Core/IOHandler.cpp
    M lldb/source/Host/common/Editline.cpp
    M lldb/source/Interpreter/CommandInterpreter.cpp
    M lldb/test/API/commands/expression/multiline-completion/TestMultilineCompletion.py
    A lldb/test/API/iohandler/autosuggestion/TestAutosuggestion.py
    M lldb/test/API/iohandler/completion/TestIOHandlerCompletion.py

  Log Message:
  -----------
  [lldb] Display autosuggestion part in gray if there is one possible suggestion

This is relanding D81001. The patch originally failed as on newer editline
versions it seems CC_REFRESH will move the cursor to the start of the line via
\r and then back to the original position. On older editline versions like
the one used by default on macOS, CC_REFRESH doesn't move the cursor at all.
As the patch changed the way we handle tab completion (previously we did
REDISPLAY but now we're doing CC_REFRESH), this caused a few completion tests
to receive this unexpected cursor movement in the output stream.
This patch updates those tests to also accept output that contains the specific
cursor movement commands (\r and then \x1b[XC). lldbpexpect.py received an
utility method for generating the cursor movement escape sequence.

Original summary:

I implemented autosuggestion if there is one possible suggestion.
I set the keybinds for every character. When a character is typed, Editline::TypedCharacter is called.
Then, autosuggestion part is displayed in gray, and you can actually input by typing C-k.
Editline::Autosuggest is a function for finding completion, and it is like Editline::TabCommand now, but I will add more features to it.

Testing does not work well in my environment, so I can't confirm that it goes well, sorry. I am dealing with it now.

Reviewed By: teemperor, JDevlieghere, #lldb

Differential Revision: https://reviews.llvm.org/D81001




More information about the All-commits mailing list