JstdRunProfileState jstdState = JstdRunProfileState.cast(state);
final ExecutionResult executionResult = jstdState.executeWithServer(myServer);
File configFile = new File(jstdState.getRunSettings().getConfigFile());
final RemoteDebuggingFileFinder fileFinder = new JstdDebuggingFileFinderProvider(configFile, myServer).provideFileFinder();
XDebugSession session = XDebuggerManager.getInstance(environment.getProject()).startSession(environment, new XDebugProcessStarter() {
@Override
@NotNull
public XDebugProcess start(@NotNull XDebugSession session) {
JavaScriptDebugEngine debugEngine = myDebugBrowserInfo.getDebugEngine();
JSDebugProcess<?> process = debugEngine.createDebugProcess(session, browser, fileFinder, url, executionResult, false);
process.setElementsInspectorEnabled(false);
return process;
}
});
// must be here, after all breakpoints were queued
((JSDebugProcess)session.getDebugProcess()).getConnection().executeOnStart(new Runnable() {
@Override
public void run() {
Runnable runnable = new Runnable() {
@Override
public void run() {
resumeJstdClientRunning(executionResult.getProcessHandler());
}
};
if (ApplicationManager.getApplication().isReadAccessAllowed()) {
ApplicationManager.getApplication().executeOnPooledThread(runnable);
}
else {
runnable.run();
}
}
});
return session.getRunContentDescriptor();
}