-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathgopls.lua
More file actions
31 lines (29 loc) · 774 Bytes
/
gopls.lua
File metadata and controls
31 lines (29 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
local M = {}
local me = require("kide.melspconfig")
M.config = {
name = "gopls",
cmd = { "gopls" },
filetypes = { "go", "gomod", "gowork", "gotmpl" },
root_dir = vim.fs.root(0, { "go.work", "go.mod", ".git" }),
single_file_support = true,
settings = {
gopls = {
analyses = {
-- https://staticcheck.dev/docs/checks/#SA5008
-- Invalid struct tag
SA5008 = true,
-- Incorrect or missing package comment
ST1000 = true,
-- Incorrectly formatted error string
ST1005 = true,
},
staticcheck = true, -- 启用 staticcheck 检查
},
},
init_options = vim.empty_dict(),
handlers = {},
on_attach = me.on_attach,
on_init = me.on_init,
capabilities = me.capabilities(),
}
return M