add gopls cmd path

pull/21/head
ray-x 3 years ago
parent 0d0a54be7e
commit 018de85e7f

@ -299,11 +299,14 @@ require('go').setup(cfg = {
lsp_on_attach = true, -- if a on_attach function provided: attach on_attach function to gopls
-- true: will use go.nvim on_attach if true
-- nil/false do nothing
gopls_cmd = nil, -- if you need to specify gopls path and cmd, e.g {"/home/user/lsp/gopls", "-logfile",
"/var/log/gopls.log" }
lsp_diag_hdlr = true, -- hook lsp diag handler
dap_debug = false, -- set to true to enable dap
dap_debug_keymap = true, -- set keymaps for debugger
dap_debug_gui = true, -- set to true to enable dap gui, highly recommand
dap_debug_vt = true, -- set to true to enable dap virtual text
})
```

@ -15,7 +15,8 @@ _GO_NVIM_CFG = {
lsp_diag_hdlr = true, -- hook lsp diag handler
dap_debug = false,
dap_debug_gui = false,
dap_vt = true -- false, true and 'all frames'
dap_vt = true, -- false, true and 'all frames'
gopls_cmd = nil --- you can provide gopls path and cmd if it not in PATH, e.g. cmd = { "/home/ray/.local/nvim/data/lspinstall/go/gopls" }
}
local dap_config = function()

@ -99,6 +99,10 @@ else
print("gopls on_attach not set")
end
if _GO_NVIM_CFG.gopls_cmd then
gopls.cmd = _GO_NVIM_CFG.gopls_cmd
end
if _GO_NVIM_CFG.lsp_gofumpt then
gopls.settings.gopls.gofumpt = true
end

Loading…
Cancel
Save