From 6770808bec1ffcada425ae514747f9380e3d3b8d Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Mon, 6 Dec 2021 17:04:46 +0100 Subject: feat: full compatibility with neovim v0.6 (#2037) --- lua/lvim/utils/hooks.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lua/lvim/utils/hooks.lua') diff --git a/lua/lvim/utils/hooks.lua b/lua/lvim/utils/hooks.lua index 0fe4a7fd..1d265482 100644 --- a/lua/lvim/utils/hooks.lua +++ b/lua/lvim/utils/hooks.lua @@ -7,7 +7,9 @@ local in_headless = #vim.api.nvim_list_uis() == 0 function M.run_pre_update() Log:debug "Starting pre-update hook" _G.__luacache.clear_cache() - vim.cmd "LspStop" + if package.loaded["lspconfig"] then + vim.cmd [[ LspStop ]] + end end ---Reset any startup cache files used by Packer and Impatient @@ -34,9 +36,14 @@ function M.run_post_update() if not in_headless then vim.schedule(function() + if package.loaded["nvim-treesitter"] then + vim.cmd [[ TSUpdateSync ]] + end -- TODO: add a changelog vim.notify("Update complete", vim.log.levels.INFO) - vim.cmd "LspRestart" + if package.loaded["lspconfig"] then + vim.cmd [[ LspRestart ]] + end end) end end -- cgit v1.2.3