lukas-reineke / lsp-format.nvim

A wrapper around Neovims native LSP formatting.
559 stars 27 forks source link

Can you add autocommand event? #55

Open mosheavni opened 1 year ago

mosheavni commented 1 year ago

I want to popup a notification that the file was formatted using client_name, can you either fire a custom autocommand event? or provide an option for a callback using the setup function for after the file is formatted? Thanks

lukas-reineke commented 1 year ago

Would be nice to add something like this :+1:, but I am super busy currently. Probably won't happen for a while, sorry.

mosheavni commented 1 year ago

Would be nice to add something like this 👍, but I am super busy currently. Probably won't happen for a while, sorry.

Sure thing, will you accept a PR?

lukas-reineke commented 1 year ago

will you accept a PR?

Yes, but this is a little more complex than just doing an event when the file is formatted. There could be more than one client. Each client can have result/no result/error. If there is a result, it might not be applied for different reasons. And each client has a context. Some/All that information should probably be in the event as well somehow.