Closed kevingentile closed 2 years ago
Hey @kevingentile :wave:,
Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our OpenCollective and consider backing us.
https://opencollective.com/ionide
PS.: We offer
backer
support for all backers. Don't forget to addbacker
label when you start backing us :smile:
Hey @nojaf - I see that FantomasService
expose FormatSelectionAsync
, do you think it is ready for prime time? ;-)
Well, maybe 😸. I've done a bit of revamping of how selection works in Fantomas and the current Fantomas.Client
does expose FormatSelectionAsync
.
All LSP ranges should be converted to FCS ranges (well https://github.com/fsprojects/fantomas/blob/452064c6e05acd2eaa71520ea006c45cc0455783/src/Fantomas.Client/Contracts.fs#L48-L60, which have the same semantics).
If the selection worked (the scenarios are limited to https://github.com/fsprojects/fantomas/blob/master/docs-old/Documentation.md#format-selection), you get a SelectedRange
to know what you really need to replace.(https://github.com/fsprojects/fantomas/blob/452064c6e05acd2eaa71520ea006c45cc0455783/src/Fantomas.Client/Contracts.fs#L69).
The best of luck I'd say.
This has been implemented in https://github.com/fsharp/FsAutoComplete/pull/969 and will be available in the next Ionide release.
Describe the bug**
Selecting a block of code and hot-keying "Format Selection" produces no behavior.
Steps to reproduce
ctrl +k ctrl + f
)Expected behaviour
Block of code is formatted
Machine info
Additional context
"Format document" works as expected. The "Format Selection" hotkeys work for other languages.