m-pilia / vim-ccls

Vim plugin for the ccls language server
MIT License
97 stars 7 forks source link

[Bug] `ccls` not detected when starting other LSP in a different buffer #61

Closed pidgeon777 closed 2 years ago

pidgeon777 commented 2 years ago

This line:

https://github.com/m-pilia/vim-ccls/blob/93ac5dbdeaaaed8fdfd6d850f1e57fb28d204886/lua/vim_ccls/init.lua#L7

Should be changed to:

for _, v in pairs(clients) do 

otherwise ccls won't be detected anymore for a given buffer, when starting another LSP server on a different buffer.

My modification has been tested and it always works. Some possible explanations:

https://github.com/ojroques/nvim-hardline/pull/31

https://www.tutorialspoint.com/what-is-the-difference-between-pairs-vs-ipairs-in-lua#:~:text=In%20Lua%2C%20we%20make%20use,stored%20at%20that%20index%20table.

m-pilia commented 2 years ago

Thank you @pidgeon777 for reporting this!

pidgeon777 commented 2 years ago

It's been a pleasure, yours is a good plugin.

I also hope one day this will be taken into consideration:

https://github.com/m-pilia/vim-ccls/issues/62