From: Andreas Louv Date: Wed, 12 Apr 2023 21:32:31 +0000 (+0200) Subject: Make sure that "LspAttached" is only called once all servers are attached X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=fd3cba93055786c84c2ef3cfe1e92e003699e84b;p=vim-lsp.git Make sure that "LspAttached" is only called once all servers are attached --- diff --git a/autoload/lsp/lsp.vim b/autoload/lsp/lsp.vim index c8db52c..fdb3978 100644 --- a/autoload/lsp/lsp.vim +++ b/autoload/lsp/lsp.vim @@ -424,7 +424,17 @@ def BufferInit(lspserverId: number, bnr: number): void inlayhints.BufferInit(lspserver, bnr) if exists('#User#LspAttached') - doautocmd User LspAttached + var allServersReady = true + var lspservers: list> = buf.BufLspServersGet(bnr) + for lspsrv in lspservers + if !lspsrv.ready + allServersReady = false + endif + endfor + + if allServersReady + doautocmd User LspAttached + endif endif enddef