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

Selection formatting mode (VS Code v1.49 feature support) #1706

Closed
GriceTurrble opened this issue Sep 14, 2020 · 1 comment
Closed

Selection formatting mode (VS Code v1.49 feature support) #1706

GriceTurrble opened this issue Sep 14, 2020 · 1 comment
Labels
R: duplicate This issue or pull request already exists T: enhancement New feature or request

Comments

@GriceTurrble
Copy link

GriceTurrble commented Sep 14, 2020

Is your feature request related to a problem? Please describe. Visual Studio Code v1.49 offers a "modifications only" formatting mode, in which it will run the selected formatter only on modified lines of the file on save: https://code.visualstudio.com/updates/v1_49#_only-format-modified-text

However, Black cannot currently support selection formatting, so it is not possible to use this feature.

Describe the solution you'd like Add support for Black to format selected ranges of code within a file in support of VS Code's feature.

@GriceTurrble GriceTurrble added the T: enhancement New feature or request label Sep 14, 2020
@ichard26 ichard26 added the R: duplicate This issue or pull request already exists label Sep 16, 2020
@ichard26
Copy link
Collaborator

Duplicate of #830 or #1352 depending on what kind of solution and workflow you want. #830 wants to add a --lines CLI option that tells Black which part of the code it is allowed to touch. While #1352 just wants Black to able to process indented code (which is probably a section of a file) and not error out. Of course #830 depends on #1352, but not the otherway around.

Thanks for the suggestion anyhow!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R: duplicate This issue or pull request already exists T: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants