Skip to content

Bug: Jupyter Notebook trim whitespaces not working in code cells #181905

Closed

Description

Does this issue occur when all extensions are disabled?: Yes
Note: All extensions disabled - except python and jupyter notebook

The function to trim whitespaces does not work in jupyter notebook code cells

  • VS Code Version: 1.78.0 (252e546) - x64
  • OS Version: Win 11 Pro

Steps to Reproduce:

  1. Create a new Jupyter Notebook (.ipynb) file
  2. Create a cell and put some code with tailing whitespaces and empty lines in it

Example:
image

Activity

  1. changed the title [-]Jupyter Notebook trim whitespaces not working in code cells[/-] [+]Bug: Jupyter Notebook trim whitespaces not working in code cells[/+] on May 9, 2023
  2. added
    feature-request
    notebook-cell-editor
    on May 9, 2023
  3. added this to the May 2023 milestone on May 9, 2023
  4. rebornix commented on Jun 9, 2023

    @rebornix
    Contributor

    It seems I can't reproduce in latest VS Code

    Screen.Recording.2023-06-09.at.11.37.10.AM.mov

    Henrik Gerdes (@hegerdes) can you please check if you can reproduce with all extensions disabled and also check if there is modified editor.trimAutoWhitespace setting in user setting or workspace.

  5. added
    ~info-needed
    and removed
    feature-request
    on Jun 9, 2023
  6. vscodenpa commented on Jun 9, 2023

    @vscodenpa

    Thanks for creating this issue! We figured it's missing some basic information or in some other way doesn't follow our issue reporting guidelines. Please take the time to review these and update the issue.

    Happy Coding!

  7. added
    info-needed
    and removed
    ~info-needed
    on Jun 9, 2023
  8. hegerdes commented on Jun 11, 2023

    @hegerdes
    Author

    Peng Lyu (@rebornix) Thanks for your reply. I noticed that there was an update for VSCode formatting for notebooks, but it did not fix my issue. Thanks to your reply I also noticed that there are different trim settings: editor.trimAutoWhitespace and files.trimTrailingWhitespace. Both are set to true on my side. All extensions disabled.

    What does not seem to work is the trimTrailingWhitespace part. Whitespaces on the end of the line and empty lines with whitespaces are not cleared. I created a short video for demonstration. See line 7,9 and 13.

    Unbenanntes.Video.mp4

    I hope that helps differentiating the problem

  9. added
    feature-request
    and removed
    info-needed
    on Jun 28, 2023
  10. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Sep 18, 2023
  11. locked and limited conversation to collaborators on Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestinsiders-releasednotebook-cell-editoron-testplan

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions