-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CHE-3120: Add Sourcegraph Python Language Server to Che (#3693)
Signed-off-by: Vitalii Parfonov <vparfonov@codenvy.com>
- Loading branch information
Vitalii Parfonov
authored
Jan 12, 2017
1 parent
976f729
commit 64625bc
Showing
7 changed files
with
309 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...c/main/java/org/eclipse/che/plugin/python/languageserver/PythonLanguageSeverLauncher.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2012-2017 Codenvy, S.A. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Codenvy, S.A. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.che.plugin.python.languageserver; | ||
|
||
import io.typefox.lsapi.services.LanguageServer; | ||
import io.typefox.lsapi.services.json.JsonBasedLanguageServer; | ||
import org.eclipse.che.api.languageserver.exception.LanguageServerException; | ||
import org.eclipse.che.api.languageserver.launcher.LanguageServerLauncherTemplate; | ||
import org.eclipse.che.api.languageserver.shared.model.LanguageDescription; | ||
import org.eclipse.che.api.languageserver.shared.model.impl.LanguageDescriptionImpl; | ||
import org.eclipse.che.plugin.python.shared.ProjectAttributes; | ||
|
||
import javax.inject.Singleton; | ||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.Arrays; | ||
|
||
import static java.util.Arrays.asList; | ||
|
||
/** | ||
* Launches language server for Python | ||
*/ | ||
@Singleton | ||
public class PythonLanguageSeverLauncher extends LanguageServerLauncherTemplate { | ||
|
||
private static final String[] EXTENSIONS = new String[] {ProjectAttributes.PYTHON_EXT}; | ||
private static final String[] MIME_TYPES = new String[] {"text/x-python"}; | ||
private static final LanguageDescriptionImpl description; | ||
|
||
private final Path launchScript; | ||
|
||
static { | ||
description = new LanguageDescriptionImpl(); | ||
description.setFileExtensions(asList(EXTENSIONS)); | ||
description.setLanguageId(ProjectAttributes.PYTHON_ID); | ||
description.setMimeTypes(Arrays.asList(MIME_TYPES)); | ||
} | ||
|
||
public PythonLanguageSeverLauncher() { | ||
launchScript = Paths.get(System.getenv("HOME"), "che/ls-python/launch.sh"); | ||
} | ||
|
||
@Override | ||
public LanguageDescription getLanguageDescription() { | ||
return description; | ||
} | ||
|
||
@Override | ||
public boolean isAbleToLaunch() { | ||
return launchScript.toFile().exists(); | ||
} | ||
|
||
@Override | ||
protected Process startLanguageServerProcess(String projectPath) throws LanguageServerException { | ||
ProcessBuilder processBuilder = new ProcessBuilder(launchScript.toString()); | ||
processBuilder.redirectInput(ProcessBuilder.Redirect.PIPE); | ||
processBuilder.redirectOutput(ProcessBuilder.Redirect.PIPE); | ||
|
||
try { | ||
return processBuilder.start(); | ||
} catch (IOException e) { | ||
throw new LanguageServerException("Can't start CSharp language server", e); | ||
} | ||
} | ||
|
||
@Override | ||
protected LanguageServer connectToLanguageServer(Process languageServerProcess) throws LanguageServerException { | ||
JsonBasedLanguageServer languageServer = new JsonBasedLanguageServer(); | ||
languageServer.connect(languageServerProcess.getInputStream(), languageServerProcess.getOutputStream()); | ||
return languageServer; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.python.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"id": "org.eclipse.che.ls.python", | ||
"name": "Python language server", | ||
"description": "Python intellisense", | ||
"dependencies": [], | ||
"properties": {}, | ||
"script" : "#\n# Copyright (c) 2012-2017 Codenvy, S.A.\n# All rights reserved. This program and the accompanying materials\n# are made available under the terms of the Eclipse Public License v1.0\n# which accompanies this distribution, and is available at\n# http://www.eclipse.org/legal/epl-v10.html\n#\n# Contributors:\n# Codenvy, S.A. - initial API and implementation\n#\n\nunset PACKAGES\nunset SUDO\ncommand -v tar >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" tar\"; }\ncommand -v curl >/dev/null 2>&1 || { PACKAGES=${PACKAGES}\" curl\"; }\ntest \"$(id -u)\" = 0 || SUDO=\"sudo\"\n\nAGENT_BINARIES_URI=https://codenvy.com/update/repository/public/download/org.eclipse.che.ls.python.binaries\nCHE_DIR=$HOME/che\nLS_DIR=${CHE_DIR}/ls-python\nLS_LAUNCHER=${LS_DIR}/launch.sh\n\nif [ -f /etc/centos-release ]; then\n FILE=\"/etc/centos-release\"\n LINUX_TYPE=$(cat $FILE | awk '{print $1}')\n elif [ -f /etc/redhat-release ]; then\n FILE=\"/etc/redhat-release\"\n LINUX_TYPE=$(cat $FILE | cut -c 1-8)\n else\n FILE=\"/etc/os-release\"\n LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]')\n LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=)\nfi\n\nMACHINE_TYPE=$(uname -m)\n\nmkdir -p ${CHE_DIR}\nmkdir -p ${LS_DIR}\n\n########################\n### Install packages ###\n########################\n\n# Red Hat Enterprise Linux 7\n############################\nif echo ${LINUX_TYPE} | grep -qi \"rhel\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n command -v python3.5 >/dev/null 2>&1 || {\n ${SUDO} yum-config-manager --enable rhel-server-rhscl-7-rpms;\n ${SUDO} yum -y install rh-python35 bzip2;\n export LD_LIBRARY_PATH=\"/opt/rh/rh-python35/root/usr/lib64\"\n export PATH=\"/opt/rh/rh-python35/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\n echo \"export LD_LIBRARY_PATH=/opt/rh/rh-python35/root/usr/lib64\" >> $HOME/.bashrc\n echo \"export PATH=/opt/rh/rh-python35/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\" >> $HOME/.bashrc\n }\n\n# Red Hat Enterprise Linux 6\n############################\nelif echo ${LINUX_TYPE} | grep -qi \"Red Hat\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum install ${PACKAGES};\n }\n\n command -v python3.5 >/dev/null 2>&1 || {\n ${SUDO} yum-config-manager --enable rhel-server-rhscl-7-rpms;\n ${SUDO} yum -y install rh-python35 bzip2;\n export LD_LIBRARY_PATH=\"/opt/rh/rh-python35/root/usr/lib64\"\n export PATH=\"/opt/rh/rh-python35/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\n echo \"export LD_LIBRARY_PATH=/opt/rh/rh-python35/root/usr/lib64\" >> $HOME/.bashrc\n echo \"export PATH=/opt/rh/rh-python35/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\" >> $HOME/.bashrc\n }\n\n\n# Ubuntu 14.04 16.04 / Linux Mint 17\n####################################\nelif echo ${LINUX_TYPE} | grep -qi \"ubuntu\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n command -v python3.5 >/dev/null 2>&1 || {\n if echo ${LINUX_VERSION} | grep -qi \"14.04\"; then\n DEADSNAKES=\"/etc/apt/sources.list.d/deadsnakes.list\";\n ${SUDO} touch ${DEADSNAKES};\n echo \"deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu trusty main\" | ${SUDO} tee --append ${DEADSNAKES};\n echo \"deb-src http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu trusty main\" | ${SUDO} tee --append ${DEADSNAKES};\n ${SUDO} gpg --keyserver keyserver.ubuntu.com --recv-keys DB82666C;\n ${SUDO} gpg --export DB82666C | ${SUDO} apt-key add -;\n\n ${SUDO} apt-get update;\n ${SUDO} apt-get install -y python3.5 bzip2;\n ${SUDO} curl https://bootstrap.pypa.io/ez_setup.py -o - | ${SUDO} python3.5\n ${SUDO} easy_install pip\n else\n ${SUDO} apt-get update;\n ${SUDO} apt-get install -y python3.5;\n ${SUDO} apt-get install -y python3-pip;\n fi\n }\n\n\n# Debian 8\n##########\nelif echo ${LINUX_TYPE} | grep -qi \"debian\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} apt-get update;\n ${SUDO} apt-get -y install ${PACKAGES};\n }\n\n command -v python3.5 >/dev/null 2>&1 || {\n DEADSNAKES=\"/etc/apt/sources.list.d/deadsnakes.list\";\n ${SUDO} touch ${DEADSNAKES};\n echo \"deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu trusty main\" | ${SUDO} tee --append ${DEADSNAKES};\n echo \"deb-src http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu trusty main\" | ${SUDO} tee --append ${DEADSNAKES};\n ${SUDO} gpg --keyserver keyserver.ubuntu.com --recv-keys DB82666C;\n ${SUDO} gpg --export DB82666C | ${SUDO} apt-key add -;\n\n ${SUDO} apt-get update;\n ${SUDO} apt-get install -y python3.5 bzip2;\n ${SUDO} curl https://bootstrap.pypa.io/ez_setup.py -o - | ${SUDO} python3.5\n ${SUDO} easy_install pip\n }\n\n# Fedora 23\n###########\nelif echo ${LINUX_TYPE} | grep -qi \"fedora\"; then\n PACKAGES=${PACKAGES}\" procps-ng\"\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} dnf -y install ${PACKAGES};\n }\n\n command -v python3.5 >/dev/null 2>&1 || {\n ${SUDO} dnf -y install python35 bzip2;\n ${SUDO} curl https://bootstrap.pypa.io/ez_setup.py -o - | ${SUDO} python3.5\n ${SUDO} easy_install pip\n }\n\n\n# CentOS 7.1 & Oracle Linux 7.1\n###############################\nelif echo ${LINUX_TYPE} | grep -qi \"centos\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} yum -y install ${PACKAGES};\n }\n\n command -v python3.5 >/dev/null 2>&1 || {\n\n ${SUDO} yum -y install centos-release-scl;\n ${SUDO} yum -y install rh-python35 bzip2;\n export LD_LIBRARY_PATH=\"/opt/rh/rh-python35/root/usr/lib64\"\n export PATH=\"/opt/rh/rh-python35/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"\n echo \"export LD_LIBRARY_PATH=/opt/rh/rh-python35/root/usr/lib64\" >> $HOME/.bashrc\n echo \"export PATH=/opt/rh/rh-python35/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\" >> $HOME/.bashrc\n }\n\n# openSUSE 13.2\n###############\nelif echo ${LINUX_TYPE} | grep -qi \"opensuse\"; then\n test \"${PACKAGES}\" = \"\" || {\n ${SUDO} zypper install -y ${PACKAGES};\n }\n\n command -v python3.5 >/dev/null 2>&1 || {\n ${SUDO} zypper ar -f http://download.opensuse.org/repositories/home:/Ledest:/bashisms/openSUSE_13.2/ home:Ledest:bashisms\n ${SUDO} zypper --no-gpg-checks ref\n ${SUDO} zypper install -y python3\n ${SUDO} zypper install -y python3-pip\n }\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat $FILE\n exit 1\nfi\n\n\n#########################\n### Install Python LS ###\n#########################\n\ncurl -s ${AGENT_BINARIES_URI} | tar xzf - -C ${LS_DIR}\n\ncd ${LS_DIR} && ${SUDO} pip3 install -r ${LS_DIR}/requirements.txt\n\ntouch ${LS_LAUNCHER}\nchmod +x ${LS_LAUNCHER}\necho \"python3.5 ${LS_DIR}/python-langserver.py --fs=local --mode=stdio\" > ${LS_LAUNCHER}" | ||
} |
191 changes: 191 additions & 0 deletions
191
.../che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.python.script.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
# | ||
# Copyright (c) 2012-2017 Codenvy, S.A. | ||
# All rights reserved. This program and the accompanying materials | ||
# are made available under the terms of the Eclipse Public License v1.0 | ||
# which accompanies this distribution, and is available at | ||
# http://www.eclipse.org/legal/epl-v10.html | ||
# | ||
# Contributors: | ||
# Codenvy, S.A. - initial API and implementation | ||
# | ||
|
||
unset PACKAGES | ||
unset SUDO | ||
command -v tar >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" tar"; } | ||
command -v curl >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" curl"; } | ||
test "$(id -u)" = 0 || SUDO="sudo" | ||
|
||
AGENT_BINARIES_URI=https://codenvy.com/update/repository/public/download/org.eclipse.che.ls.python.binaries | ||
CHE_DIR=$HOME/che | ||
LS_DIR=${CHE_DIR}/ls-python | ||
LS_LAUNCHER=${LS_DIR}/launch.sh | ||
|
||
if [ -f /etc/centos-release ]; then | ||
FILE="/etc/centos-release" | ||
LINUX_TYPE=$(cat $FILE | awk '{print $1}') | ||
elif [ -f /etc/redhat-release ]; then | ||
FILE="/etc/redhat-release" | ||
LINUX_TYPE=$(cat $FILE | cut -c 1-8) | ||
else | ||
FILE="/etc/os-release" | ||
LINUX_TYPE=$(cat $FILE | grep ^ID= | tr '[:upper:]' '[:lower:]') | ||
LINUX_VERSION=$(cat $FILE | grep ^VERSION_ID=) | ||
fi | ||
|
||
MACHINE_TYPE=$(uname -m) | ||
|
||
mkdir -p ${CHE_DIR} | ||
mkdir -p ${LS_DIR} | ||
|
||
######################## | ||
### Install packages ### | ||
######################## | ||
|
||
# Red Hat Enterprise Linux 7 | ||
############################ | ||
if echo ${LINUX_TYPE} | grep -qi "rhel"; then | ||
test "${PACKAGES}" = "" || { | ||
${SUDO} yum install ${PACKAGES}; | ||
} | ||
|
||
command -v python3.5 >/dev/null 2>&1 || { | ||
${SUDO} yum-config-manager --enable rhel-server-rhscl-7-rpms; | ||
${SUDO} yum -y install rh-python35 bzip2; | ||
export LD_LIBRARY_PATH="/opt/rh/rh-python35/root/usr/lib64" | ||
export PATH="/opt/rh/rh-python35/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
echo "export LD_LIBRARY_PATH=/opt/rh/rh-python35/root/usr/lib64" >> $HOME/.bashrc | ||
echo "export PATH=/opt/rh/rh-python35/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> $HOME/.bashrc | ||
} | ||
|
||
# Red Hat Enterprise Linux 6 | ||
############################ | ||
elif echo ${LINUX_TYPE} | grep -qi "Red Hat"; then | ||
test "${PACKAGES}" = "" || { | ||
${SUDO} yum install ${PACKAGES}; | ||
} | ||
|
||
command -v python3.5 >/dev/null 2>&1 || { | ||
${SUDO} yum-config-manager --enable rhel-server-rhscl-7-rpms; | ||
${SUDO} yum -y install rh-python35 bzip2; | ||
export LD_LIBRARY_PATH="/opt/rh/rh-python35/root/usr/lib64" | ||
export PATH="/opt/rh/rh-python35/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
echo "export LD_LIBRARY_PATH=/opt/rh/rh-python35/root/usr/lib64" >> $HOME/.bashrc | ||
echo "export PATH=/opt/rh/rh-python35/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> $HOME/.bashrc | ||
} | ||
|
||
|
||
# Ubuntu 14.04 16.04 / Linux Mint 17 | ||
#################################### | ||
elif echo ${LINUX_TYPE} | grep -qi "ubuntu"; then | ||
test "${PACKAGES}" = "" || { | ||
${SUDO} apt-get update; | ||
${SUDO} apt-get -y install ${PACKAGES}; | ||
} | ||
|
||
command -v python3.5 >/dev/null 2>&1 || { | ||
if echo ${LINUX_VERSION} | grep -qi "14.04"; then | ||
DEADSNAKES="/etc/apt/sources.list.d/deadsnakes.list"; | ||
${SUDO} touch ${DEADSNAKES}; | ||
echo "deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu trusty main" | ${SUDO} tee --append ${DEADSNAKES}; | ||
echo "deb-src http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu trusty main" | ${SUDO} tee --append ${DEADSNAKES}; | ||
${SUDO} gpg --keyserver keyserver.ubuntu.com --recv-keys DB82666C; | ||
${SUDO} gpg --export DB82666C | ${SUDO} apt-key add -; | ||
|
||
${SUDO} apt-get update; | ||
${SUDO} apt-get install -y python3.5 bzip2; | ||
${SUDO} curl https://bootstrap.pypa.io/ez_setup.py -o - | ${SUDO} python3.5 | ||
${SUDO} easy_install pip | ||
else | ||
${SUDO} apt-get update; | ||
${SUDO} apt-get install -y python3.5; | ||
${SUDO} apt-get install -y python3-pip; | ||
fi | ||
} | ||
|
||
|
||
# Debian 8 | ||
########## | ||
elif echo ${LINUX_TYPE} | grep -qi "debian"; then | ||
test "${PACKAGES}" = "" || { | ||
${SUDO} apt-get update; | ||
${SUDO} apt-get -y install ${PACKAGES}; | ||
} | ||
|
||
command -v python3.5 >/dev/null 2>&1 || { | ||
DEADSNAKES="/etc/apt/sources.list.d/deadsnakes.list"; | ||
${SUDO} touch ${DEADSNAKES}; | ||
echo "deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu trusty main" | ${SUDO} tee --append ${DEADSNAKES}; | ||
echo "deb-src http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu trusty main" | ${SUDO} tee --append ${DEADSNAKES}; | ||
${SUDO} gpg --keyserver keyserver.ubuntu.com --recv-keys DB82666C; | ||
${SUDO} gpg --export DB82666C | ${SUDO} apt-key add -; | ||
|
||
${SUDO} apt-get update; | ||
${SUDO} apt-get install -y python3.5 bzip2; | ||
${SUDO} curl https://bootstrap.pypa.io/ez_setup.py -o - | ${SUDO} python3.5 | ||
${SUDO} easy_install pip | ||
} | ||
|
||
# Fedora 23 | ||
########### | ||
elif echo ${LINUX_TYPE} | grep -qi "fedora"; then | ||
PACKAGES=${PACKAGES}" procps-ng" | ||
test "${PACKAGES}" = "" || { | ||
${SUDO} dnf -y install ${PACKAGES}; | ||
} | ||
|
||
command -v python3.5 >/dev/null 2>&1 || { | ||
${SUDO} dnf -y install python35 bzip2; | ||
${SUDO} curl https://bootstrap.pypa.io/ez_setup.py -o - | ${SUDO} python3.5 | ||
${SUDO} easy_install pip | ||
} | ||
|
||
|
||
# CentOS 7.1 & Oracle Linux 7.1 | ||
############################### | ||
elif echo ${LINUX_TYPE} | grep -qi "centos"; then | ||
test "${PACKAGES}" = "" || { | ||
${SUDO} yum -y install ${PACKAGES}; | ||
} | ||
|
||
command -v python3.5 >/dev/null 2>&1 || { | ||
|
||
${SUDO} yum -y install centos-release-scl; | ||
${SUDO} yum -y install rh-python35 bzip2; | ||
export LD_LIBRARY_PATH="/opt/rh/rh-python35/root/usr/lib64" | ||
export PATH="/opt/rh/rh-python35/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | ||
echo "export LD_LIBRARY_PATH=/opt/rh/rh-python35/root/usr/lib64" >> $HOME/.bashrc | ||
echo "export PATH=/opt/rh/rh-python35/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> $HOME/.bashrc | ||
} | ||
|
||
# openSUSE 13.2 | ||
############### | ||
elif echo ${LINUX_TYPE} | grep -qi "opensuse"; then | ||
test "${PACKAGES}" = "" || { | ||
${SUDO} zypper install -y ${PACKAGES}; | ||
} | ||
|
||
command -v python3.5 >/dev/null 2>&1 || { | ||
${SUDO} zypper ar -f http://download.opensuse.org/repositories/home:/Ledest:/bashisms/openSUSE_13.2/ home:Ledest:bashisms | ||
${SUDO} zypper --no-gpg-checks ref | ||
${SUDO} zypper install -y python3 | ||
${SUDO} zypper install -y python3-pip | ||
} | ||
|
||
else | ||
>&2 echo "Unrecognized Linux Type" | ||
>&2 cat $FILE | ||
exit 1 | ||
fi | ||
|
||
|
||
######################### | ||
### Install Python LS ### | ||
######################### | ||
|
||
curl -s ${AGENT_BINARIES_URI} | tar xzf - -C ${LS_DIR} | ||
|
||
cd ${LS_DIR} && ${SUDO} pip3 install -r ${LS_DIR}/requirements.txt | ||
|
||
touch ${LS_LAUNCHER} | ||
chmod +x ${LS_LAUNCHER} | ||
echo "python3.5 ${LS_DIR}/python-langserver.py --fs=local --mode=stdio" > ${LS_LAUNCHER} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters