ExecutionResult executionResult = state.execute(env.getExecutor(), GoBuildingRunner.this); if (executionResult == null) { throw new ExecutionException("Cannot run debugger"); return XDebuggerManager.getInstance(env.getProject()).startSession(env, new XDebugProcessStarter() { @NotNull @Override
@Nullable private String getRemoteAddress(@NotNull ExecutionEnvironment env) { RunnerAndConfigurationSettings runnerAndConfigurationSettings = env.getRunnerAndConfigurationSettings(); if (runnerAndConfigurationSettings == null) { return null; } RunConfiguration configurationSettings = runnerAndConfigurationSettings.getConfiguration(); if (configurationSettings instanceof BallerinaRemoteConfiguration) { BallerinaRemoteConfiguration applicationConfiguration = (BallerinaRemoteConfiguration) configurationSettings; String remoteDebugHost = applicationConfiguration.getRemoteDebugHost(); if (remoteDebugHost.isEmpty()) { return null; } String remoteDebugPort = applicationConfiguration.getRemoteDebugPort(); if (remoteDebugPort.isEmpty()) { return null; } return remoteDebugHost + ":" + remoteDebugPort; } return null; }
@Nullable @Override protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment environment) throws ExecutionException { assert state instanceof GoTestRunningState; GoTestRunningState runningState = (GoTestRunningState)state; GoTestRunConfiguration runConfiguration = ObjectUtils.tryCast(environment.getRunProfile(), GoTestRunConfiguration.class); if (runConfiguration == null) { return null; } FileDocumentManager.getInstance().saveAllDocuments(); CoverageEnabledConfiguration coverageEnabledConfiguration = CoverageEnabledConfiguration.getOrCreate(runConfiguration); runningState.setCoverageFilePath(coverageEnabledConfiguration.getCoverageFilePath()); ExecutionResult executionResult = state.execute(environment.getExecutor(), this); if (executionResult == null) { return null; } CoverageHelper.attachToProcess(runConfiguration, executionResult.getProcessHandler(), environment.getRunnerSettings()); return new RunContentBuilder(executionResult, environment).showRunContent(environment.getContentToReuse()); } }
@Nullable @Override public RunContentDescriptor execute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException { if (state instanceof GoApplicationRunningState) { FileDocumentManager.getInstance().saveAllDocuments(); ((GoApplicationRunningState)state).setHistoryProcessHandler(myHistoryProcessListener); ((GoApplicationRunningState)state).setOutputFilePath(myOutputFilePath); ((GoApplicationRunningState)state).setCompilationFailed(myCompilationFailed); ExecutionResult executionResult = state.execute(env.getExecutor(), GoBuildingRunner.this); return executionResult != null ? new RunContentBuilder(executionResult, env).showRunContent(env.getContentToReuse()) : null; } return null; } }
((BallerinaApplicationRunningState) state).setDebugPort(port); return XDebuggerManager.getInstance(env.getProject()).startSession(env, new XDebugProcessStarter() { ((BallerinaTestRunningState) state).setDebugPort(port); return XDebuggerManager.getInstance(env.getProject()).startSession(env, new XDebugProcessStarter() { } else if (state instanceof BallerinaRemoteRunningState) { FileDocumentManager.getInstance().saveAllDocuments(); return XDebuggerManager.getInstance(env.getProject()).startSession(env, new XDebugProcessStarter() {
public PerlRemoteDebuggingRunProfileState(ExecutionEnvironment environment) { super(environment); PerlRemoteDebuggingConfiguration debuggingConfiguration = (PerlRemoteDebuggingConfiguration)environment.getRunProfile(); Project project = environment.getProject(); String projectPath = project.getBaseDir().getCanonicalPath(); myLocalProjectPath = new File(projectPath == null ? "" : projectPath); myRemoteProjectPath = new File(debuggingConfiguration.getRemoteProjectRoot()); }
@Nullable @Override public ExecutionResult execute(final Executor executor, @NotNull final ProgramRunner programRunner) throws ExecutionException { final Project project = environment.getProject(); if (project == null) { final RunnerAndConfigurationSettings settings = environment.getRunnerAndConfigurationSettings();
public boolean isDebug() { return DefaultDebugExecutor.EXECUTOR_ID.equals(getEnvironment().getExecutor().getId()); }
public PerlDebugOptions getDebugOptions() { return (PerlDebugOptions)getEnvironment().getRunProfile(); } }
@Override protected void execute(@NotNull ExecutionEnvironment environment, Callback callback, @NotNull RunProfileState state) throws ExecutionException { super.execute(environment, descriptor -> { ProcessHandler processHandler = descriptor.getProcessHandler(); if (processHandler != null) { CoverageHelper.attachToProcess((PerlRunConfiguration)environment.getRunProfile(), processHandler, environment.getRunnerSettings()); } if (callback != null) { callback.processStarted(descriptor); } }, new PerlCoverageProfileState(environment)); } }
@Nullable @Override protected MyRunProfile getRunProfile(@NotNull final ExecutionEnvironment environment) { final Project project = environment.getProject(); return project != null? getRunProfile(project) : null; }
@Nullable @Override protected ConsoleView createConsole(@NotNull Executor executor) throws ExecutionException { RunProfile runProfile = getEnvironment().getRunProfile(); PerlHostData hostData = null; if (runProfile instanceof PerlRunConfiguration) { hostData = PerlHostData.from(((PerlRunConfiguration)runProfile).getEffectiveSdk()); } return new PerlRunConsole(getEnvironment().getProject(), hostData); }
/** * Indicates whether the debugging is invoked or not. * * @return {@code true} if debugging is running, {@code false} otherwise. */ private boolean isDebug() { return DefaultDebugExecutor.EXECUTOR_ID.equals(getEnvironment().getExecutor().getId()); } }
@NotNull @Override protected List<String> getPerlParameters(PerlRunConfiguration runProfile) throws ExecutionException { List<String> perlParameters = new ArrayList<>(super.getPerlParameters(runProfile)); String coverageBasePath = CoverageEnabledConfiguration.getOrCreate((PerlRunConfiguration)getEnvironment().getRunProfile()).getCoverageFilePath(); Sdk effectiveSdk = runProfile.getEffectiveSdk(); PerlHostData hostData = PerlHostData.notNullFrom(effectiveSdk); perlParameters.add(0, "-MDevel::Cover=-silent,1,-db," + hostData.getRemotePath(coverageBasePath) + ",-dir,."); return perlParameters; } }
@Override protected RunContentDescriptor doExecute( @NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException { ensureSingleDebugSession(env.getProject()); CloudDebugProcessState cloudState = null; if (state instanceof CloudDebugProcessState) { cloudState = (CloudDebugProcessState) state; } FileDocumentManager.getInstance().saveAllDocuments(); state.execute(env.getExecutor(), this); return createContentDescriptor(cloudState, env); }
protected String getPrgName() { return getEnvironment().getProject().getName() + ".prg"; }
@NotNull @Override protected ProcessHandler startProcess() throws ExecutionException { PerlRunConfiguration runConfiguration = (PerlRunConfiguration)getEnvironment().getRunProfile(); Project project = getEnvironment().getProject();
/** * Indicates whether the debugging is invoked or not. * * @return {@code true} if debugging is running, {@code false} otherwise. */ private boolean isDebug() { return DefaultDebugExecutor.EXECUTOR_ID.equals(getEnvironment().getExecutor().getId()); }
File outputFile; String outputDirectoryPath = state.getConfiguration().getOutputFilePath(); RunnerAndConfigurationSettings settings = environment.getRunnerAndConfigurationSettings(); String configurationName = settings != null ? settings.getName() : "application"; if (StringUtil.isEmpty(outputDirectoryPath)) {
@NotNull @Override protected ProcessHandler startProcess() throws ExecutionException { ProcessHandler process = super.startProcess(); RunProfile runProfile = getEnvironment().getRunProfile(); if (runProfile instanceof PerlRunConfiguration) { myHostData = PerlHostData.notNullFrom(((PerlRunConfiguration)runProfile).getEffectiveSdk()); } else { myHostData = PerlHostHandler.getDefaultHandler().createData(); } return process; }