summaryrefslogtreecommitdiffstats
path: root/.config/nvim/lua/lsp/gopls.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/lsp/gopls.lua')
-rw-r--r--.config/nvim/lua/lsp/gopls.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/.config/nvim/lua/lsp/gopls.lua b/.config/nvim/lua/lsp/gopls.lua
new file mode 100644
index 0000000..c37da39
--- /dev/null
+++ b/.config/nvim/lua/lsp/gopls.lua
@@ -0,0 +1,25 @@
+vim.lsp.config('gopls', {
+ cmd = {'gopls'},
+ filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' },
+ root_markers = {'go.mod', 'go.sum', '.git'},
+ settings = {
+ gopls = {
+ analyses = {
+ unreachable = true,
+ unusedparams = true,
+ },
+ codelenses = {
+ generate = true,
+ gc_details = true,
+ },
+ annotations = {
+ bounds = true,
+ escape = true,
+ inline = true,
+ },
+ gofumpt = true,
+ }
+ }
+})
+
+vim.lsp.enable('gopls')