optimize null_ls
This commit is contained in:
@@ -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 >------------------------------
|
||||
|
||||
Reference in New Issue
Block a user