TailwindSort on save #15
-
I want to be able to run TailwindSort on save, but the sorting procedure is asynchronous so it's not guaranteed to resolve before the buffer is written. Not a big deal for me - so not ready to make a feature request - but would be nice if the api could easily handle it. |
Beta Was this translation helpful? Give feedback.
Answered by
luckasRanarison
Mar 25, 2024
Replies: 1 comment 2 replies
-
Yeah, I deliberately didn't add sort on save because of the asynchronous nature of the function, but I'm confused what kind of API do you want? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The problem with sorting on save is that we don't know how the users handle BufWrite events, do they use format on save? If so is it asynchronous or not? And in the case where both are async we need a callback API on one side, the default
format
function from neovim doesn't provide a callback argument so I think it's resonable to a callback function on our side or add a sync version (I personally prefer async), but currently there's no way to do that if both are async.