feat(lsp): hot reload of lsp config
This commit is contained in:
+17
-31
@@ -1,36 +1,22 @@
|
||||
local module_name = "core.user_commands"
|
||||
local utils = require("utils")
|
||||
|
||||
vim.api.nvim_create_user_command(
|
||||
"Update",
|
||||
function (_)
|
||||
utils.try_require(
|
||||
"lazy",
|
||||
module_name,
|
||||
function (lazy)
|
||||
lazy.update()
|
||||
end
|
||||
)
|
||||
vim.api.nvim_create_user_command("Update", function(_)
|
||||
local lazy = utils.try_require("lazy")
|
||||
if lazy then
|
||||
lazy.update()
|
||||
end
|
||||
|
||||
utils.try_require(
|
||||
"nvim-treesitter.install",
|
||||
module_name,
|
||||
function (treesitter_install)
|
||||
treesitter_install.update({ with_sync = true, })("all")
|
||||
end
|
||||
)
|
||||
local treesitter_install = utils.try_require("nvim-treesitter.install")
|
||||
if treesitter_install then
|
||||
treesitter_install.update({ with_sync = true })("all")
|
||||
end
|
||||
|
||||
utils.try_require(
|
||||
"mason-update-all",
|
||||
module_name,
|
||||
function (mason_update_all)
|
||||
mason_update_all.update_all()
|
||||
end
|
||||
)
|
||||
end,
|
||||
{
|
||||
desc =
|
||||
"Update lazy plugins, treesitter parsers and mason language servers",
|
||||
force = false,
|
||||
}
|
||||
)
|
||||
local mason_update_all = utils.try_require("mason-update-all")
|
||||
if mason_update_all then
|
||||
mason_update_all.update_all()
|
||||
end
|
||||
end, {
|
||||
desc = "Update lazy plugins, treesitter parsers and mason language servers",
|
||||
force = false,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user