optimize null_ls

This commit is contained in:
2025-07-25 21:40:59 +02:00
parent dba36e227c
commit a3269dbfc4
2 changed files with 40 additions and 3 deletions
+8 -2
View File
@@ -16,11 +16,17 @@ local keymap = vim.keymap -- for conciseness
local function smart_format()
vim.lsp.buf.format({
filter = function(client)
if vim.bo.filetype == "rust" then
local ft = vim.bo.filetype
if ft == "rust" then
return client.name == "rust_analyzer"
end
return client.name == "null-ls"
-- Prefer null-ls for all non-Rust, otherwise allow anything
if vim.tbl_contains({ "null-ls", "lua_ls", "jsonls", "tsserver" }, client.name) then
return true
end
return false
end,
timeout_ms = 3000,
})
end
---------- border >------------------------------