Closed carschandler closed 3 months ago
Commands are not supported as formatters, due to the fact that they have a radically different interface. See #193 for more
There are other tools (such as isort) that can sort your imports for you; I would recommend using one of those.
Did you check existing requests?
Describe the feature
pyright
(andbasedpyright
) provides apyright.organizeimports
(basedpyright.organizeimports
) command that organizes Python imports. It would be nice to be able to simply specify my Python config inconform
likeProvide background
My current workflow is to use the
:PyrightOrganizeImports
command provided bylspconfig
, but it would be much nicer to have this as part ofconform
so that it weaves into the auto-formatting workflow. I'd like to achieve this without having to install a separate program just for organizing imports. It's just a couple of lines of lua inlspconfig
that define the command, but given that this is technically part of the LSP, I'm not sure if this disqualifies it from being part ofconform
.This seems pretty straightforward to implement... if someone could point me in the right direction for the idiomatic way to implement a simple lua function as the command, I'd be happy to open a PR!
What is the significance of this feature?
nice to have
Additional details
Command from
lspconfig
: