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

fix "editor.formatOnSaveMode": "modifications" #2447

Merged
merged 4 commits into from
Mar 29, 2022

Conversation

rotu
Copy link
Contributor

@rotu rotu commented Mar 2, 2022

fix #630
fix #1562
fix #1677
fix #2295
fix #2330

  • Run tests
  • Update the CHANGELOG.md with a summary of your changes

@rotu
Copy link
Contributor Author

rotu commented Mar 9, 2022

@ntotten could you review this? It’s a significant QoL improvement.

@ntotten
Copy link
Member

ntotten commented Mar 25, 2022

This looks great, can you add some tests though and then I will get it merged.

@rotu
Copy link
Contributor Author

rotu commented Mar 26, 2022

I didn't add a test that actually relies on an SCM, but I did add one for formatting multiple ranges, which should test the same code paths.

In the process, I also discovered a bug in Prettier: prettier/prettier#12540

@ntotten
Copy link
Member

ntotten commented Mar 28, 2022

Awesome. Thanks!

@rotu
Copy link
Contributor Author

rotu commented Mar 28, 2022

D'oh! I committed some junk which caused the test to break. Could you try that again please?

@ntotten ntotten merged commit be790ca into prettier:main Mar 29, 2022
@rotu rotu deleted the formatmodifications branch March 29, 2022 04:08
@nickqi-tubi
Copy link

nickqi-tubi commented May 5, 2022

That's great improvement. However, I tested the latest v9.5.0, it seems only formatting the modified lines doesn't work.. I'm using the latest VS Code, which is version 1.66.2. Can you double check for that?

@rotu
Copy link
Contributor Author

rotu commented May 5, 2022

@nickqi-tubi what's the file type?

@nickqi-tubi
Copy link

Hi @rotu , the file type is .ts

@rotu
Copy link
Contributor Author

rotu commented May 6, 2022

Hi @rotu , the file type is .ts

Well, that wrecks my main theory. Maybe you could see if you can reproduce the issue in the prettier web playground? https://prettier.io/playground/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants