aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorecmma <48774736+ecmma@users.noreply.github.com>2021-04-14 22:20:58 +0200
committerGitHub <noreply@github.com>2021-04-14 22:20:58 +0200
commitc679fcc10385feb9167024e7b3b201a602da53ae (patch)
tree94716543cac081024594f5bc26c38fefa1150f22 /lua
parenteslintls: don't execute `tsc` via `npx` (#9) (diff)
downloadmason-c679fcc10385feb9167024e7b3b201a602da53ae.tar
mason-c679fcc10385feb9167024e7b3b201a602da53ae.tar.gz
mason-c679fcc10385feb9167024e7b3b201a602da53ae.tar.bz2
mason-c679fcc10385feb9167024e7b3b201a602da53ae.tar.lz
mason-c679fcc10385feb9167024e7b3b201a602da53ae.tar.xz
mason-c679fcc10385feb9167024e7b3b201a602da53ae.tar.zst
mason-c679fcc10385feb9167024e7b3b201a602da53ae.zip
added gopls server (#8)
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-lsp-installer/server.lua1
-rw-r--r--lua/nvim-lsp-installer/servers/gopls.lua24
2 files changed, 25 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/server.lua b/lua/nvim-lsp-installer/server.lua
index c81393c9..a2717906 100644
--- a/lua/nvim-lsp-installer/server.lua
+++ b/lua/nvim-lsp-installer/server.lua
@@ -7,6 +7,7 @@ local _SERVERS = {
'cssls',
'dockerls',
'eslintls',
+ 'gopls',
'graphql',
'html',
'jsonls',
diff --git a/lua/nvim-lsp-installer/servers/gopls.lua b/lua/nvim-lsp-installer/servers/gopls.lua
new file mode 100644
index 00000000..f370eded
--- /dev/null
+++ b/lua/nvim-lsp-installer/servers/gopls.lua
@@ -0,0 +1,24 @@
+local server = require('nvim-lsp-installer.server')
+
+local root_dir = server.get_server_root_path('go')
+
+local install_cmd = [=[
+
+GO111MODULE=on GOBIN="$PWD" GOPATH="$PWD" go get golang.org/x/tools/gopls@latest;
+command -v ./gopls &> /dev/null;
+
+]=]
+
+return server.Server:new {
+ name = "gopls",
+ root_dir = root_dir,
+ pre_install_check = function ()
+ if vim.fn.executable("go") ~= 1 then
+ error("Please install the Go CLI before installing gopls (https://golang.org/doc/install).")
+ end
+ end,
+ install_cmd = install_cmd,
+ default_options = {
+ cmd = {root_dir .. "/gopls", "-logfile=/home/ecmm/log"},
+ }
+}