mirror of
https://github.com/mfussenegger/nvim-jdtls
synced 2024-09-16 14:34:13 +02:00
Wait until clients close in wipe_data_and_restart
This commit is contained in:
parent
c4ae99f442
commit
3492d44b75
1 changed files with 8 additions and 7 deletions
|
@ -305,14 +305,15 @@ function M.wipe_data_and_restart()
|
|||
end
|
||||
vim.schedule(function()
|
||||
lsp_clients.stop()
|
||||
vim.defer_fn(function()
|
||||
vim.fn.delete(data_dir, 'rf')
|
||||
for _, buf in pairs(api.nvim_list_bufs()) do
|
||||
if vim.bo[buf].filetype == 'java' then
|
||||
api.nvim_buf_call(buf, function() vim.cmd('e!') end)
|
||||
end
|
||||
vim.wait(30000, function()
|
||||
return vim.tbl_count(vim.lsp.get_active_clients({ name = "jdtls" })) == 0
|
||||
end)
|
||||
vim.fn.delete(data_dir, 'rf')
|
||||
for _, buf in pairs(api.nvim_list_bufs()) do
|
||||
if vim.bo[buf].filetype == 'java' then
|
||||
api.nvim_buf_call(buf, function() vim.cmd('e!') end)
|
||||
end
|
||||
end, 200)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue