summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
diff options
context:
space:
mode:
authorWalter Erquinigo <waltermelon@oculus.com>2019-10-30 16:46:06 -0700
committerWalter Erquinigo <waltermelon@oculus.com>2019-11-15 17:37:55 -0800
commit2c7c528d7ac17230f1f239b629a02d407a74e1bf (patch)
tree3d2a8b7f753341ebebd14f0785ebcb6e69b582db /lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
parent979da9a4c3ba435b384a11af7bd3154b0309b487 (diff)
downloadbcm5719-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/vscode.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
index b4e21989463..1110ad36c0f 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
@@ -348,6 +348,10 @@ class DebugCommunication(object):
print('invalid response')
return None
+ def get_completions(self, text):
+ response = self.request_completions(text)
+ return response['body']['targets']
+
def get_scope_variables(self, scope_name, frameIndex=0, threadId=None):
stackFrame = self.get_stackFrame(frameIndex=frameIndex,
threadId=threadId)
@@ -715,6 +719,18 @@ class DebugCommunication(object):
}
return self.send_recv(command_dict)
+ def request_completions(self, text):
+ args_dict = {
+ 'text': text,
+ 'column': len(text)
+ }
+ command_dict = {
+ 'command': 'completions',
+ 'type': 'request',
+ 'arguments': args_dict
+ }
+ return self.send_recv(command_dict)
+
def request_stackTrace(self, threadId=None, startFrame=None, levels=None,
dump=False):
if threadId is None:
OpenPOWER on IntegriCloud