use of com.intellij.javascript.debugger.JavaScriptDebugProcess in project intellij-plugins by JetBrains.
the class KarmaDebugProgramRunner method createDescriptor.
@NotNull
private static RunContentDescriptor createDescriptor(@NotNull ExecutionEnvironment environment, @NotNull ExecutionResult executionResult, @NotNull KarmaConsoleView consoleView, @NotNull KarmaServer karmaServer, @NotNull DebuggableWebBrowser debuggableWebBrowser) throws ExecutionException {
Url url = Urls.newFromEncoded(karmaServer.formatUrl("/"));
DebuggableFileFinder fileFinder = getDebuggableFileFinder(karmaServer);
XDebugSession session = XDebuggerManager.getInstance(environment.getProject()).startSession(environment, new XDebugProcessStarter() {
@Override
@NotNull
public XDebugProcess start(@NotNull XDebugSession session) {
JavaScriptDebugEngine debugEngine = debuggableWebBrowser.getDebugEngine();
WebBrowser browser = debuggableWebBrowser.getWebBrowser();
JavaScriptDebugProcess<? extends VmConnection> debugProcess = debugEngine.createDebugProcess(session, browser, fileFinder, url, executionResult, true);
debugProcess.addFirstLineBreakpointPattern("\\.browserify$");
debugProcess.setElementsInspectorEnabled(false);
debugProcess.setConsoleMessagesSupportEnabled(false);
debugProcess.setLayouter(consoleView.createDebugLayouter(debugProcess));
Alarm alarm = new Alarm(Alarm.ThreadToUse.POOLED_THREAD, consoleView);
alarm.addRequest(() -> {
resumeTestRunning(executionResult.getProcessHandler());
Disposer.dispose(alarm);
}, 2000);
return debugProcess;
}
});
return session.getRunContentDescriptor();
}
Aggregations