joeyjiron06 / intellij-auto-align

A code formatter intellij plugin
0 stars 2 forks source link

Reformatting break C++ code #9

Closed GauthierPLM closed 8 years ago

GauthierPLM commented 8 years ago

Reformatting C++ code create invalid code, because of "::" operator (used to indicate parent of a function/variable). The plugin should detect the file type and don't reformat on "::" in C++ files.

Original code: correct-code

Reformated code: reformated-code

joeyjiron06 commented 8 years ago

HI Kendos, good catch and thanks for filing this issue. Another edge case to figure out, shouldnt be hard to fix. Working on it today and will hopefully put out a fix either later today or tomorrow.

joeyjiron06 commented 8 years ago

just pushed out a release with the fix. please let me know if it works as expected.

GauthierPLM commented 8 years ago

Yep it works well ! Just have a question : is it normal that the align is for the entire file and not local to the function ? Sometimes it looks strange when there is only a variable asignement in the function, and it is aligned with another 20 lines above.

joeyjiron06 commented 8 years ago

sweet closing this issue! yup thats normal as of now. i would like to get to the project to a place where i can be smart about auto aligning based on scopes. it's just a matter of learning the jetbrains api a little better. The way i usually handle aligning just a function is by highlighting the whole function then using auto-aligner.