Skip to content

monaco: command Save All now formats all open editors#8551

Merged
paul-marechal merged 1 commit intoeclipse-theia:masterfrom
DucNgn:dn/SaveAllFormatsAllOpeningEditors
Sep 28, 2020
Merged

monaco: command Save All now formats all open editors#8551
paul-marechal merged 1 commit intoeclipse-theia:masterfrom
DucNgn:dn/SaveAllFormatsAllOpeningEditors

Conversation

@DucNgn
Copy link
Contributor

@DucNgn DucNgn commented Sep 23, 2020

What it does

Fixes #8547

How to test

  • Make sure formatOnSave is on
  • Opening more than 1 dirty file and in a wrong format/convention
  • Run Save All from the command palette or from a shortcut
  • Expected behavior: All the opening editors are formatted and saved.

Review checklist

Reminder for reviewers

Signed-off-by: Duc Nguyen duc.a.nguyen@ericsson.com

Signed-off-by: Duc Nguyen <duc.a.nguyen@ericsson.com>
@vince-fugnitto vince-fugnitto added the editor issues related to the editor label Sep 23, 2020
@vince-fugnitto vince-fugnitto changed the title Command Save All now formats all opening editors monaco: command Save All now formats all open editors Sep 23, 2020
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes work very well with the example provided in the comment.
Now when we perform the save all we format all open documents and not only the currently active one (similarly to vscode).

Copy link
Member

@paul-marechal paul-marechal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, this way ensures the command is ran directly on the editor and avoids the indirection through this commandService property.

@paul-marechal paul-marechal merged commit 8cfbd17 into eclipse-theia:master Sep 28, 2020
@DucNgn DucNgn deleted the dn/SaveAllFormatsAllOpeningEditors branch September 28, 2020 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editor issues related to the editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Command Save All does not format all dirty editors before saving

3 participants