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

Notebook saving doesn't trim code cell whitespace when files.trimTrailingWhitespace setting is true #151982

Closed
1 of 2 tasks
2-5 opened this issue Jun 12, 2022 · 6 comments
Closed
1 of 2 tasks
Assignees
Labels
feature-request Request for new features or functionality notebook notebook-cell-editor Bugs related to code editors in Notebooks (not intellisense / LS's)

Comments

@2-5
Copy link

2-5 commented Jun 12, 2022

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

When I save a Jupyter notebook which has trailing whitespace in it's code cells, I expect it to be trimmed if files.trimTrailingWhitespace is true

VS Code Version

Version: 1.68.0 (user setup) Commit: 4af164e Date: 2022-06-08T11:44:16.822Z Electron: 17.4.7 Chromium: 98.0.4758.141 Node.js: 16.13.0 V8: 9.8.177.13-electron.0 OS: Windows_NT x64 10.0.19044

Jupyter Extension Version

v2022.5.1001601848

Jupyter logs

No response

Coding Language and Runtime Version

No response

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

No response

@2-5 2-5 added bug Issue identified by VS Code Team member as probable bug triage-needed labels Jun 12, 2022
@rchiodo rchiodo removed bug Issue identified by VS Code Team member as probable bug triage-needed labels Jun 13, 2022
@rchiodo
Copy link
Contributor

rchiodo commented Jun 13, 2022

VS code handles file serialization but not sure if 'file.TrimTrailingWhiteSpace' would apply to individual cells? Maybe a new setting?

@rchiodo rchiodo transferred this issue from microsoft/vscode-jupyter Jun 13, 2022
@rchiodo rchiodo added notebook notebook-cell-editor Bugs related to code editors in Notebooks (not intellisense / LS's) notebook-serialization labels Jun 13, 2022
@2-5
Copy link
Author

2-5 commented Jun 14, 2022

I don't think a new setting is needed for this scenario.

If you look at the screenshot, from the user point of view it seems to me that the highlighted trailing spaces should be removed when the notebook is saved if files.trimTrailingWhitespace is true.

I'm not sure why notebooks should ignore that setting, even if the saving mechanics are more complicated. The notebook respects most other settings and it's one of the stated goals to make the notebook experience as similar to regular editing.

2022-06-14_152840

@yuankailiu
Copy link

That is not working the same for me. While saving the notebook cells, the whitespace is still there. Below are my settings about trimming.

image

@rebornix rebornix added the feature-request Request for new features or functionality label Jun 27, 2022
@vscodenpa vscodenpa added this to the Backlog Candidates milestone Jun 27, 2022
@vscodenpa
Copy link

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodenpa
Copy link

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodenpa
Copy link

🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Aug 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality notebook notebook-cell-editor Bugs related to code editors in Notebooks (not intellisense / LS's)
Projects
None yet
Development

No branches or pull requests

7 participants