Search in sources :

Example 1 with ObservatoryConnector

use of com.jetbrains.lang.dart.ide.runner.ObservatoryConnector in project flutter-intellij by flutter.

the class DebugTestRunner method runInDebugger.

protected RunContentDescriptor runInDebugger(@NotNull TestLaunchState launcher, @NotNull ExecutionEnvironment env) throws ExecutionException {
    // Start process and create console.
    final ExecutionResult executionResult = launcher.execute(env.getExecutor(), this);
    final ObservatoryConnector connector = new Connector(executionResult.getProcessHandler());
    // Set up source file mapping.
    final DartUrlResolver resolver = DartUrlResolver.getInstance(env.getProject(), launcher.getTestFileOrDir());
    final PositionMapper.Analyzer analyzer = PositionMapper.Analyzer.create(env.getProject(), launcher.getTestFileOrDir());
    final PositionMapper mapper = new PositionMapper(env.getProject(), launcher.getPubRoot().getRoot(), resolver, analyzer);
    // Create the debug session.
    final XDebuggerManager manager = XDebuggerManager.getInstance(env.getProject());
    final XDebugSession session = manager.startSession(env, new XDebugProcessStarter() {

        @Override
        @NotNull
        public XDebugProcess start(@NotNull final XDebugSession session) {
            return new TestDebugProcess(env, session, executionResult, resolver, connector, mapper);
        }
    });
    return session.getRunContentDescriptor();
}
Also used : ObservatoryConnector(com.jetbrains.lang.dart.ide.runner.ObservatoryConnector) XDebugSession(com.intellij.xdebugger.XDebugSession) XDebugProcess(com.intellij.xdebugger.XDebugProcess) XDebuggerManager(com.intellij.xdebugger.XDebuggerManager) ExecutionResult(com.intellij.execution.ExecutionResult) ObservatoryConnector(com.jetbrains.lang.dart.ide.runner.ObservatoryConnector) NotNull(org.jetbrains.annotations.NotNull) XDebugProcessStarter(com.intellij.xdebugger.XDebugProcessStarter) DartUrlResolver(com.jetbrains.lang.dart.util.DartUrlResolver) PositionMapper(io.flutter.run.PositionMapper)

Aggregations

ExecutionResult (com.intellij.execution.ExecutionResult)1 XDebugProcess (com.intellij.xdebugger.XDebugProcess)1 XDebugProcessStarter (com.intellij.xdebugger.XDebugProcessStarter)1 XDebugSession (com.intellij.xdebugger.XDebugSession)1 XDebuggerManager (com.intellij.xdebugger.XDebuggerManager)1 ObservatoryConnector (com.jetbrains.lang.dart.ide.runner.ObservatoryConnector)1 DartUrlResolver (com.jetbrains.lang.dart.util.DartUrlResolver)1 PositionMapper (io.flutter.run.PositionMapper)1 NotNull (org.jetbrains.annotations.NotNull)1