From a0797c70852f72ba3bdea2a81640042b072b6341 Mon Sep 17 00:00:00 2001 From: PyvesB Date: Sat, 14 Nov 2020 13:41:19 +0000 Subject: [PATCH] Launch Solargraph in a login shell (#12) --- .../server/SolargraphStreamConnectionProvider.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eclipse-solargraph-plugin/src/main/java/io/github/pyvesb/eclipse_solargraph/server/SolargraphStreamConnectionProvider.java b/eclipse-solargraph-plugin/src/main/java/io/github/pyvesb/eclipse_solargraph/server/SolargraphStreamConnectionProvider.java index 3b111af..2e5e14d 100644 --- a/eclipse-solargraph-plugin/src/main/java/io/github/pyvesb/eclipse_solargraph/server/SolargraphStreamConnectionProvider.java +++ b/eclipse-solargraph-plugin/src/main/java/io/github/pyvesb/eclipse_solargraph/server/SolargraphStreamConnectionProvider.java @@ -18,6 +18,7 @@ import java.io.File; import java.io.IOException; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; @@ -27,6 +28,7 @@ import org.eclipse.ui.dialogs.PreferencesUtil; import io.github.pyvesb.eclipse_solargraph.preferences.PreferencePage; +import io.github.pyvesb.eclipse_solargraph.utils.CommandHelper; import io.github.pyvesb.eclipse_solargraph.utils.GemHelper; public class SolargraphStreamConnectionProvider extends ProcessStreamConnectionProvider { @@ -54,7 +56,10 @@ public void start() throws IOException { } private static List getSolargraphCommand() { - return new File(GEM_PATH.getValue()).exists() ? Arrays.asList(GEM_PATH.getValue(), "stdio") : Arrays.asList(); + if (new File(GEM_PATH.getValue()).exists()) { + return Arrays.asList(CommandHelper.getPlatformCommand("\"" + GEM_PATH.getValue() + "\" stdio")); + } + return Collections.emptyList(); } private void displayNotFoundWarning() {