Search in sources :

Example 1 with VMServiceManager

use of io.flutter.vmService.VMServiceManager in project flutter-intellij by flutter.

the class VmServiceWidgetPerfProvider method setupConnection.

private void setupConnection(@NotNull VmService vmService) {
    if (isDisposed || connected) {
        return;
    }
    final VMServiceManager vmServiceManager = app.getVMServiceManager();
    assert vmServiceManager != null;
    connected = true;
    isolateRefStreamSubscription = vmServiceManager.getCurrentFlutterIsolate((isolateRef) -> requestRepaint(When.soon), false);
    vmService.addVmServiceListener(new VmServiceListenerAdapter() {

        @Override
        public void received(String streamId, Event event) {
            onVmServiceReceived(streamId, event);
        }

        @Override
        public void connectionClosed() {
        }
    });
    inspectorService = InspectorService.create(app, app.getFlutterDebugProcess(), app.getVmService());
    inspectorService.whenCompleteAsync((service, throwable) -> Disposer.register(this, service));
    requestRepaint(When.soon);
}
Also used : JsonObject(com.google.gson.JsonObject) DiagnosticsNode(io.flutter.inspector.DiagnosticsNode) IsolateRef(org.dartlang.vm.service.element.IsolateRef) Event(org.dartlang.vm.service.element.Event) StringUtil(com.intellij.openapi.util.text.StringUtil) VmService(org.dartlang.vm.service.VmService) InspectorService(io.flutter.inspector.InspectorService) VMServiceManager(io.flutter.vmService.VMServiceManager) CompletableFuture(java.util.concurrent.CompletableFuture) FileEditor(com.intellij.openapi.fileEditor.FileEditor) StreamSubscription(io.flutter.utils.StreamSubscription) Disposer(com.intellij.openapi.util.Disposer) VmServiceListener(org.dartlang.vm.service.VmServiceListener) NotNull(org.jetbrains.annotations.NotNull) FlutterApp(io.flutter.run.daemon.FlutterApp) VmServiceListenerAdapter(io.flutter.utils.VmServiceListenerAdapter) VMServiceManager(io.flutter.vmService.VMServiceManager) Event(org.dartlang.vm.service.element.Event) VmServiceListenerAdapter(io.flutter.utils.VmServiceListenerAdapter)

Example 2 with VMServiceManager

use of io.flutter.vmService.VMServiceManager in project flutter-intellij by flutter.

the class FlutterViewMessages method sendDebugActive.

public static void sendDebugActive(@NotNull Project project, @NotNull FlutterApp app, @NotNull VmService vmService) {
    final MessageBus bus = project.getMessageBus();
    final FlutterDebugNotifier publisher = bus.syncPublisher(FLUTTER_DEBUG_TOPIC);
    assert (app.getFlutterDebugProcess() != null);
    final VMServiceManager vmServiceManager = new VMServiceManager(app, vmService);
    Disposer.register(app.getFlutterDebugProcess().getVmServiceWrapper(), vmServiceManager);
    app.setVmServices(vmService, vmServiceManager);
    publisher.debugActive(new FlutterDebugEvent(app, vmService));
}
Also used : VMServiceManager(io.flutter.vmService.VMServiceManager) MessageBus(com.intellij.util.messages.MessageBus)

Aggregations

VMServiceManager (io.flutter.vmService.VMServiceManager)2 JsonObject (com.google.gson.JsonObject)1 FileEditor (com.intellij.openapi.fileEditor.FileEditor)1 Disposer (com.intellij.openapi.util.Disposer)1 StringUtil (com.intellij.openapi.util.text.StringUtil)1 MessageBus (com.intellij.util.messages.MessageBus)1 DiagnosticsNode (io.flutter.inspector.DiagnosticsNode)1 InspectorService (io.flutter.inspector.InspectorService)1 FlutterApp (io.flutter.run.daemon.FlutterApp)1 StreamSubscription (io.flutter.utils.StreamSubscription)1 VmServiceListenerAdapter (io.flutter.utils.VmServiceListenerAdapter)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 VmService (org.dartlang.vm.service.VmService)1 VmServiceListener (org.dartlang.vm.service.VmServiceListener)1 Event (org.dartlang.vm.service.element.Event)1 IsolateRef (org.dartlang.vm.service.element.IsolateRef)1 NotNull (org.jetbrains.annotations.NotNull)1