-
Notifications
You must be signed in to change notification settings - Fork 92
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
Make format-on-save easier for Python #2249
Comments
For R, you need to install the For Python, the core Python extension we use doesn't support format on save (see https://code.visualstudio.com/docs/python/formatting). You can use Don't disagree that this should be easier/we should bundle or help you do this. |
I wondered if there was something up with the Python extension because when I searched the settings for format on save, I was surprised that there wasn't an entry under Python that would let me choose |
Repurposing this as "Format on save" should work better out of the box for Python (as there are different issues for R as mentioned above). |
Sounds good. In case it's useful color, I've been working on a python project lately, and I've been tempted to switch back to VS Code so that I don't have to manually run |
If you download the To make it easier for users, we could have If we wanted to go further, we could just bundle all the recommended extensions, which include |
Oh nice, I was not aware that there was a separate I wouldn't complain if it were bundled with Positron. |
Positron Version: 2024.02.0 (Universal) build 1585 included a bundled version of the Black Formatter extension from the ms-python group at Microsoft under the MIT license. |
I set up the default formatter as the new Black Formatter, turned on Format on Save, and when I saved a .py file, it formatted using Black format rules. |
I seem to be struggling with this in Positron more than I did in VS Code, though maybe I did some extra setup steps there that I don't remember now. I've enabled the "Format on save" setting, but nothing ever happens in either Python or R (I haven't tried C++ in Positron yet).
I know that Python and R packages are required to do the formatting, but I would expect either that (a) when I create a virtualenv from the command pallete, it would also install
black
there if that's what's needed to do formatting, or (b) it would prompt me to install black, just as it often does (or used to at least) prompt me to install ipython for jupyter, or (c) raise some message that it couldn't format on save because I have to install some package.The text was updated successfully, but these errors were encountered: