VmServiceClient class
Typed VM-service client used by LeonardSession.
Two construction modes:
- fromVmService wraps an already-connected
VmServicesupplied by the caller (e.g. the DevTools extension'sserviceManager.service) as a borrowed connection. fromOwnedVmServiceresolves the first isolate for a connection opened by the I/O-only entrypoint and marks it as owned.
Platform imports are confined by tool/check_no_dart_io.sh. Tests inject a
fake via VmServiceClient.forTest.
Constructors
- VmServiceClient.forTest(VmService vm, String isolateId, {bool ownsConnection = false})
-
Test-only alias for fromVmService. Retained so existing tests
compile unchanged; new code should use fromVmService. Pass
ownsConnection: trueto exercise owning disposal.factory - VmServiceClient.fromVmService(VmService vm, String isolateId)
-
Wrap an already-connected
VmServiceand pinisolateIdas the binding's home isolate.factory
Properties
Methods
-
callExtension(
String extension, Map< String, dynamic> args) → Future<Map< String, dynamic> > -
Generic escape hatch for extension-provided extensions (used to
pull extension contributions). The
extensionstring is passed through verbatim. -
dispose(
) → Future< void> -
Dispose the VM-service connection — but ONLY if the I/O entrypoint
created it. A client built from a BORROWED connection
(fromVmService, e.g. DevTools' shared
serviceManager.service) must not tear down a connection it does not own, so dispose is a no-op there. This is what stops a DevTools session teardown from killing the panel's live link to the app. -
executeAction(
String name, Map< String, dynamic> args) → Future<Map< String, dynamic> > -
Invoke the per-tool VM service extension that the binding registers
via
ExtensionContext.registerExtension:ext.leonard.<namespace>.<tool>. -
handshake(
) → Future< HandshakeResult> -
Exchange the
ext.leonard.core.handshakecontract version and active extension manifest. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
connectForTest(
VmService vm) → Future< VmServiceClient> -
Exercise the owning connect path with an already-open
vm.