From 70b0c1318ce700b46bddd11632efbd7cd8331dde Mon Sep 17 00:00:00 2001 From: Evgen Vidolob Date: Wed, 23 Nov 2016 15:49:51 +0200 Subject: [PATCH] #3119 fix review comments --- .../org/eclipse/che/plugin/web/inject/WebModule.java | 2 +- .../eclipse/che/plugin/web/typescript/TSLSLauncher.java | 6 +++--- .../che/plugin/web/typescript/TypeScriptProjectType.java | 2 +- .../main/resources/agents/org.eclipse.che.ls.js-ts.json | 9 --------- .../resources/agents/org.eclipse.che.ls.typescript.json | 9 +++++++++ ...script.sh => org.eclipse.che.ls.typescript.script.sh} | 4 ++-- .../src/main/resources/agents/scripts/update_agents.sh | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) delete mode 100644 wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.js-ts.json create mode 100644 wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.typescript.json rename wsmaster/che-core-api-agent/src/main/resources/agents/scripts/{org.eclipse.che.ls.js-ts.script.sh => org.eclipse.che.ls.typescript.script.sh} (98%) diff --git a/plugins/plugin-web/che-plugin-web-ext-server/src/main/java/org/eclipse/che/plugin/web/inject/WebModule.java b/plugins/plugin-web/che-plugin-web-ext-server/src/main/java/org/eclipse/che/plugin/web/inject/WebModule.java index b54380e11e8..f8333908e6f 100644 --- a/plugins/plugin-web/che-plugin-web-ext-server/src/main/java/org/eclipse/che/plugin/web/inject/WebModule.java +++ b/plugins/plugin-web/che-plugin-web-ext-server/src/main/java/org/eclipse/che/plugin/web/inject/WebModule.java @@ -20,7 +20,7 @@ import org.eclipse.che.plugin.web.typescript.TypeScriptProjectType; /** - * + * The module that contains configuration of the server side part of the Web plugin */ @DynaModule public class WebModule extends AbstractModule { diff --git a/plugins/plugin-web/che-plugin-web-ext-server/src/main/java/org/eclipse/che/plugin/web/typescript/TSLSLauncher.java b/plugins/plugin-web/che-plugin-web-ext-server/src/main/java/org/eclipse/che/plugin/web/typescript/TSLSLauncher.java index 5a9ee831cc1..abb9572abea 100644 --- a/plugins/plugin-web/che-plugin-web-ext-server/src/main/java/org/eclipse/che/plugin/web/typescript/TSLSLauncher.java +++ b/plugins/plugin-web/che-plugin-web-ext-server/src/main/java/org/eclipse/che/plugin/web/typescript/TSLSLauncher.java @@ -27,11 +27,11 @@ import static java.util.Arrays.asList; /** - * + * Launcher for TypeScript Language Server */ @Singleton public class TSLSLauncher extends LanguageServerLauncherTemplate { - private static final String LANGUAGE_ID = "js-ts"; + private static final String LANGUAGE_ID = "typescript"; private static final String[] EXTENSIONS = new String[] {"ts"}; private static final String[] MIME_TYPES = new String[] {"application/typescript"}; private static final LanguageDescriptionImpl description; @@ -39,7 +39,7 @@ public class TSLSLauncher extends LanguageServerLauncherTemplate { private final Path launchScript; public TSLSLauncher() { - launchScript = Paths.get(System.getenv("HOME"), "che/ls-js-ts/launch.sh"); + launchScript = Paths.get(System.getenv("HOME"), "che/ls-typescript/launch.sh"); } @Override diff --git a/plugins/plugin-web/che-plugin-web-ext-server/src/main/java/org/eclipse/che/plugin/web/typescript/TypeScriptProjectType.java b/plugins/plugin-web/che-plugin-web-ext-server/src/main/java/org/eclipse/che/plugin/web/typescript/TypeScriptProjectType.java index 9ec458e6a98..4443c3fa46b 100644 --- a/plugins/plugin-web/che-plugin-web-ext-server/src/main/java/org/eclipse/che/plugin/web/typescript/TypeScriptProjectType.java +++ b/plugins/plugin-web/che-plugin-web-ext-server/src/main/java/org/eclipse/che/plugin/web/typescript/TypeScriptProjectType.java @@ -14,7 +14,7 @@ import org.eclipse.che.plugin.web.shared.Constants; /** - * + * TypeScript project type definition */ public class TypeScriptProjectType extends ProjectTypeDef { diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.js-ts.json b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.js-ts.json deleted file mode 100644 index edf1cd224e7..00000000000 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.js-ts.json +++ /dev/null @@ -1,9 +0,0 @@ -{ -"id": "org.eclipse.che.ls.js-ts", -"name": "TypeScript language server", -"description" : "TypeScript intellisense", -"dependencies": [], -"properties": { -}, -"script" : "#\n# Copyright (c) 2012-2016 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.js-ts.binaries\nCHE_DIR=$HOME/che\nLS_DIR=${CHE_DIR}/ls-js-ts\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 nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\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 nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\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 nodejs >/dev/null 2>&1 || {\n {\n if test \"${SUDO}\" = \"\"; then\n curl -sL https://deb.nodesource.com/setup_6.x | bash -;\n else\n curl -sL https://deb.nodesource.com/setup_6.x | ${SUDO} -E bash -;\n fi\n };\n\n ${SUDO} apt-get update;\n ${SUDO} apt-get install -y nodejs;\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 nodejs >/dev/null 2>&1 || {\n {\n if test \"${SUDO}\" = \"\"; then\n curl -sL https://deb.nodesource.com/setup_6.x | bash -;\n else\n curl -sL https://deb.nodesource.com/setup_6.x | ${SUDO} -E bash -;\n fi\n };\n\n ${SUDO} apt-get update;\n ${SUDO} apt-get install -y nodejs;\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 nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} dnf -y install nodejs;\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 nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\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 nodejs >/dev/null 2>&1 || {\n ${SUDO} zypper ar http://download.opensuse.org/repositories/devel:/languages:/nodejs/openSUSE_13.1/ Node.js\n ${SUDO} zypper in nodejs\n }\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat $FILE\n exit 1\nfi\n\n\n########################\n### Install JS-TS LS ###\n########################\n\ncurl -s ${AGENT_BINARIES_URI} | tar xzf - -C ${LS_DIR}\n\ntouch ${LS_LAUNCHER}\nchmod +x ${LS_LAUNCHER}\necho \"nodejs ${LS_DIR}/build/language-server-stdio.js\" > ${LS_LAUNCHER}" -} diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.typescript.json b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.typescript.json new file mode 100644 index 00000000000..a8922a5a8b3 --- /dev/null +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/org.eclipse.che.ls.typescript.json @@ -0,0 +1,9 @@ +{ +"id": "org.eclipse.che.ls.js-ts", +"name": "TypeScript language server", +"description" : "TypeScript intellisense", +"dependencies": [], +"properties": { +}, +"script" : "#\n# Copyright (c) 2012-2016 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.typescript.binaries\nCHE_DIR=$HOME/che\nLS_DIR=${CHE_DIR}/ls-typescript\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 nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\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 nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\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 nodejs >/dev/null 2>&1 || {\n {\n if test \"${SUDO}\" = \"\"; then\n curl -sL https://deb.nodesource.com/setup_6.x | bash -;\n else\n curl -sL https://deb.nodesource.com/setup_6.x | ${SUDO} -E bash -;\n fi\n };\n\n ${SUDO} apt-get update;\n ${SUDO} apt-get install -y nodejs;\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 nodejs >/dev/null 2>&1 || {\n {\n if test \"${SUDO}\" = \"\"; then\n curl -sL https://deb.nodesource.com/setup_6.x | bash -;\n else\n curl -sL https://deb.nodesource.com/setup_6.x | ${SUDO} -E bash -;\n fi\n };\n\n ${SUDO} apt-get update;\n ${SUDO} apt-get install -y nodejs;\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 nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} dnf -y install nodejs;\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 nodejs >/dev/null 2>&1 || {\n curl --silent --location https://rpm.nodesource.com/setup_6.x | ${SUDO} bash -;\n ${SUDO} yum -y install nodejs;\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 nodejs >/dev/null 2>&1 || {\n ${SUDO} zypper ar http://download.opensuse.org/repositories/devel:/languages:/nodejs/openSUSE_13.1/ Node.js\n ${SUDO} zypper in nodejs\n }\n\nelse\n >&2 echo \"Unrecognized Linux Type\"\n >&2 cat $FILE\n exit 1\nfi\n\n\n########################\n### Install JS-TS LS ###\n########################\n\ncurl -s ${AGENT_BINARIES_URI} | tar xzf - -C ${LS_DIR}\n\ntouch ${LS_LAUNCHER}\nchmod +x ${LS_LAUNCHER}\necho \"nodejs ${LS_DIR}/build/language-server-stdio.js\" > ${LS_LAUNCHER}" +} diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.js-ts.script.sh b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.typescript.script.sh similarity index 98% rename from wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.js-ts.script.sh rename to wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.typescript.script.sh index d3e18c9e18f..b10165e979c 100644 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.js-ts.script.sh +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/org.eclipse.che.ls.typescript.script.sh @@ -15,9 +15,9 @@ 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.js-ts.binaries +AGENT_BINARIES_URI=https://codenvy.com/update/repository/public/download/org.eclipse.che.ls.typescript.binaries CHE_DIR=$HOME/che -LS_DIR=${CHE_DIR}/ls-js-ts +LS_DIR=${CHE_DIR}/ls-typescript LS_LAUNCHER=${LS_DIR}/launch.sh if [ -f /etc/centos-release ]; then diff --git a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/update_agents.sh b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/update_agents.sh index 6f3b6b0d330..ee36ba12ba7 100755 --- a/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/update_agents.sh +++ b/wsmaster/che-core-api-agent/src/main/resources/agents/scripts/update_agents.sh @@ -35,4 +35,4 @@ updateAgentScript ".." "org.eclipse.che.ls.json" updateAgentScript ".." "org.eclipse.che.ls.csharp" updateAgentScript ".." "org.eclipse.che.ls.php" updateAgentScript ".." "org.eclipse.che.unison" -updateAgentScript ".." "org.eclipse.che.ls.js-ts" +updateAgentScript ".." "org.eclipse.che.ls.typescript"