Actually fix restarting the LSP in :BuildDir job callback

This commit is contained in:
Kenneth Benzie (Benie) 2024-08-06 17:29:36 +01:00
parent d1f83a05b9
commit 2cd7d34375

View File

@ -31,9 +31,12 @@ function build.set_dir(dirname)
-- Restart clangd language server
on_exit = function()
vim.cmd('LspStop')
vim.cmd('LspStart')
-- This is a callback so doesn't run on the main thread which causes
-- issues for running commands, so schedule that on the main thread.
vim.schedule(function()
vim.cmd('LspRestart')
echo('Build directory selected: ' .. dirname, 'DiagnosticInfo')
end)
end,
-- Display any error messages to the user