[Lldb-commits] [PATCH] D81001: [lldb] Display autosuggestion part in gray if there is one possible suggestion

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 2 07:41:41 PDT 2020

labath added a comment.

Thanks for the patch. It's a very interesting feature, but I'm not sure it is actually a good idea. Some tab completions can be very expensive (not to mention they can crash lldb), and so running them after every keypress sounds problematic to me. Editors usually have very complex logic to implement these things efficiently and unobtrusively. It usually involves running the completions on a separate thread with various delays to avoid stalling a user who types fast and avoid burning the cpu needlessly.

I don't see anything like that in this patch, and I'm not sure the complexity that would entail is worth avoiding pressing tab a couple of times. If we really do want this feature, I think it should be controlled by a setting, and probably the setting should be off by default.

I'm not sure what's your main motivation for this, but they way I could see this potentially being useful is if we had a notion of "lightweight" completions. These would things that don't do any extraordinary amount of work (like parsing gigabytes of debug info) -- just basic completions for lldb commands and their arguments.

Regarding the actual patch, I have two quick comments:

- please avoid unrelated formatting changes -- run clang-format only over the lines you've changed (`git clang-format HEAD^` or something similar)
- don't work with `stdout` directly -- you should be using the "stdout" notions local to the Editline class (e.g.., `m_output_file`)

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list