From 810e443891cec33df6d966eb70e5da1aed854f36 Mon Sep 17 00:00:00 2001 From: Alexandr Evstigneev Date: Fri, 13 Jul 2018 17:15:34 +0300 Subject: [PATCH] RUBY-22047 Implemented RunAnything patching with version managers IDEA-CR-34952 --- .../actions/runAnything/RunAnythingCache.java | 28 ------------------- .../activity/RunAnythingCommandProvider.java | 5 ++-- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/actions/runAnything/RunAnythingCache.java b/platform/lang-impl/src/com/intellij/ide/actions/runAnything/RunAnythingCache.java index 019a69013e75..d4f23a1a902f 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/runAnything/RunAnythingCache.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/runAnything/RunAnythingCache.java @@ -4,10 +4,7 @@ package com.intellij.ide.actions.runAnything; import com.intellij.execution.ExecutionException; import com.intellij.execution.configurations.GeneralCommandLine; import com.intellij.ide.actions.runAnything.activity.RunAnythingProvider; -import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.components.*; -import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.project.Project; import com.intellij.util.containers.ContainerUtil; import com.intellij.util.xmlb.XmlSerializerUtil; @@ -22,32 +19,7 @@ import java.util.stream.Collectors; @State(name = "RunAnythingCache", storages = @Storage(StoragePathMacros.WORKSPACE_FILE)) public class RunAnythingCache implements PersistentStateComponent { - private static final Logger LOG = Logger.getInstance(RunAnythingCache.class); private final State mySettings = new State(); - public boolean CAN_RUN_RVM = false; - public boolean CAN_RUN_RBENV = false; - - public RunAnythingCache() { - try { - CAN_RUN_RVM = ApplicationManager.getApplication().executeOnPooledThread(() -> canRunRVM()).get(); - } - catch (java.util.concurrent.ExecutionException ignored) { - } - catch (InterruptedException e) { - LOG.error(e); - throw new ProcessCanceledException(e); - } - - try { - CAN_RUN_RBENV = ApplicationManager.getApplication().executeOnPooledThread(() -> canRunRbenv()).get(); - } - catch (java.util.concurrent.ExecutionException ignored) { - } - catch (InterruptedException e) { - LOG.error(e); - throw new ProcessCanceledException(e); - } - } public static RunAnythingCache getInstance(Project project) { return ServiceManager.getService(project, RunAnythingCache.class); diff --git a/platform/lang-impl/src/com/intellij/ide/actions/runAnything/activity/RunAnythingCommandProvider.java b/platform/lang-impl/src/com/intellij/ide/actions/runAnything/activity/RunAnythingCommandProvider.java index a19649cc3bff..7d40b36247bb 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/runAnything/activity/RunAnythingCommandProvider.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/runAnything/activity/RunAnythingCommandProvider.java @@ -19,6 +19,7 @@ import com.intellij.openapi.keymap.KeymapUtil; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.util.execution.ParametersListUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -54,8 +55,8 @@ public abstract class RunAnythingCommandProvider extends RunAnythingProviderBase dataContext = RunAnythingCommandCustomizer.customizeContext(dataContext); - GeneralCommandLine initialCommandLine = - new GeneralCommandLine(commandString).withParentEnvironmentType(GeneralCommandLine.ParentEnvironmentType.CONSOLE); + GeneralCommandLine initialCommandLine = new GeneralCommandLine(ParametersListUtil.parse(commandString, false, true)) + .withParentEnvironmentType(GeneralCommandLine.ParentEnvironmentType.CONSOLE); GeneralCommandLine commandLine = RunAnythingCommandCustomizer.customizeCommandLine(dataContext, workDirectory, initialCommandLine); try { ExecutionEnvironmentBuilder.create(project, executor, new RunAnythingRunProfile(commandLine, commandString))