According to docs lps should start new pyright server if the root_dir has changed. But it attach already existing server to new buf.
How it must work(And it works fine in my current config):
- cd project1/
- tabnew file1.py (lsp start pyright_server1 and attach it to buf)
- cd project2/
- tabnew file2.py(lsp start pyright_server2 and attach it to new_buf)
But when i tried to use the same config in different PC(the same situation if I remove directory User\AppData\Local\nvim-data and packer made new installation), the behavior changed. It don’t create new server, but attach existing one(pyrigth_server_1 to the buf from project2).
According to LspInfo root_dirs are different for file1.py and file2.py.
I tried to set root_dir manualy in require('lspconfig')['pyright'].setup {}
- it doesn’t help.
To monitor situation I add print to the before_init
function, and had seen that it starts only once.
Which parameter am I not taking into account? What I need to do to get the lsp start different servers to different projects.
OS: Windows 10, but I tryed to start in on Ubuntu. The situation is the same.