Currently displays of objects are inconsistent between tools (VSCode and DevTools) and backends (VM and dwds).
The following issues prevent us from always consistently displaying objects:
-
dwds is representing getters as fields instead of methods
We are working on matching the VM behavior.
-
dart-code is using a VM-specific way (checking if private field _kind on the Function object equals to GetterFunction, which only works for VM, not dwds).
https://github.com/Dart-Code/Dart-Code/blob/15ad6615d8e8c02fd4393112f9896cf3bfc3c1fe/src/debug/dart_debug_impl.ts#L1424
-
DevTools does not show getters on objects at all.
We would like to eventually use dart-code logic for DevTools object display so all the debugging tools are consistent.
-
vm_service protocol does not provide a way of easily identifying getters:
-
Class does not indicate what function refs are getters:
|
// A list of functions in this class. Does not include functions |
-
If i understand correctly, @Function does not specify if the function is a getter either (only if it is an implicit getter):
|
class @Function extends @Object { |
Suggestion
So solve all the issues, we would need to solve 4. first.
Define a way to identify getters in vm_service protocol so the debugger can evaluate getters if requested (for all backends).
Currently displays of objects are inconsistent between tools (VSCode and DevTools) and backends (VM and dwds).
The following issues prevent us from always consistently displaying objects:
dwds is representing getters as fields instead of methods
We are working on matching the VM behavior.
dart-code is using a VM-specific way (checking if private field
_kindon the Function object equals toGetterFunction, which only works for VM, not dwds).https://github.com/Dart-Code/Dart-Code/blob/15ad6615d8e8c02fd4393112f9896cf3bfc3c1fe/src/debug/dart_debug_impl.ts#L1424
DevTools does not show getters on objects at all.
We would like to eventually use dart-code logic for DevTools object display so all the debugging tools are consistent.
vm_service protocol does not provide a way of easily identifying getters:
Classdoes not indicate what function refs are getters:sdk/runtime/vm/service/service.md
Line 2033 in 3daa47b
If i understand correctly,
@Functiondoes not specify if the function is a getter either (only if it is an implicit getter):sdk/runtime/vm/service/service.md
Line 2756 in 3daa47b
Suggestion
So solve all the issues, we would need to solve 4. first.
Define a way to identify getters in
vm_serviceprotocol so the debugger can evaluate getters if requested (for all backends).