When I call rquire("lspconfig").lua_ls.setup(), lspconfig don't attach to existing lua buffers
Situation:
In my config file nvim/init.lua, I use l use some auto-session plugin to restore a session, which will load files to buffers, then I call the rquire("lspconfig").lua_ls.setup() to setup lua-language-server.
I can't guarantee the order of restore session and setup lspconfig (because I use the asynchronous function to do some check), in fact, the restore session usually before setup lspconfig. Therefore, the lua_ls will don't attach to the existing buffers, and show Other clients that match the filetype: lua in :LspInfo
Should or how to enable lspconfig to attach to existing buffers?
My current temporary solution is to execute :LspStart lua_ls manually
Description
When I call
rquire("lspconfig").lua_ls.setup()
, lspconfig don't attach to existing lua buffersSituation: In my config file
nvim/init.lua
, I use l use some auto-session plugin to restore a session, which will load files to buffers, then I call therquire("lspconfig").lua_ls.setup()
to setup lua-language-server.I can't guarantee the order of
restore session
andsetup lspconfig
(because I use the asynchronous function to do some check), in fact, therestore session
usually beforesetup lspconfig
. Therefore, thelua_ls
will don't attach to the existing buffers, and showOther clients that match the filetype: lua
in:LspInfo
Should or how to enable lspconfig to attach to existing buffers?
My current temporary solution is to execute
:LspStart lua_ls
manuallythanks