[Lldb-commits] [lldb] c832e82 - [lldb-vscode] disable completions

Walter Erquinigo via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 7 16:55:16 PST 2020


Author: Walter Erquinigo
Date: 2020-02-07T16:54:42-08:00
New Revision: c832e82cd9d8f53ed8af9ec86d9d06fedda9b23b

URL: https://github.com/llvm/llvm-project/commit/c832e82cd9d8f53ed8af9ec86d9d06fedda9b23b
DIFF: https://github.com/llvm/llvm-project/commit/c832e82cd9d8f53ed8af9ec86d9d06fedda9b23b.diff

LOG: [lldb-vscode] disable completions

Summary:
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.

Reviewers: clayborg

Subscribers: lldb-commits

Tags: #lldb

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

Added: 
    

Modified: 
    lldb/tools/lldb-vscode/lldb-vscode.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/tools/lldb-vscode/lldb-vscode.cpp b/lldb/tools/lldb-vscode/lldb-vscode.cpp
index 83ea23653ff0..94c8495d2b3e 100644
--- a/lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ b/lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -1260,8 +1260,22 @@ void request_initialize(const llvm::json::Object &request) {
   body.try_emplace("supportsGotoTargetsRequest", false);
   // The debug adapter supports the stepInTargetsRequest.
   body.try_emplace("supportsStepInTargetsRequest", false);
-  // The debug adapter supports the completionsRequest.
-  body.try_emplace("supportsCompletionsRequest", true);
+  // We need to improve the current implementation of completions in order to
+  // enable it again. For some context, this is how VSCode works: 
+  // - VSCode sends a completion request whenever chars are added, the user
+  //   triggers completion manually via CTRL-space or similar mechanisms, but
+  //   not when there's a deletion. Besides, VSCode doesn't let us know which
+  //   of these events we are handling. What is more, the use can paste or cut
+  //   sections of the text arbitrarily.
+  //   https://github.com/microsoft/vscode/issues/89531 tracks part of the
+  //   issue just mentioned.
+  // This behavior causes many problems with the current way completion is
+  // implemented in lldb-vscode, as these requests could be really expensive,
+  // blocking the debugger, and there could be many concurrent requests unless
+  // the user types very slowly... We need to address this specific issue, or
+  // at least trigger completion only when the user explicitly wants it, which
+  // is the behavior of LLDB CLI, that expects a TAB.
+  body.try_emplace("supportsCompletionsRequest", false);
   // The debug adapter supports the modules request.
   body.try_emplace("supportsModulesRequest", false);
   // The set of additional module information exposed by the debug adapter.


        


More information about the lldb-commits mailing list