Skip to content

Auto Format Not Working(Most of the Time) #548

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

Closed
ISSac25E opened this issue Oct 13, 2021 · 4 comments
Closed

Auto Format Not Working(Most of the Time) #548

ISSac25E opened this issue Oct 13, 2021 · 4 comments
Assignees
Labels
conclusion: duplicate Has already been submitted topic: code Related to content of the project itself topic: language server Related to the Arduino Language Server type: imperfection Perceived defect in any part of project

Comments

@ISSac25E
Copy link

Auto Format does not work and when it does work, it does so under some weird conditions. I tried both with the shortcut and menu tool and both don't work or at least not properly. Anytime when I am coding 99% of the time I could never get it to work. The only time I got it to work "somewhat" reliably was when I opened a blank sketch and even then under very specific circumstances. (btw, I tested this with 2.0.0-beta.12 using .exe .msi and .zip on both Win 10 and Win 7, Exact same effect on all, I have yet to try on Mac)

The only way I got Auto format to work is if you have a blank sketch with only the void setup and loop. If you put a space in front of void loop() like this:
image
If you hit CTRL + t or click the button from the menu (after it finishes building the sketch of course) you will see it will format and shift the void loop back where it belongs and it will do so quite reliably every single time I found:
image
However, if you try to do this with the setup() like this:
image
It will not work no matter how much you try, even if you try to do this to both(loop and setup) It just simply stops working at this point:
image
This is by far the weirdest behavior I found with the Auto Format tool. All the other times Auto Format would simply not work at all.
Anyway, I just wanted to bring this to attention and thought this might be some useful clue that might help out in figuring out what is really going on

I actually got the auto format to somehow randomly delete some line of code while doing the test but so far I did not find a way to replicate this.

Desktop (please complete the following information):

  • OS: Windows 7, Windows 10
  • Version: Arduino IDE 2.0.0-beta.12
@ISSac25E ISSac25E added the type: imperfection Perceived defect in any part of project label Oct 13, 2021
@ISSac25E ISSac25E changed the title Auto Format Not Working(Most of the Time Auto Format Not Working(Most of the Time) Oct 13, 2021
@per1234
Copy link
Contributor

per1234 commented Oct 13, 2021

Hi @ISSac25E. Thanks for taking the time to submit an issue.

I see we already have a prior issue report about this at #396.

It's best to have only a single issue per subject so we can consolidate all relevant discussion to one place, so I'll go ahead and close this in favor of the other.

If you end up with additional information to share, feel free to comment in the other thread.

I actually got the auto format to somehow randomly delete some line of code while doing the test but so far I did not find a way to replicate this.

I submitted a bug report for that here: #543
It does occur intermittently, but I am able to reproduce it frequently via the instructions in that issue.

@per1234 per1234 closed this as completed Oct 13, 2021
@per1234 per1234 added conclusion: duplicate Has already been submitted topic: code Related to content of the project itself topic: language server Related to the Arduino Language Server labels Oct 13, 2021
@ISSac25E
Copy link
Author

ISSac25E commented Oct 13, 2021

@per1234 So sorry about that, First time using GitHub. I go right over and post this issue in the comments if it will help

@ISSac25E
Copy link
Author

@per1234 I am just wondering will it be a problem if the comment will turn out long in #396?

@per1234
Copy link
Contributor

per1234 commented Oct 13, 2021

No worries. This issue has been linked to the other one now, will will make the information you shared here accessible to interested parties, including the IDE developers during the course of their investigation. But you are welcome to comment there with any additional information you feel will be useful. Thanks!

@per1234 per1234 self-assigned this Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: duplicate Has already been submitted topic: code Related to content of the project itself topic: language server Related to the Arduino Language Server type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants