================
@@ -836,7 +837,10 @@ std::string 
VariableDescription::GetResult(protocol::EvaluateContext context) {
   // Try the SBValue::GetDescription(), which may call into language runtime
   // specific formatters (see ValueObjectPrinter).
   lldb::SBStream stream;
-  v.GetDescription(stream);
+  if (context == protocol::eEvaluateContextRepl)
----------------
ashgti wrote:

I think that `eDescriptionLevelFull` makes sense for the clipboard context.

For reference, `vscode-js-debug` will JSONify the result when you copy the 
value, so given `let a = {foo: "bar", baz: { a: [1, 2, 3, 4, 5, 6, 7, 8, 9], b: 
123n, "complex key": true }}` `evaluate({'expression': 'a', 'context': 
'clipboard'})` becomes:

```
{
  foo: "bar",
  baz: {
    a: [
      1,
      2,
      3,
      4,
      5,
      6,
      7,
      8,
      9,
    ],
    b: 123n,
    "complex key": true,
  },
}
```

I could see the repl context being somewhat less verbose if we have the 
variable reference for the value, since you can expand the variable reference 
to dive into details under the top level result.

But, I think either of these are somewhat subjective so feel free to go with 
your preference.

https://github.com/llvm/llvm-project/pull/170644
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to