================
@@ -98,9 +83,15 @@ void ScopesRequestHandler::operator()(const 
llvm::json::Object &request) const {
                                              /*statics=*/true,
                                              /*in_scope_only=*/true);
   dap.variables.registers = frame.GetRegisters();
-  body.try_emplace("scopes", dap.CreateTopLevelScopes());
-  response.try_emplace("body", std::move(body));
-  dap.SendJSON(llvm::json::Value(std::move(response)));
+
+  std::vector scopes = {CreateScope("Locals", VARREF_LOCALS,
+                                    dap.variables.locals.GetSize(), false),
+                        CreateScope("Globals", VARREF_GLOBALS,
+                                    dap.variables.globals.GetSize(), false),
+                        CreateScope("Registers", VARREF_REGS,
+                                    dap.variables.registers.GetSize(), false)};
+
+  return ScopesResponseBody{std::move(scopes)};
----------------
da-viper wrote:

I  think it should be only in the scoped request since nothing outside is using 
the functionality.

would be worth it to move it to the variables if there was another request that 
depends on getting all the scopes. 



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

Reply via email to