diff --git a/nvim/lua/my/lsp/rust.lua b/nvim/lua/my/lsp/rust.lua index 09a107fb..6660e46c 100644 --- a/nvim/lua/my/lsp/rust.lua +++ b/nvim/lua/my/lsp/rust.lua @@ -1,23 +1,25 @@ return { - before_init = function(_, config) - -- Override clippy to run in its own directory to avoid clobbering caches - -- but only if target-dir isn't already set in either the command or the extraArgs - local checkOnSave = config.settings['rust-analyzer'].checkOnSave - local needle = '%-%-target%-dir' - if string.find(checkOnSave.command, needle) then - return - end - - checkOnSave.extraArgs = checkOnSave.extraArgs or {} - for _, v in pairs(checkOnSave.extraArgs or {}) do - if string.find(v, needle) then - return - end - end - - local target_dir = config.root_dir .. '/target/ide-clippy' - table.insert(checkOnSave.extraArgs, '--target-dir=' .. target_dir) - end, + -- before_init = function(_, config) + -- -- Override clippy to run in its own directory to avoid clobbering caches + -- -- but only if target-dir isn't already set in either the command or the extraArgs + -- local checkOnSave = config.settings['rust-analyzer'].checkOnSave + -- local needle = '--target-dir' + -- if string.find(checkOnSave.command, needle, nil, true) then + -- return + -- end + -- + -- checkOnSave.extraArgs = checkOnSave.extraArgs or {} + -- for _, v in pairs(checkOnSave.extraArgs or {}) do + -- if string.find(v, needle, nil, true) then + -- return + -- end + -- end + -- + -- p({ 'before', checkOnSave.extraArgs, checkOnSave.command }) + -- local target_dir = config.root_dir .. '/target/ide-clippy' + -- table.insert(checkOnSave.extraArgs, '--target-dir=' .. target_dir) + -- p({ 'after', checkOnSave.extraArgs }) + -- end, settings = { ['rust-analyzer'] = { checkOnSave = {