[Lldb-commits] [lldb] [lldb-dap] Fix the completion provided to the DAP client. (PR #177151)

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 21 12:51:24 PST 2026


================
@@ -138,19 +147,13 @@ CompletionsRequestHandler::Run(const CompletionsArguments &args) const {
       const StringRef match = matches.GetStringAtIndex(i);
       const StringRef description = descriptions.GetStringAtIndex(i);
 
-      StringRef match_ref = match;
-      for (const StringRef commit_point : {".", "->"}) {
-        if (const size_t pos = match_ref.rfind(commit_point);
-            pos != StringRef::npos) {
-          match_ref = match_ref.substr(pos + commit_point.size());
-        }
-      }
-
       CompletionItem item;
-      item.text = match_ref;
       item.label = match;
       if (!description.empty())
         item.detail = description;
+      // lldb returned completions includes the partial typed token
+      // overwrite it.
+      item.length = partial_token_len;
 
       targets.emplace_back(std::move(item));
     }
----------------
adrian-prantl wrote:

I don't understand the context of this function so maybe this is okay, but the behavior here is odd:

```
"abc def "
        ^
"abc def"
    ^
"abcdef"
       ^
```
Is that the intended behavior?

https://github.com/llvm/llvm-project/pull/177151


More information about the lldb-commits mailing list