fix(lsp): don't start additional client if attach failed (#28744)

If a client for a server was already running and lsp.start was called in
an unloaded buffer it started another client instead of bailing out.
This commit is contained in:
Mathias Fußenegger 2024-05-14 19:38:22 +02:00 committed by GitHub
parent 6a264e0897
commit 5eee633c97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -251,6 +251,8 @@ function lsp.start(config, opts)
if reuse_client(client, config) then
if lsp.buf_attach_client(bufnr, client.id) then
return client.id
else
return nil
end
end
end