From c91e10592fcfd112491e14de83f9ef7b9ea111b5 Mon Sep 17 00:00:00 2001 From: Eugene Ivantsov Date: Tue, 19 Jun 2018 11:39:59 +0300 Subject: [PATCH] C# installer and .js for TS LS --- .../1.0.1/org.eclipse.che.ls.csharp.script.sh | 54 +++---------------- .../TypeScriptLanguageServerConfig.java | 2 +- 2 files changed, 8 insertions(+), 48 deletions(-) diff --git a/agents/ls-csharp/src/main/resources/installers/1.0.1/org.eclipse.che.ls.csharp.script.sh b/agents/ls-csharp/src/main/resources/installers/1.0.1/org.eclipse.che.ls.csharp.script.sh index 703985a5b5..14e2be7a1e 100644 --- a/agents/ls-csharp/src/main/resources/installers/1.0.1/org.eclipse.che.ls.csharp.script.sh +++ b/agents/ls-csharp/src/main/resources/installers/1.0.1/org.eclipse.che.ls.csharp.script.sh @@ -26,7 +26,8 @@ unset PACKAGES command -v tar >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" tar"; } command -v curl >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" curl"; } -AGENT_BINARIES_URI=https://codenvy.com/update/repository/public/download/org.eclipse.che.ls.csharp.binaries/1.0.1 +LS_CSHARP_VERSION="1.31.1" +AGENT_BINARIES_URI="https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v${LS_CSHARP_VERSION}/omnisharp-linux-x64.tar.gz" CHE_DIR=$HOME/che LS_DIR=${CHE_DIR}/ls-csharp LS_LAUNCHER=${LS_DIR}/launch.sh @@ -83,13 +84,6 @@ elif echo ${LINUX_TYPE} | grep -qi "Red Hat"; then ${SUDO} scl enable rh-dotnetcore20 bash; } - command -v nodejs >/dev/null 2>&1 || { - curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -; - ${SUDO} yum -y install nodejs; - } - - - # Install for Ubuntu 14.04, 16.04, 16.10 & Linux Mint 17, 18 (64 bit) #################################### @@ -123,16 +117,6 @@ elif echo ${LINUX_TYPE} | grep -qi "ubuntu"; then ${SUDO} apt-get -y install dotnet-sdk-2.0.0-preview2-006497 } - command -v nodejs >/dev/null 2>&1 || { - { - curl -sL https://deb.nodesource.com/setup_6.x | ${SUDO} bash -; - }; - - ${SUDO} apt-get update; - ${SUDO} apt-get install -y nodejs; - } - - # Debian 8 ########## elif echo ${LINUX_TYPE} | grep -qi "debian"; then @@ -151,15 +135,6 @@ elif echo ${LINUX_TYPE} | grep -qi "debian"; then ${SUDO} ln -s /opt/dotnet/dotnet /usr/local/bin; } - command -v nodejs >/dev/null 2>&1 || { - { - curl -sL https://deb.nodesource.com/setup_6.x | ${SUDO} bash -; - }; - - ${SUDO} apt-get update; - ${SUDO} apt-get install -y nodejs; - } - # Fedora 24, 25, 26 ########### elif echo ${LINUX_TYPE} | grep -qi "fedora"; then @@ -177,12 +152,6 @@ elif echo ${LINUX_TYPE} | grep -qi "fedora"; then ${SUDO} ln -s /opt/dotnet/dotnet /usr/local/bin; } - command -v nodejs >/dev/null 2>&1 || { - curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -; - ${SUDO} dnf -y install nodejs; - } - - # CentOS 7.1 (64 bit) & Oracle Linux 7.1 (64 bit) ############################### elif echo ${LINUX_TYPE} | grep -qi "centos"; then @@ -199,12 +168,6 @@ elif echo ${LINUX_TYPE} | grep -qi "centos"; then ${SUDO} ln -s /opt/dotnet/dotnet /usr/local/bin; } - command -v nodejs >/dev/null 2>&1 || { - curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -; - ${SUDO} yum -y install nodejs; - } - - # SUSE Linux Enterprise Server (64 bit), openSUSE (64 bit) ############### elif echo ${LINUX_TYPE} | grep -qi "opensuse"; then @@ -221,11 +184,6 @@ elif echo ${LINUX_TYPE} | grep -qi "opensuse"; then ${SUDO} ln -s /opt/dotnet/dotnet /usr/local/bin; } - command -v nodejs >/dev/null 2>&1 || { - ${SUDO} zypper ar http://download.opensuse.org/repositories/devel:/languages:/nodejs/openSUSE_13.1/ Node.js - ${SUDO} zypper in nodejs - } - else >&2 echo "Unrecognized Linux Type" >&2 cat /etc/os-release @@ -238,10 +196,12 @@ fi ##################### -if [ ! -d "${LS_DIR}/node_modules" ]; then - curl -s ${AGENT_BINARIES_URI} | tar xzf - -C ${CHE_DIR} +if [ ! -f "${LS_DIR}/run" ]; then + echo "Downloading C# language server" + curl -L -o ${LS_DIR}/omnisharp-linux-x64.tar.gz ${AGENT_BINARIES_URI} + cd ${LS_DIR} && tar -xzf omnisharp-linux-x64.tar.gz fi touch ${LS_LAUNCHER} chmod +x ${LS_LAUNCHER} -echo "nodejs ${LS_DIR}/node_modules/omnisharp-client/languageserver/server.js" > ${LS_LAUNCHER} +echo "${LS_DIR}/run -lsp" > ${LS_LAUNCHER} diff --git a/plugins/plugin-web/che-plugin-web-ext-server/src/main/java/org/eclipse/che/plugin/web/typescript/TypeScriptLanguageServerConfig.java b/plugins/plugin-web/che-plugin-web-ext-server/src/main/java/org/eclipse/che/plugin/web/typescript/TypeScriptLanguageServerConfig.java index 3e482e25fa..a49ac6fe55 100644 --- a/plugins/plugin-web/che-plugin-web-ext-server/src/main/java/org/eclipse/che/plugin/web/typescript/TypeScriptLanguageServerConfig.java +++ b/plugins/plugin-web/che-plugin-web-ext-server/src/main/java/org/eclipse/che/plugin/web/typescript/TypeScriptLanguageServerConfig.java @@ -28,7 +28,7 @@ import org.eclipse.che.api.languageserver.ProcessCommunicationProvider; @Singleton public class TypeScriptLanguageServerConfig implements LanguageServerConfig { - private static final String REGEX = ".*\\.(ts|tsx)"; + private static final String REGEX = ".*\\.(js|ts|tsx)"; private final Path launchScript;