1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 22:00:07 +08:00
SpaceVim/bundle/nvim-lspconfig/lua/lspconfig/server_configurations/gopls.lua
2024-06-13 08:44:55 +08:00

22 lines
475 B
Lua

local util = require 'lspconfig.util'
return {
default_config = {
cmd = { 'gopls' },
filetypes = { 'go', 'gomod' },
root_dir = function(fname)
return util.root_pattern 'go.work'(fname) or util.root_pattern('go.mod', '.git')(fname)
end,
},
docs = {
description = [[
https://github.com/golang/tools/tree/master/gopls
Google's lsp server for golang.
]],
default_config = {
root_dir = [[root_pattern("go.mod", ".git")]],
},
},
}