aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2020-01-01 14:51:51 +0900
committerGitHub <noreply@github.com>2020-01-01 14:51:51 +0900
commitbcbc1a04f0155f917ec0d08364580b2c62d0fc69 (patch)
tree40a50d52f0dcf8fc0193b99cca4cbe1abafc0502
parentb82ed53f08171d3193598a4f8d472eed2be9d438 (diff)
parenta9d08018f4ed97e2cd89fd2e39a0cd04c19f2ac3 (diff)
downloadvim-lsp-settings-bcbc1a04f0155f917ec0d08364580b2c62d0fc69.tar.gz
vim-lsp-settings-bcbc1a04f0155f917ec0d08364580b2c62d0fc69.tar.bz2
vim-lsp-settings-bcbc1a04f0155f917ec0d08364580b2c62d0fc69.zip
Merge pull request #41 from thomasfaingnaert/installer-clangd
Add installer for clangd
-rw-r--r--README.md2
-rw-r--r--installer/install-clangd.cmd24
-rwxr-xr-xinstaller/install-clangd.sh39
3 files changed, 64 insertions, 1 deletions
diff --git a/README.md b/README.md
index c2f84b3..e3b76b1 100644
--- a/README.md
+++ b/README.md
@@ -63,7 +63,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 |
diff --git a/installer/install-clangd.cmd b/installer/install-clangd.cmd
new file mode 100644
index 0000000..3079de1
--- /dev/null
+++ b/installer/install-clangd.cmd
@@ -0,0 +1,24 @@
+@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...
+
+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
+.\clangd.exe --version
diff --git a/installer/install-clangd.sh b/installer/install-clangd.sh
new file mode 100755
index 0000000..75db8c1
--- /dev/null
+++ b/installer/install-clangd.sh
@@ -0,0 +1,39 @@
+#!/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 xf $filename.tar.xz --strip-components=1 $filename/
+rm $filename.tar.xz
+ln -sf bin/clangd
+./clangd --version