Replies: 1 comment 1 reply
-
If you can share some code snippets or minimal repro you've tried, that'd be helpful. If you pass the current visual selection range into the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Things look solidly grim at this point. On the edge of reporting a bug against
vim.lsp.buf.format()
.I'd like to format current visual selection via LSP.
documentFormattingProvider
is present inclient.server_capabilities
and formatting the whole file works just fine.What I have tried so far:
vim.lsp.buf.format()
as per documented. It fails to act on visual selection when called without parameters.range
andbufnr
. Same result, formats the whole buffer.Tested with
ruff
,shfmt
andautopep8
acting as formatters.Any ideas how to make it work? As an absolutely last resort, I am considering extracting text via Lua function, passing it to an external formatter via
stdin
and then replacing selection with itsstdout
, but... This is too much, there has to be a better way.Beta Was this translation helpful? Give feedback.
All reactions