Completion requests are causing some problems in the debugger, which is explained in the comment in the code.
I'm disabling it for now until we have time to do a good implementation of it.
Details
- Reviewers
clayborg - Commits
- rGc832e82cd9d8: [lldb-vscode] disable completions
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
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.
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.
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?
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