<commit_before>package com.jetbrains.ther.console;

import com.intellij.execution.ExecutionException;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.execution.console.LanguageConsoleViewImpl;
import com.intellij.execution.console.ProcessBackedConsoleExecuteActionHandler;
import com.intellij.execution.process.ColoredProcessHandler;
import com.intellij.execution.process.OSProcessHandler;
import com.intellij.execution.runners.AbstractConsoleRunnerWithHistory;
import com.intellij.openapi.project.Project;
import com.jetbrains.ther.TheRLanguage;
import com.jetbrains.ther.interpreter.TheRInterpreterService;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class TheRConsoleRunner extends AbstractConsoleRunnerWithHistory<LanguageConsoleViewImpl> {

  public TheRConsoleRunner(@NotNull final Project project, @Nullable final String workingDir) {
    super(project, "The R Console", workingDir);
  }

  @Override
  protected LanguageConsoleViewImpl createConsoleView() {
    return new LanguageConsoleViewImpl(getProject(), getConsoleTitle(), TheRLanguage.getInstance());
  }

  private String getInterpreterPath() throws ExecutionException {
    final String interpreterPath = TheRInterpreterService.getInstance().getInterpreterPath();
    if (interpreterPath == null) {
      throw new ExecutionException("Cannot find R interpreter for this run configuration");
    }
    return interpreterPath;
  }

  @Nullable
  @Override
  protected Process createProcess() throws ExecutionException {
    final GeneralCommandLine commandLine = new GeneralCommandLine();
    commandLine.setPassParentEnvironment(true);<commit_msg>fixed language console according to new API<commit_after>package com.jetbrains.ther.console;

import com.intellij.execution.ExecutionException;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.execution.console.LanguageConsoleView;
import com.intellij.execution.console.LanguageConsoleViewImpl;
import com.intellij.execution.console.ProcessBackedConsoleExecuteActionHandler;
import com.intellij.execution.process.ColoredProcessHandler;
import com.intellij.execution.process.OSProcessHandler;
import com.intellij.execution.runners.AbstractConsoleRunnerWithHistory;
import com.intellij.openapi.project.Project;
import com.jetbrains.ther.TheRLanguage;
import com.jetbrains.ther.interpreter.TheRInterpreterService;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class TheRConsoleRunner extends AbstractConsoleRunnerWithHistory<LanguageConsoleView> {

  public TheRConsoleRunner(@NotNull final Project project, @Nullable final String workingDir) {
    super(project, "The R Console", workingDir);
  }

  @Override
  protected LanguageConsoleView createConsoleView() {
    return new LanguageConsoleViewImpl(getProject(), getConsoleTitle(), TheRLanguage.getInstance());
  }

  private String getInterpreterPath() throws ExecutionException {
    final String interpreterPath = TheRInterpreterService.getInstance().getInterpreterPath();
    if (interpreterPath == null) {
      throw new ExecutionException("Cannot find R interpreter for this run configuration");
    }
    return interpreterPath;
  }

  @Nullable
  @Override
  protected Process createProcess() throws ExecutionException {
    final GeneralCommandLine commandLine = new GeneralCommandLine();
    commandLine.setPassParentEnvironment(true);
{'fraction_non_alphanumeric': 0.07842573972996265, 'fraction_numerical': 0.0, 'mean_word_length': 6.755011135857461, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1082208', 'n_tokens_mistral': 912, 'n_tokens_neox': 884, 'n_words': 189}