mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-68415 (Grails Console Functionality)
This commit is contained in:
@@ -19,6 +19,7 @@ import com.intellij.execution.ExecutionException;
|
||||
import com.intellij.execution.configurations.JavaParameters;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.roots.ModuleRootManager;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.PathsList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -75,4 +76,10 @@ public class DefaultGroovyShellRunner extends GroovyShellRunner {
|
||||
String version = GroovyConfigUtils.getInstance().getSDKVersion(homePath);
|
||||
return version == AbstractConfigUtils.UNDEFINED_VERSION ? "" : " (" + (bundled ? "Bundled " : "") + "Groovy " + version + ")";
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String transformUserInput(@NotNull String userInput) {
|
||||
return StringUtil.replace(userInput, "\n", "###\\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ public class GroovyShellAction extends DumbAwareAction {
|
||||
ConsoleExecuteActionHandler handler = new ConsoleExecuteActionHandler(getProcessHandler(), false) {
|
||||
@Override
|
||||
public void processLine(String line) {
|
||||
super.processLine(StringUtil.replace(line, "\n", "###\\n"));
|
||||
super.processLine(shellRunner.transformUserInput(line));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,6 +48,11 @@ public abstract class GroovyShellRunner {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String transformUserInput(@NotNull String userInput) {
|
||||
return userInput;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static GroovyShellRunner getAppropriateRunner(@NotNull Module module) {
|
||||
for (GroovyShellRunner runner : EP_NAME.getExtensions()) {
|
||||
|
||||
Reference in New Issue
Block a user