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();
}
Aggregations