<commit_before>package org.jetbrains.plugins.scala.script

import com.intellij.execution.configurations.{GeneralCommandLine, CommandLineState}
import com.intellij.execution.filters.{TextConsoleBuilder, TextConsoleBuilderFactory}

import com.intellij.execution.process.{OSProcessHandler, DefaultJavaProcessHandler, ProcessTerminatedListener}
import com.intellij.execution.runners.ExecutionEnvironment
import config.ScalaConfigUtils
import java.io.File

/**
 * User: <NAME>
 * Date: 05.02.2009
 */

class ScalaScriptRunCommandLineState(configuration: ScalaScriptRunConfiguration, env: ExecutionEnvironment)
        extends CommandLineState(env){
  initConsoleBuilder
  def startProcess: OSProcessHandler = {
    val commandLine = createCommandLine
    val processHandler = new DefaultJavaProcessHandler(commandLine);
    ProcessTerminatedListener.attach(processHandler);
    return processHandler;
  }

  private def createCommandLine: GeneralCommandLine = {
    val commandLine = new GeneralCommandLine
    val sdk = configuration.getScalaInstallPath
    var exePath = sdk.replace('\\', File.separatorChar)
    if (!exePath.endsWith(File.separator)) exePath += File.separator
    exePath += "bin" + File.separator + "scala.bat"
    commandLine.setExePath(exePath)
    commandLine.addParameter(configuration.getScriptPath)
    return commandLine
  }


  def initConsoleBuilder: Unit = {
    val consoleBuilder = TextConsoleBuilderFactory.getInstance.createBuilder(configuration.getProject());
    setConsoleBuilder(consoleBuilder);
  }

}<commit_msg>Script program paameters<commit_after>package org.jetbrains.plugins.scala.script

import com.intellij.execution.configurations.{GeneralCommandLine, CommandLineState}
import com.intellij.execution.filters.{TextConsoleBuilder, TextConsoleBuilderFactory}

import com.intellij.execution.process.{OSProcessHandler, DefaultJavaProcessHandler, ProcessTerminatedListener}
import com.intellij.execution.runners.ExecutionEnvironment
import config.ScalaConfigUtils
import java.io.File

/**
 * User: <NAME>
 * Date: 05.02.2009
 */

class ScalaScriptRunCommandLineState(configuration: ScalaScriptRunConfiguration, env: ExecutionEnvironment)
        extends CommandLineState(env){
  initConsoleBuilder
  def startProcess: OSProcessHandler = {
    val commandLine = createCommandLine
    val processHandler = new DefaultJavaProcessHandler(commandLine);
    ProcessTerminatedListener.attach(processHandler);
    return processHandler;
  }

  private def createCommandLine: GeneralCommandLine = {
    val commandLine = new GeneralCommandLine
    val sdk = configuration.getScalaInstallPath
    var exePath = sdk.replace('\\', File.separatorChar)
    if (!exePath.endsWith(File.separator)) exePath += File.separator
    exePath += "bin" + File.separator + "scala.bat"
    commandLine.setExePath(exePath)
    //todo: add classpath
    commandLine.addParameter(configuration.getScriptPath)
    val scriptArgs = configuration.getScriptArgs
    val params = scriptArgs.split("[ ]")
    for (param <- params) commandLine.addParameter(param)

    //todo: add env
    return commandLine
  }


  def initConsoleBuilder: Unit = {
    val consoleBuilder = TextConsoleBuilderFactory.getInstance.createBuilder(configuration.getProject());
    setConsoleBuilder(consoleBuilder);
  }

}
{'fraction_non_alphanumeric': 0.08461084905660378, 'fraction_numerical': 0.0047169811320754715, 'mean_word_length': 4.5805921052631575, 'pattern_counts': {'":': 0, '<': 6, '<?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': '5529991', 'n_tokens_mistral': 977, 'n_tokens_neox': 897, 'n_words': 172}