[Lldb-commits] [PATCH] D74264: [lldb-vscode] disable completions

walter erquinigo via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 7 16:58:56 PST 2020


wallace added a comment.

> These completion requests are also expected to be asynchronous right? Do we have any support for this right now? Currently we will deadlock in lldb-vscode handling the current completion until it completes right? To properly handle completion, we will need to be able to cancel a current completion and only remember the last completion that was sent and throw away any intermediate completions. Did we add support for that already, or do we read the first completion command, and then block until it completes and return the response, then handle any others.

Currently we are blocking in lldb-vscode until each completion completes. And as you say, there's no cancellation mechanism at the moment.

> IIUC if we get a completion for: "hello", we will go off and start trying to complete this, we might, while trying to complete "hello" get new requests in for "hello w" and "hello wo" and "hello wor" and "hello worl" queued up. If we have no async support, we will need to mark such packets as asynchronous, add the ability to cancel a completion if we don't already have that in the SBCommandInterpreter::HandleCompletion(...) functions, and then only remember the last unhandled completion "hello worl" in this case and respond with error to the first "hello" (canceled due to new completion that came in), "hello w", "hello wo" and "hello wor" since we won't try to complete those because new completions came in after these, and then issue the "hello worl" completion and respond as needed.

I agree with the async support needed for this

We might also think about putting a timeout in the completion code, so we don't even try to complete for a specific amount of time (1 second) so we could watch for new completions to come up. Do we know if the completion was just because someone was typing or if they requested it with CTRL-space?

> Timeouts make sense. Besides, we still don't know if the user triggered this manually or not. Hopefully at some point VSCode implements that


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74264/new/

https://reviews.llvm.org/D74264





More information about the lldb-commits mailing list