================
@@ -1125,21 +1126,33 @@ void request_completions(const llvm::json::Object 
&request) {
   }
   llvm::json::Array targets;
 
-  if (g_dap.DetectExpressionContext(frame, text) ==
-      ExpressionContext::Variable) {
-    char command[] = "expression -- ";
-    text = command + text;
-    offset += strlen(command);
-  }
-  lldb::SBStringList matches;
-  lldb::SBStringList descriptions;
+  if (!text.empty() &&
+      llvm::StringRef(text).starts_with(g_dap.command_escape_prefix)) {
+    text = text.substr(g_dap.command_escape_prefix.size());
+  }
+
+  // While the user is typing then we likely have an incomplete input and 
cannot
+  // reliably determine the precise intent (command vs variable), try 
completing
+  // the text as both a command and variable expression, if applicable.
----------------
walter-erquinigo wrote:

good idea!

https://github.com/llvm/llvm-project/pull/78005
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to