@@ -56,7 +56,7 @@ let s:packages = {
56
56
\ ' gogetdoc' : [' github.com/zmb3/gogetdoc' ],
57
57
\ ' goimports' : [' golang.org/x/tools/cmd/goimports' ],
58
58
\ ' golint' : [' golang.org/x/lint/golint' ],
59
- \ ' gopls' : [' golang.org/x/tools/gopls@latest' ],
59
+ \ ' gopls' : [' golang.org/x/tools/gopls@latest' , {}, { ' after ' : function ( ' go#lsp#Restart ' , [])} ],
60
60
\ ' gometalinter' : [' github.com/alecthomas/gometalinter' ],
61
61
\ ' golangci-lint' : [' github.com/golangci/golangci-lint/cmd/golangci-lint' ],
62
62
\ ' gomodifytags' : [' github.com/fatih/gomodifytags' ],
@@ -136,29 +136,29 @@ function! s:GoInstallBinaries(updateBinaries, ...)
136
136
let l: platform = ' windows'
137
137
endif
138
138
139
- for [binary , pkg] in items (l: packages )
140
- let l: importPath = pkg[0 ]
139
+ for [l: binary , l: pkg ] in items (l: packages )
140
+ let l: importPath = l: pkg [0 ]
141
141
142
142
" TODO(bc): how to support this with modules? Do we have to clone and then
143
143
" install manually? Probably not. I suspect that we can just use GOPATH
144
144
" mode and then do the legacy method.
145
- let bin_setting_name = " go_" . binary . " _bin"
145
+ let bin_setting_name = " go_" . l: binary . " _bin"
146
146
147
147
if exists (" g:{bin_setting_name}" )
148
148
let bin = g: {bin_setting_name}
149
149
else
150
150
if go#util#IsWin ()
151
- let bin = binary . ' .exe'
151
+ let bin = l: binary . ' .exe'
152
152
else
153
- let bin = binary
153
+ let bin = l: binary
154
154
endif
155
155
endif
156
156
157
157
if ! executable (bin ) || a: updateBinaries == 1
158
158
if a: updateBinaries == 1
159
- echo " vim-go: Updating " . binary . " . Reinstalling " . importPath . " to folder " . go_bin_path
159
+ echo " vim-go: Updating " . l: binary . " . Reinstalling " . importPath . " to folder " . go_bin_path
160
160
else
161
- echo " vim-go: " . binary ." not found. Installing " . importPath . " to folder " . go_bin_path
161
+ echo " vim-go: " . l: binary ." not found. Installing " . importPath . " to folder " . go_bin_path
162
162
endif
163
163
164
164
if l: importPath = ~ " @"
@@ -208,9 +208,13 @@ function! s:GoInstallBinaries(updateBinaries, ...)
208
208
echom " Error installing " . l: importPath . " : " . l: out
209
209
endif
210
210
211
+
211
212
call call (Restore_modules, [])
212
213
endif
213
214
215
+ if len (l: pkg ) > 2
216
+ call call (get (l: pkg [2 ], ' after' , function (' s:noop' , [])), [])
217
+ endif
214
218
endif
215
219
endfor
216
220
0 commit comments