-
Notifications
You must be signed in to change notification settings - Fork 34.9k
Description
Many languages have "properties" on classes that require executing code when executed. Users often want to see these in the debug views (Watch, Variables, Evaluation) but executing them can be expensive and/or produce side-effects.
In Dart, we evaluate these by default but have a setting to turn it off - however it's a little hard to discover this if you don't know where to look.
It would be nice if there was some way to return some "placeholder" variables from a variablesRequest that could require some user-action to evaluate. For example, given the code:
class Person {
String name = "Danny";
String get email {
return "foo@example.bar";
}
}
final a = Person();
When evaluating a
, I would like to be able to return a response that includes the value for name
but a lazy placeholder for email
that the user can trigger to get the value. It should look natural in the UI (eg. not wrapping the value for email
in some dummy object):
a
name: Danny
email: (click to evaluate)
The "click to evaluate" could perhaps just trigger evaluation of the evaluateName
on the variable?
This would also potentially allow common some well-known methods like toString()
to be included in the list without having to execute them (but providing an easy/convenient way for the user to see them).