================
@@ -198,27 +85,25 @@ void CompletionsRequestHandler::operator()(
       std::string match = matches.GetStringAtIndex(i);
       std::string description = descriptions.GetStringAtIndex(i);
 
-      llvm::json::Object item;
-      llvm::StringRef match_ref = match;
-      for (llvm::StringRef commit_point : {".", "->"}) {
+      CompletionItem item;
+      StringRef match_ref = match;
+      for (StringRef commit_point : {".", "->"}) {
         if (match_ref.contains(commit_point)) {
           match_ref = match_ref.rsplit(commit_point).second;
         }
       }
-      EmplaceSafeString(item, "text", match_ref);
+      item.text = match_ref;
 
       if (description.empty())
-        EmplaceSafeString(item, "label", match);
+        item.label = match;
       else
-        EmplaceSafeString(item, "label", match + " -- " + description);
+        item.label = match + " -- " + description;
 
       targets.emplace_back(std::move(item));
     }
   }
 
-  body.try_emplace("targets", std::move(targets));
-  response.try_emplace("body", std::move(body));
-  dap.SendJSON(llvm::json::Value(std::move(response)));
+  return CompletionsResponseBody{targets};
----------------
da-viper wrote:

```suggestion
  return CompletionsResponseBody{std::move(targets)};
```

https://github.com/llvm/llvm-project/pull/153317
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to