File tree 1 file changed +23
-3
lines changed
1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change 17
17
18
18
local M = {}
19
19
20
- local lsp_basic = require (' aceforeverd.lsp.common' )
21
-
22
20
function M .setup ()
23
21
if vim .g .my_cmp_source ~= ' nvim_lsp' then
24
22
return
@@ -51,9 +49,31 @@ function M.setup()
51
49
end
52
50
53
51
function M .go ()
52
+ local go_cfg = require (' aceforeverd.lsp.common' ).general_cfg
53
+ -- https://github.com/ray-x/go.nvim?tab=readme-ov-file#nvim-lsp-setup
54
+ go_cfg .settings = {
55
+ gopls = {
56
+ -- more settings: https://github.com/golang/tools/blob/master/gopls/doc/settings.md
57
+ analyses = {
58
+ unreachable = true ,
59
+ nilness = true ,
60
+ unusedparams = true ,
61
+ useany = true ,
62
+ unusedwrite = true ,
63
+ ST1003 = true ,
64
+ undeclaredname = true ,
65
+ fillreturns = true ,
66
+ nonewvars = true ,
67
+ fieldalignment = true ,
68
+ shadow = true ,
69
+ },
70
+ }
71
+ }
72
+ go_cfg .capabilities .textDocument .completion .dynamicRegistration = true
73
+
54
74
-- :GoInstallBinaries
55
75
require (' go' ).setup ({
56
- lsp_cfg = require ( ' aceforeverd.lsp.common ' ). general_cfg ,
76
+ lsp_cfg = go_cfg ,
57
77
textobjects = false ,
58
78
lsp_keymaps = false ,
59
79
lsp_inlay_hints = {
You can’t perform that action at this time.
0 commit comments