You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are some issues requesting integration with lsp formatting. The problem with supporting this kind of integration is that lsp formatting comes in the form of an async function, and formatter.nvim doesn't have a mechanism for defining a formatter in the form of an async function (only sync functions seem to be supported).
I think that one way this could be implemented, is by checking the number of arguments on the formatter function being passed, and when there is 1 argument, assume it is a callback, and treat it as an async function. In that manner, we could define a formatter in terms of lsp-format.nvim, or something like neovim/neovim#24725 when it gets implemented.
Or maybe try out some other async mechanism, like plenary.async?
There are some issues requesting integration with lsp formatting. The problem with supporting this kind of integration is that lsp formatting comes in the form of an async function, and
formatter.nvim
doesn't have a mechanism for defining a formatter in the form of an async function (only sync functions seem to be supported).I think that one way this could be implemented, is by checking the number of arguments on the formatter function being passed, and when there is 1 argument, assume it is a callback, and treat it as an async function. In that manner, we could define a formatter in terms of lsp-format.nvim, or something like neovim/neovim#24725 when it gets implemented.
Or maybe try out some other async mechanism, like
plenary.async
?Edit: https://stackoverflow.com/questions/56883060/how-to-get-the-number-of-arguments-a-function-in-a-table-expect
The text was updated successfully, but these errors were encountered: