Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Commit

Permalink
added clangd server (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
xdoardo committed Apr 8, 2021
1 parent 02fc4cf commit d10094c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ end
## Available LSPs

- bashls
- clangd
- cssls
- dockerls
- eslintls
Expand Down
1 change: 1 addition & 0 deletions lua/nvim-lsp-installer/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ local M = {}
-- :'<,'>!sort
local _SERVERS = {
'bashls',
'clangd',
'cssls',
'dockerls',
'eslintls',
Expand Down
28 changes: 28 additions & 0 deletions lua/nvim-lsp-installer/servers/clangd.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
local server = require('nvim-lsp-installer.server')

local root_dir = server.get_server_root_path('c-family')

local install_cmd = [=[
if [[ $(uname) == Linux ]]; then
wget -O clangd.zip https://github.com/clangd/clangd/releases/download/11.0.0/clangd-linux-11.0.0.zip;
elif [[ $(uname) == Darwin ]]; then
wget -O clangd.zip https://github.com/clangd/clangd/releases/download/11.0.0/clangd-mac-11.0.0.zip;
else
>&2 echo "$(uname) not supported.";
exit 1;
fi
unzip clangd.zip;
rm clangd.zip;
mv clangd_11.0.0 clangd;
]=]

return server.Server:new {
name = "clangd",
root_dir = root_dir,
install_cmd = install_cmd,
default_options = {
cmd = { root_dir .. '/clangd/bin/clangd'},
}
}

0 comments on commit d10094c

Please sign in to comment.