-
Notifications
You must be signed in to change notification settings - Fork 36
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
[Feature Request] Support for black in Jupyter Notebooks #87
Comments
@vancromy We currently support formatting individual python cells in a notebook. Since the Language Server Protocol (v3.16) treats each cell as a document. To support the document as a whole, we will need to upgrade to LSP v3.17 which allows us to look at notebooks as a whole document. Currently there is a technical limitation because the library that we use ( |
@karthiknadig while we wait for this feature, could you elaborate on how individual cells can be formatted using the black plugin? Is it a command from the control palette? |
Apologies for the spam but I discovered the answer to my own question and thought it would help others to document it here. This can be achieved either via right-clicking on the cell and selecting "Format Cell" or by using the dedicated shortcut for that control (via the Control Palette or keyboard shortcut). |
Sorry for spam; as the other issue was closed in the favour of this one, are there any progress with leaving the semi-colon in jupyter notebooks? It keeps to be removed |
@danieltomasz |
Maybe it psf/black#4025 it relevant about dealing with notebook syntax from hydrogen |
Hello 👋,
First of all thanks for your hard work for bringing black to VSCode. My autoformatting has become so much more seamless now that I don't need to worry about having it installed in all of my envs/projects.
I was wondering whether you have looked into (apologies if this has been asked before - I did a quick scan but didn't find anything) enabling the use of black in jupyter notebooks. The isort plugin for VSCode has done this and black do mention in their docs that it can be enabled by pip installing
black[jupyter]
(https://black.readthedocs.io/en/stable/getting_started.html). Perhaps this could be a user enabled feature if it is not desired to have this by default? :)The text was updated successfully, but these errors were encountered: