use of com.google.idea.blaze.skylark.debugger.impl.SkylarkDebugProcess in project intellij by bazelbuild.
the class SkylarkDebugRunner method doExecute.
@Nullable
@Override
protected RunContentDescriptor doExecute(RunProfileState state, ExecutionEnvironment env) throws ExecutionException {
if (!DefaultDebugExecutor.EXECUTOR_ID.equals(env.getExecutor().getId())) {
logger.error("Unexpected executor id: " + env.getExecutor().getId());
return null;
}
BlazeCommandRunConfiguration config = BlazeCommandRunConfigurationRunner.getBlazeConfig(env.getRunProfile());
if (config == null || !(state instanceof BlazeCommandRunProfileState)) {
throw new ExecutionException("Debugging is not supported for this blaze run configuration");
}
ExecutionResult result = state.execute(env.getExecutor(), this);
FileDocumentManager.getInstance().saveAllDocuments();
XDebuggerManager manager = XDebuggerManager.getInstance(env.getProject());
XDebugSession session = manager.startSession(env, new XDebugProcessStarter() {
@Override
public XDebugProcess start(XDebugSession session) {
EventLoggingService.getInstance().logEvent(getClass(), "skylark-debugging");
return new SkylarkDebugProcess(session, result, SkylarkDebugBuildFlagsProvider.SERVER_PORT);
}
});
return session.getRunContentDescriptor();
}
Aggregations