Skip to content

Commit 0250757

Browse files
author
Eugene Ivantsov
authored
Use a more advanced TypeScript LS (eclipse-che#7079)
* Use a more advanced TypeScript LS * Use a more advanced TypeScript LS * Use a more advanced TypeScript LS * Use a more advanced TypeScript LS
1 parent 5e434fa commit 0250757

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

agents/ls-typescript/src/main/resources/installers/1.0.1/org.eclipse.che.ls.typescript.script.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ unset PACKAGES
2626
command -v tar >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" tar"; }
2727
command -v curl >/dev/null 2>&1 || { PACKAGES=${PACKAGES}" curl"; }
2828

29-
AGENT_BINARIES_URI=https://codenvy.com/update/repository/public/download/org.eclipse.che.ls.typescript.binaries/1.0.1
3029
CHE_DIR=$HOME/che
3130
LS_DIR=${CHE_DIR}/ls-typescript
3231
LS_LAUNCHER=${LS_DIR}/launch.sh
@@ -161,8 +160,16 @@ fi
161160
### Install JS-TS LS ###
162161
########################
163162

164-
curl -s ${AGENT_BINARIES_URI} | tar xzf - -C ${LS_DIR}
163+
# Check if tsserver and typescript-language-server are installed
164+
165+
unset TS_NPMS
166+
command -v tsserver >/dev/null 2>&1 || { TS_NPMS=${TS_NPMS}" typescript"; }
167+
command -v typescript-language-server >/dev/null 2>&1 || { TS_NPMS=${TS_NPMS}" typescript-language-server"; }
168+
169+
test "${TS_NPMS}" = "" || {
170+
${SUDO} npm install -g ${TS_NPMS};
171+
}
165172

166173
touch ${LS_LAUNCHER}
167174
chmod +x ${LS_LAUNCHER}
168-
echo "nodejs ${LS_DIR}/build/language-server-stdio.js" > ${LS_LAUNCHER}
175+
echo "typescript-language-server --stdio" > ${LS_LAUNCHER}

0 commit comments

Comments
 (0)