I’m trying to find a way to save the buffer after calling async formatting. Probably something like a hook, or overriding the handler. Is there a way to achieve this?
I think you need to use the sync one and create an autocmd
vim.api.nvim_command[[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()]]