Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Lsp isnt restarted properly (using dein.vim) #2

Open
aMOPel opened this issue Apr 20, 2021 · 3 comments
Open

Lsp isnt restarted properly (using dein.vim) #2

aMOPel opened this issue Apr 20, 2021 · 3 comments

Comments

@aMOPel
Copy link

aMOPel commented Apr 20, 2021

Hey there,
nice plugin, exactly what i need, though im having a little trouble.
Im using dein and it has a little bit of a weird policy for folders. As far as i understood it it has all the repos in ~/.cache/dein/repos/github.com/ and it caches them all together in a cache dir (~/.cache/dein/.cache/init.vim/.dein/), so the rtp of vim isnt as cluttered. Anyway, i did this to setup your plugin:
`" nvim-reload
lua <<EOF
local reload = require('nvim-reload')

local plugin_dirs = os.getenv("HOME") .. '/.cache/dein/.cache/init.vim/.dein/*'

reload.vim_reload_dirs = {
vim.fn.stdpath('config'),
plugin_dirs
}

reload.lua_reload_dirs = {
vim.fn.stdpath('config'),
-- Note: the line below may cause issues reloading your config
plugin_dirs
}
EOF`

i dont know lua but it seems to work? but not quite.
when i do either :Reload or :Restart i get
Client 1 quit with exit code 1 and signal 0 Client 3 quit with exit code 1 and signal 0 Client 5 quit with exit code 1 and signal 0
(called it three times and the client count is increasing by 2 each time)
and also before the restart :LspInfo gives this
`Configured servers: clangd
Neovim logs at: /home/momo/.cache/nvim/lsp.log

1 client(s) attached to this buffer: clangd

Client: clangd (id 1)
root: ..
filetypes: c, cpp, objc, objcpp
cmd: clangd --background-index

1 active client(s):

Client: clangd (id 1)
root: ..
filetypes: c, cpp, objc, objcpp
cmd: clangd --background-index

Clients that match the filetype cpp:

Config: clangd
cmd: clangd --background-index
cmd is executable: True
identified root: ..
custom handlers:
`

and afterwards it gives this
`Configured servers: clangd
Neovim logs at: /home/momo/.cache/nvim/lsp.log

0 client(s) attached to this buffer:

1 active client(s):

Client: clangd (id 3)
root: ..
filetypes: c, cpp, objc, objcpp
cmd: clangd --background-index

Clients that match the filetype cpp:

Config: clangd
cmd: clangd --background-index
cmd is executable: True
identified root: ..
custom handlers:
`

there is some code to restart the lsp in your plugin but it isnt doing it properly for me at least. Any thoughts?

@famiu
Copy link
Owner

famiu commented Apr 20, 2021

I'm facing the same issue actually, and I doubt it has anything with dein.vim since I don't use it. Currently thinking of workarounds.

@MagicDuck
Copy link

Same issue here with lsp on reload. I use an ugly hack which is to execute :e! on every opened buffer using bufdo. This attaches the lsp clients to them...

@famiu
Copy link
Owner

famiu commented Apr 22, 2021

Same issue here with lsp on reload. I use an ugly hack which is to execute :e! on every opened buffer using bufdo. This attaches the lsp clients to them...

Can confirm that this works, in fact I'm using it in the experimental branch but the branch just doesn't seem to play nice with nvim-tree or nvim-treesitter

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants