Search in sources :

Example 1 with FlutterPositionMapper

use of io.flutter.run.FlutterPositionMapper in project flutter-intellij by flutter.

the class FlutterTestRunner 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 FlutterPositionMapper.Analyzer analyzer = FlutterPositionMapper.Analyzer.create(env.getProject(), launcher.getTestFileOrDir());
    final FlutterPositionMapper mapper = new FlutterPositionMapper(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(io.flutter.ObservatoryConnector) XDebugSession(com.intellij.xdebugger.XDebugSession) XDebugProcess(com.intellij.xdebugger.XDebugProcess) XDebuggerManager(com.intellij.xdebugger.XDebuggerManager) ExecutionResult(com.intellij.execution.ExecutionResult) ObservatoryConnector(io.flutter.ObservatoryConnector) NotNull(org.jetbrains.annotations.NotNull) XDebugProcessStarter(com.intellij.xdebugger.XDebugProcessStarter) DartUrlResolver(com.jetbrains.lang.dart.util.DartUrlResolver) FlutterPositionMapper(io.flutter.run.FlutterPositionMapper)

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 DartUrlResolver (com.jetbrains.lang.dart.util.DartUrlResolver)1 ObservatoryConnector (io.flutter.ObservatoryConnector)1 FlutterPositionMapper (io.flutter.run.FlutterPositionMapper)1 NotNull (org.jetbrains.annotations.NotNull)1