[nvim] Default configuration for gopls.
This commit is contained in:
@@ -1,33 +1,33 @@
|
|||||||
-- local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
-- local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
vim.lsp.config('gopls', {
|
--vim.lsp.config('gopls', {
|
||||||
on_attach = function(client, bufnr)
|
-- on_attach = function(client, bufnr)
|
||||||
require "lsp_signature".on_attach({
|
-- require "lsp_signature".on_attach({
|
||||||
bind = true,
|
-- bind = true,
|
||||||
-- floating_window = true,
|
-- -- floating_window = true,
|
||||||
--hint_enable = true,
|
-- --hint_enable = true,
|
||||||
fix_pos = true,
|
-- fix_pos = true,
|
||||||
use_lspsaga = true,
|
-- use_lspsaga = true,
|
||||||
handler_opts = {
|
-- handler_opts = {
|
||||||
border = "rounded" -- double, single, shadow, none
|
-- border = "rounded" -- double, single, shadow, none
|
||||||
},
|
-- },
|
||||||
})
|
-- })
|
||||||
end,
|
-- end,
|
||||||
cmd = {"gopls", "serve"},
|
-- cmd = {"gopls", "serve"},
|
||||||
settings = {
|
-- settings = {
|
||||||
autostart = true,
|
-- autostart = true,
|
||||||
gopls = {
|
-- gopls = {
|
||||||
analyses = {
|
-- analyses = {
|
||||||
unusedparams = true,
|
-- unusedparams = true,
|
||||||
},
|
-- },
|
||||||
staticcheck = true,
|
-- staticcheck = true,
|
||||||
},
|
-- },
|
||||||
},
|
-- },
|
||||||
autostart = true,
|
-- autostart = true,
|
||||||
root_dir = require('lspconfig').util.root_pattern(".git","go.mod"),
|
-- root_dir = require('lspconfig').util.root_pattern(".git","go.mod"),
|
||||||
init_options = {usePlaceholders = false, completeUnimported = true},
|
-- init_options = {usePlaceholders = false, completeUnimported = true},
|
||||||
-- capabilities = capabilities,
|
-- -- capabilities = capabilities,
|
||||||
single_file_support = true;
|
-- single_file_support = true;
|
||||||
})
|
--})
|
||||||
vim.lsp.enable('gopls')
|
vim.lsp.enable('gopls')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user