Skip to content

Commit

Permalink
async autoformat only for python
Browse files Browse the repository at this point in the history
  • Loading branch information
BakerNet committed Dec 20, 2023
1 parent 4a0ec30 commit 59dfc51
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,16 @@ local setup_autoformat = function()
return
end

local async = false
-- black is too slow - only worth with async
local venv_path = os.getenv('VIRTUAL_ENV')
if venv_path ~= nil then
async = true
end


vim.lsp.buf.format {
async = true, -- black takes forever... we'll see
async = async,
filter = function(c)
return c.id == client.id
end,
Expand Down

0 comments on commit 59dfc51

Please sign in to comment.