Search in sources :

Example 1 with MixExUnitRunConfiguration

use of org.elixir_lang.mix.runner.exunit.MixExUnitRunConfiguration in project intellij-elixir by KronicDeth.

the class ElixirXDebugProcess method runDebugTarget.

@NotNull
private OSProcessHandler runDebugTarget() throws ExecutionException {
    OSProcessHandler elixirProcessHandler;
    LOG.debug("Preparing to run debug target.");
    ArrayList<String> elixirParams = new ArrayList<>();
    elixirParams.addAll(myRunningState.setupElixirParams());
    elixirParams.addAll(setUpElixirDebuggerCodePath());
    List<String> mixParams = new ArrayList<>();
    mixParams.addAll(Arrays.asList("intellij_elixir.debug_task", "--debugger-port", "" + myDebuggerNode.getLocalDebuggerPort(), "--"));
    List<String> mixCommandArgs = getRunConfiguration().getMixArgs();
    mixParams.addAll(mixCommandArgs);
    if (getRunConfiguration() instanceof MixExUnitRunConfiguration && !mixCommandArgs.contains("--trace")) {
        // Prevents tests from timing out while debugging
        mixParams.add("--trace");
    }
    GeneralCommandLine commandLine = MixRunningStateUtil.commandLine(getRunConfiguration(), elixirParams, mixParams);
    LOG.debug("Running debugger process. Command line (platform-independent): ");
    LOG.debug(commandLine.getCommandLineString());
    Process process = commandLine.createProcess();
    elixirProcessHandler = new OSProcessHandler(process, commandLine.getCommandLineString());
    LOG.debug("Debugger process started.");
    return elixirProcessHandler;
}
Also used : OSProcessHandler(com.intellij.execution.process.OSProcessHandler) MixExUnitRunConfiguration(org.elixir_lang.mix.runner.exunit.MixExUnitRunConfiguration) GeneralCommandLine(com.intellij.execution.configurations.GeneralCommandLine) ArrayList(java.util.ArrayList) XDebugProcess(com.intellij.xdebugger.XDebugProcess) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

GeneralCommandLine (com.intellij.execution.configurations.GeneralCommandLine)1 OSProcessHandler (com.intellij.execution.process.OSProcessHandler)1 XDebugProcess (com.intellij.xdebugger.XDebugProcess)1 ArrayList (java.util.ArrayList)1 MixExUnitRunConfiguration (org.elixir_lang.mix.runner.exunit.MixExUnitRunConfiguration)1 NotNull (org.jetbrains.annotations.NotNull)1