From d88dafc773e15c0e827f1877c62eed00526671a4 Mon Sep 17 00:00:00 2001 From: Thomas Faingnaert Date: Sat, 28 Dec 2019 22:30:35 +0100 Subject: Add installer for clangd (Linux) --- installer/install-clangd.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 installer/install-clangd.sh diff --git a/installer/install-clangd.sh b/installer/install-clangd.sh new file mode 100755 index 0000000..0c47461 --- /dev/null +++ b/installer/install-clangd.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +set -e + +cd $(dirname $0) + +server_dir="../servers/clangd" +[ -d $server_dir ] && rm -rf $server_dir +mkdir $server_dir && cd $server_dir + +os=$(uname -s | tr "[:upper:]" "[:lower:]") + +case $os in + linux) + platform="pc-linux-gnu" + ;; + darwin) + platform="darwin-apple" + ;; +esac + +# Check Ubuntu version +ubuntu_version=$(lsb_release -a 2>&1 | grep 'Release' | awk '{print $2}') + +case $ubuntu_version in + 14.04|16.04|18.04) + platform="linux-gnu-ubuntu-$ubuntu_version" + ;; +esac + +filename="clang+llvm-9.0.0-x86_64-$platform" +url="http://releases.llvm.org/9.0.0/$filename.tar.xz" +echo "Downloading clangd and LLVM..." +curl -LO "$url" +echo "Extracting archive..." +tar xvf $filename.tar.xz --strip-components=2 $filename/bin/clangd +rm -fr clang+llvm-9.0.0* +./clangd --version -- cgit v1.2.3-54-g00ecf From 7a3d9a2be23dca9aeee503c20be79395174ec46a Mon Sep 17 00:00:00 2001 From: Thomas Faingnaert Date: Sat, 28 Dec 2019 22:49:08 +0100 Subject: Add installer for clangd (Windows) --- installer/install-clangd.cmd | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 installer/install-clangd.cmd diff --git a/installer/install-clangd.cmd b/installer/install-clangd.cmd new file mode 100644 index 0000000..bab1730 --- /dev/null +++ b/installer/install-clangd.cmd @@ -0,0 +1,18 @@ +@echo off + +setlocal + +cd /d %~dp0 + +set installer_dir=%cd% +set server_dir=..\servers\clangd +if exist %server_dir% rd /Q /S "%server_dir%" +md "%server_dir%" +cd /d "%server_dir%" + +echo Downloading clang and LLVM... +curl -L -o LLVM-9.0.0-win64.exe "http://releases.llvm.org/9.0.0/LLVM-9.0.0-win64.exe" +echo Running setup... +echo Make sure to add clangd to your PATH +LLVM-9.0.0-win64.exe +del LLVM-9.0.0-win64.exe -- cgit v1.2.3-54-g00ecf From 6171be8b865c33463786fc3b14c3b11ae84c4b23 Mon Sep 17 00:00:00 2001 From: Thomas Faingnaert Date: Sat, 28 Dec 2019 23:38:24 +0100 Subject: Update Windows installation --- installer/install-clangd.cmd | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/installer/install-clangd.cmd b/installer/install-clangd.cmd index bab1730..3ffa48a 100644 --- a/installer/install-clangd.cmd +++ b/installer/install-clangd.cmd @@ -13,6 +13,11 @@ cd /d "%server_dir%" echo Downloading clang and LLVM... curl -L -o LLVM-9.0.0-win64.exe "http://releases.llvm.org/9.0.0/LLVM-9.0.0-win64.exe" echo Running setup... -echo Make sure to add clangd to your PATH -LLVM-9.0.0-win64.exe + +REM Run setup as regular user to avoid a UAC popup +set __COMPAT_LAYER=RUNASINVOKER +md tmp +LLVM-9.0.0-win64.exe /S /D=%cd%\tmp +copy tmp\bin\clangd.exe clangd.exe del LLVM-9.0.0-win64.exe +rd /Q /S %cd%\tmp -- cgit v1.2.3-54-g00ecf From c4966c089455bee11649a245bd1add34a3f5b8f6 Mon Sep 17 00:00:00 2001 From: Thomas Faingnaert Date: Sat, 28 Dec 2019 23:38:53 +0100 Subject: Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c4a07d9..2805801 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ Currently, no way to uninstall/update server. Run this command again, newer vers | Language | Language Server | Local Install | |------------|--------------------------------------------------------|:-------------:| -| C/C++ | clangd | No | +| C/C++ | clangd | Yes | | C# | omnisharp | Yes | | Clojure | clojure-lsp | Yes | | TypeScript | typescript-language-server | Yes | -- cgit v1.2.3-54-g00ecf From 29441d4b8c916758b1824d39ea743935ae8909f6 Mon Sep 17 00:00:00 2001 From: Thomas Faingnaert Date: Sat, 28 Dec 2019 23:43:00 +0100 Subject: Print clangd version --- installer/install-clangd.cmd | 1 + 1 file changed, 1 insertion(+) diff --git a/installer/install-clangd.cmd b/installer/install-clangd.cmd index 3ffa48a..3079de1 100644 --- a/installer/install-clangd.cmd +++ b/installer/install-clangd.cmd @@ -21,3 +21,4 @@ LLVM-9.0.0-win64.exe /S /D=%cd%\tmp copy tmp\bin\clangd.exe clangd.exe del LLVM-9.0.0-win64.exe rd /Q /S %cd%\tmp +.\clangd.exe --version -- cgit v1.2.3-54-g00ecf From ac0ae5d7ab8144890afd4af6cc884daa2524f72b Mon Sep 17 00:00:00 2001 From: Thomas Faingnaert Date: Sun, 29 Dec 2019 00:20:26 +0100 Subject: Change Linux installer --- installer/install-clangd.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/installer/install-clangd.sh b/installer/install-clangd.sh index 0c47461..d652736 100755 --- a/installer/install-clangd.sh +++ b/installer/install-clangd.sh @@ -33,6 +33,7 @@ url="http://releases.llvm.org/9.0.0/$filename.tar.xz" echo "Downloading clangd and LLVM..." curl -LO "$url" echo "Extracting archive..." -tar xvf $filename.tar.xz --strip-components=2 $filename/bin/clangd -rm -fr clang+llvm-9.0.0* +tar xvf $filename.tar.xz --strip-components=1 $filename/ +rm $filename.tar.xz +ln -sf bin/clangd ./clangd --version -- cgit v1.2.3-54-g00ecf From a9d08018f4ed97e2cd89fd2e39a0cd04c19f2ac3 Mon Sep 17 00:00:00 2001 From: Thomas Faingnaert Date: Sun, 29 Dec 2019 01:32:14 +0100 Subject: Disable verbose option --- installer/install-clangd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/install-clangd.sh b/installer/install-clangd.sh index d652736..75db8c1 100755 --- a/installer/install-clangd.sh +++ b/installer/install-clangd.sh @@ -33,7 +33,7 @@ url="http://releases.llvm.org/9.0.0/$filename.tar.xz" echo "Downloading clangd and LLVM..." curl -LO "$url" echo "Extracting archive..." -tar xvf $filename.tar.xz --strip-components=1 $filename/ +tar xf $filename.tar.xz --strip-components=1 $filename/ rm $filename.tar.xz ln -sf bin/clangd ./clangd --version -- cgit v1.2.3-54-g00ecf