Author: Dave Lee
Date: 2023-03-07T11:13:25-08:00
New Revision: e221dab07815016fb04deb5d38441e77d1cd300a

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

LOG: [lldb-vscode] Use `expression` command for completion

Change lldb-vscode to use the `expression` command for generating completions, 
instead
of the `p` alias.

Aliases are user overrideable, and even deletable, but the `expression` command 
is
unchangeable.

See D141539 where a similar replacement was done to tests.

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

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 b70f5b0ec8bde..51a72f2b03c95 100644
--- a/lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ b/lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -1065,8 +1065,9 @@ void request_completions(const llvm::json::Object 
&request) {
     text = text.substr(1);
     actual_column--;
   } else {
-    text = "p " + text;
-    actual_column += 2;
+    char command[] = "expression -- ";
+    text = command + text;
+    actual_column += strlen(command);
   }
   lldb::SBStringList matches;
   lldb::SBStringList descriptions;


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to