aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite
diff options
context:
space:
mode:
authorAdrian Vogelsgesang <avogelsgesang@salesforce.com>2024-10-03 02:50:46 +0200
committerGitHub <noreply@github.com>2024-10-03 02:50:46 +0200
commita5876bef61e44453b915e1f79366ca1bbfdba371 (patch)
tree9d08fd5f60969974ef1c9d1811c1e7dc3c8b54fe /lldb/packages/Python/lldbsuite
parent6a3468403e0e42aa053e78591b7b24052a58db1e (diff)
downloadllvm-a5876bef61e44453b915e1f79366ca1bbfdba371.zip
llvm-a5876bef61e44453b915e1f79366ca1bbfdba371.tar.gz
llvm-a5876bef61e44453b915e1f79366ca1bbfdba371.tar.bz2
[lldb-dap] Correct auto-completion based on ReplMode and escape char (#110784)
This commit improves the auto-completion in the Debug Console provided by VS-Code. So far, we were always suggesting completions for both LLDB commands and for variables / expressions, even if the heuristic already determined how the given string will be executed, e.g., because the user explicitly typed the escape prefix. Furthermore, auto-completion after the escape character was broken, since the offsets were not adjusted correctly. With this commit we now correctly take this into account. Even with this commit, auto-completion does not always work reliably: * VS Code only requests auto-completion after typing the first alphabetic character, but not after punctuation characters. This means that no completions are provided after typing "`" * LLDB does not provide autocompletions if a string is an exact match. This means if a user types `l` (which is a valid command), LLDB will not provide "language" and "log" as potential completions. Even worse, VS Code caches the completion and does client-side filtering. Hence, even after typing `la`, no auto-completion for "language" is shown in the UI. Those issues might be fixed in follow-up commits. Also with those known issues, the experience is already much better with this commit. Furthermore, I updated the README since I noticed that it was slightly inaccurate.
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
index 449af1b..1d5e6e0 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
@@ -1006,7 +1006,7 @@ class DebugCommunication(object):
return response
def request_completions(self, text, frameId=None):
- args_dict = {"text": text, "column": len(text)}
+ args_dict = {"text": text, "column": len(text) + 1}
if frameId:
args_dict["frameId"] = frameId
command_dict = {