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

Each automatic "on save" formatting preference appears to push a new entry onto the undo stack #90100

Closed
jscheel opened this issue Feb 5, 2020 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug formatting Source formatter issues verified Verification succeeded
Milestone

Comments

@jscheel
Copy link

jscheel commented Feb 5, 2020

  • VSCode Version: 1.41.1
  • OS Version: macOS 10.15.2

Steps to Reproduce:

  1. Enable trim trailing whitespace
  2. Enable add trailing new line
  3. Enable format on save
  4. Type code into file that triggers each bit of formatting (add some whitespace at end, no newline, etc)
  5. Save
  6. Have to hit undo multiple times to get back to the last user-initiated change

Does this issue occur when all extensions are disabled?: Yes (Also on insiders)

I know there has been plenty of discussion about this in the past, but if feels like this changed again recently. Now I have to undo multiple times to get back to my last interaction. After testing enabling and disabling certain formatting features, it seems like each change is pushing a new entry onto the stack, instead of "do all on save formatting" being a single entry in the undo stack.

@bpasero bpasero assigned jrieken and alexdima and unassigned bpasero Feb 6, 2020
@jrieken jrieken added this to the February 2020 milestone Feb 6, 2020
@jrieken jrieken added bug Issue identified by VS Code Team member as probable bug formatting Source formatter issues labels Feb 6, 2020
@alexdima alexdima removed their assignment Feb 6, 2020
@jrieken
Copy link
Member

jrieken commented Feb 6, 2020

This is fixed for trimming whitespace and formatting but not for code actions or the onWillSaveTextDocument-api because the latter two use the WorkspaceEdit-api which can make changes across multiple files. Anyways, I believe the concern is addressed and I am taking the freedom to close this with that

@jrieken jrieken closed this as completed Feb 6, 2020
@jscheel
Copy link
Author

jscheel commented Feb 6, 2020

@jrieken awesome, thanks for looking into this!

@connor4312 connor4312 added the verified Verification succeeded label Feb 27, 2020
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug formatting Source formatter issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants