Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode Format selection functionality doesn't work with this plugin #21

Open
Bolnus opened this issue Jan 22, 2024 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@Bolnus
Copy link

Bolnus commented Jan 22, 2024

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.

@ony3000
Copy link
Owner

ony3000 commented Jan 23, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants