diff options
author | Walter Erquinigo <waltermelon@oculus.com> | 2019-10-30 16:46:06 -0700 |
---|---|---|
committer | Walter Erquinigo <waltermelon@oculus.com> | 2019-11-15 17:37:55 -0800 |
commit | 2c7c528d7ac17230f1f239b629a02d407a74e1bf (patch) | |
tree | 3d2a8b7f753341ebebd14f0785ebcb6e69b582db /lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/completions/main.cpp | |
parent | 979da9a4c3ba435b384a11af7bd3154b0309b487 (diff) | |
download | bcm5719-llvm-2c7c528d7ac17230f1f239b629a02d407a74e1bf.tar.gz bcm5719-llvm-2c7c528d7ac17230f1f239b629a02d407a74e1bf.zip |
[lldb-vscode] support the completion request
Summary:
The DAP has a completion request that has been unimplemented. It allows showing autocompletion tokens inside the Debug Console.
I implemented it in a very simple fashion mimicking what the user would see when autocompleting an expression inside the CLI.
There are two cases: normal variables and commands. The latter occurs when a text is prepepended with ` in the Debug Console.
These two cases work well and have tests.
Reviewers: clayborg, aadsm
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D69873
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/completions/main.cpp')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/completions/main.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/completions/main.cpp b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/completions/main.cpp new file mode 100644 index 00000000000..14a8815a524 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/completions/main.cpp @@ -0,0 +1,16 @@ +#include <string> +#include <vector> + +int fun(std::vector<std::string> var) { + return var.size(); // breakpoint 1 +} + +int main(int argc, char const *argv[]) { + int var1 = 0; + int var2 = 1; + std::string str1 = "a"; + std::string str2 = "b"; + std::vector<std::string> vec; + fun(vec); + return 0; // breakpoint 2 +} |