VSCode Format selection functionality doesn't work with this plugin
Opened this issue · 1 comments
Dependency information
VSCode 1.85.1
prettier 3.1.1
prettier-plugin-brace-style 0.5.0
Steps to reproduce
Select a block to format and use editor.action.formatSelection in VSCode.
The current behavior
VSCode has this cool feature called Format selection (editor.action.formatSelection) which allows me to only format my own blocks of a file without having to change it completely. The only reason for me to use this plugin would be to use prettier as formatter for this feature. Otherwise I would just use a relative feature in eslint and use it as formatter, because eslint doesn't have an api for Format selection and with your plugin so does prettier.
The expected behavior
Prettier has some kind of api for format selection which should be supported by the plugin.
I knew that prettier had a range
option.
However, because I didn't know about VSCode's "Format Selection" feature, I could not find an example of the range option being used when formatting on a file basis, so I didn't implement that feature in this plugin.
Now that I have seen the usage example, I will try adding range formatting functionality.