Hey observatory folks, I have a question about dart:developer registerExtension(). It looks like it's meant to allow Dart code to expose details about itself to a debugger client. A dart library or app can basically add new grammar to the server protocol; it that correct?
I've played with it but was not able to get it working. I created a dart app which registered a new extension ("foo"), and when the app was paused I tried to invoke that handler from a service protocol client (the atom debugger). I only ever got errors back from the "foo" command. Other commands worked fine ("getVersion", ...). This is for 1.14.0-dev.1.0. Is this functionality not hooked, am I mis-understanding what it is for, or am I just using it incorrectly?
https://api.dartlang.org/1.13.0/dart-developer/registerExtension.html--Devon CarewSoftware EngineerGoogle, Inc.
--
You received this message because you are subscribed to the Google Groups "Dart VM Observatory Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to observatory-dis...@dartlang.org.
registerExtension('foo', fooHandler);
Future<ServiceExtensionResponse> fooHandler(String method, Map parameters) {return new Future.value(new ServiceExtensionResponse.result('bar'));}
The problem is that service protocol requests without an isolateId parameter are routed to the service isolate and not the isolate that called registerExtension. Given what the service isolate knows, it is returning the correct error code.
Almost all service protocol requests require a target isolate (with few exceptions for getFlags and getVM).
John