aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
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"},
+ }
+}