Skip to content

Commit message#127849

Merged
jrieken merged 1 commit intomicrosoft:mainfrom
kilbouri:main
Jul 14, 2021
Merged

Commit message#127849
jrieken merged 1 commit intomicrosoft:mainfrom
kilbouri:main

Conversation

@kilbouri
Copy link
Contributor

@kilbouri kilbouri commented Jul 2, 2021

This PR fixes #127838

Adds "modificationsIfAvailable" option to editor.formatOnSave. Editor will try to use modifications, and if source control is unavailable then it will format the entire file instead.

Not really sure how to test tbh, it just kinda works

I can't really test my code because I'm having issues getting a formatter to install inside the dev build (or really any extension, seeing as `yarn install` just wants a different version of node from the one I have) but the code changes are simple and should be non-breaking. Build completes with no errors and the setting appears so I'm making the assumption everything works correctly. All I changed were a few if statements and return values.
@ghost
Copy link

ghost commented Jul 2, 2021

CLA assistant check
All CLA requirements met.

@jrieken jrieken self-assigned this Jul 2, 2021
@jrieken jrieken added this to the July 2021 milestone Jul 2, 2021
Copy link
Member

@jrieken jrieken left a comment

Choose a reason for hiding this comment

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

Not a super-fan of the name modificationsIfAvailable but we can brainstrom about that later... Otherwise, changes are look

@jrieken jrieken merged commit c3144e0 into microsoft:main Jul 14, 2021
@jrieken
Copy link
Member

jrieken commented Jul 14, 2021

Thanks

@kilbouri
Copy link
Contributor Author

kilbouri commented Jul 14, 2021

Not a super-fan of the name modificationsIfAvailable but we can brainstrom about that later... Otherwise, changes are look

Yea I'm not a huge fan of it either. I was trying to find a blend of keeping it short and making it clear, though I did add a much longer form explanation in the tooptip about it.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Modifications if VCS is available, otherwise use File for Format on Save

2 participants