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

Surround with try/catch reformats document #1572

Closed
clankill3r opened this issue Aug 11, 2020 · 5 comments · Fixed by #1631
Closed

Surround with try/catch reformats document #1572

clankill3r opened this issue Aug 11, 2020 · 5 comments · Fixed by #1631
Assignees
Labels

Comments

@clankill3r
Copy link

This behaviour is more then a year old, but it often bugs me so hard that I thought it's time for a report.
It just happened again on a really large file where I noticed it way too late.

Ok, when using try/catch the whole document gets reformatted:

before:
Screen Shot 2020-08-11 at 22 00 03

after:
Screen Shot 2020-08-11 at 22 00 13

Environment
  • Operating System: OSX
  • JDK version: OpenJDK 11
  • Visual Studio Code version: latest
  • Java extension version: latest
@fbricon
Copy link
Collaborator

fbricon commented Aug 11, 2020

Can you check if it is the same behavior in Eclipse? If yes, then that would need to be fixed in upstream JDT

@ronakg
Copy link

ronakg commented Aug 11, 2020

I can confirm this. It doesn't happen on Eclipse. Tried with Version: 2020-06 (4.16.0) Build id: 20200615-1200.

@clankill3r
Copy link
Author

clankill3r commented Aug 16, 2020 via email

@ronakg
Copy link

ronakg commented Aug 20, 2020

Any updates on this issue? I noticed that this happens for any source action in VSCode. Today I tried to automatically add getter setter for a particular field and it reformatted the whole class.

However, the source action and formatting are happening in 2 separate stages. I was able to undo the formatting and keep the source action result.

@ronakg
Copy link

ronakg commented Sep 11, 2020

Wondering if this is being looked into.

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

Successfully merging a pull request may close this issue.

5 participants