feat: added build pristine, build configuration, erase and recover
This commit is contained in:
1 parent
80a2c4d56f
commit
5b1d640d4b
11 files changed
+636
-80
No files matched your search
+27
-3
@@ -1,11 +1,34 @@
|
||||
local M = {}
|
||||
|
||||
local SKIP = { mcuboot = true, matter_factory_data = true }
|
||||
local SKIP = {
|
||||
mcuboot = true,
|
||||
matter_factory_data = true,
|
||||
}
|
||||
|
||||
--- Reinicia clangd para que relea compile_commands.json.
|
||||
--- :LspRestart lo aporta nvim-lspconfig; puede no existir según la versión.
|
||||
local function restart_lsp()
|
||||
if vim.fn.exists(":LspRestart") == 2 then
|
||||
vim.cmd("LspRestart")
|
||||
return
|
||||
end
|
||||
|
||||
-- Fallback: Neovim 0.11+ sabe (des)habilitar servidores por nombre.
|
||||
local ok = pcall(function()
|
||||
vim.lsp.enable("clangd", false)
|
||||
vim.defer_fn(function()
|
||||
vim.lsp.enable("clangd", true)
|
||||
end, 150)
|
||||
end)
|
||||
if not ok then
|
||||
vim.notify("[hego] no tengo :LspRestart; reinicia clangd a mano", vim.log.levels.WARN)
|
||||
end
|
||||
end
|
||||
|
||||
function M.link(opts)
|
||||
local m = vim.fn.glob(opts.build_dir .. "/*/compile_commands.json", false, true)
|
||||
if #m == 0 then
|
||||
m = vim.fn.glob(opts.build_dir .. "/compile_commands.json", false, true) -- sin sysbuild
|
||||
m = vim.fn.glob(opts.build_dir .. "/compile_commands.json", false, true)
|
||||
end
|
||||
if #m == 0 then
|
||||
vim.notify("[hego] no encuentro compile_commands.json", vim.log.levels.WARN)
|
||||
@@ -32,7 +55,8 @@ function M.link(opts)
|
||||
vim.notify("[hego] fallo creando el symlink", vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
vim.cmd("LspRestart") -- clangd solo lo lee al arrancar
|
||||
|
||||
restart_lsp()
|
||||
vim.notify("[hego] compile_commands.json -> " .. chosen, vim.log.levels.INFO)
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user