Skip to content

Commit 3694725

Browse files
committed
Fixes to restart behavior: missing didOpen and duplicate workspace path.
1 parent f365d96 commit 3694725

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

autoload/go/lsp.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ function! s:newlsp() abort
363363
\ }
364364
call go#statusline#Update(l:wd, l:status)
365365

366-
let self.workspaceDirectories = add(self.workspaceDirectories, l:wd)
366+
let self.workspaceDirectories = s:dedup(add(self.workspaceDirectories, l:wd))
367367
let l:msg = self.newMessage(go#lsp#message#Initialize(l:wd))
368368

369369
let l:state = s:newHandlerState('')
@@ -458,7 +458,7 @@ function! s:newlsp() abort
458458
call call('go#lsp#AddWorkspaceDirectory', l:workspaces)
459459
" * send DidOpen messages for all buffers that have b:did_lsp_open set
460460
" TODO(bc): check modifiable and filetype, too?
461-
bufdo if get(b:, 'go_lsp_did_open', 0) | if &modified | call go#lsp#DidOpen(expand('%:p')) | else | call go#lsp#DidChange(expand('%:p')) | endif | endif
461+
bufdo! if get(b:, 'go_lsp_did_open', 0) | let b:go_lsp_did_open = 0 | if &modified | call go#lsp#DidOpen(expand('%:p')) | else | call go#lsp#DidChange(expand('%:p')) | endif | endif
462462
let l:lsp.queue = extend(l:lsp.queue, l:queue)
463463
return
464464
endfunction

0 commit comments

Comments
 (0)