1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 19:50:04 +08:00
SpaceVim/bundle/nvim-lspconfig/lua/lspconfig/gopls.lua

23 lines
528 B
Lua
Raw Normal View History

2021-10-05 15:13:10 +08:00
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'
configs.gopls = {
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")]],
},
},
}