ignatov / intellij-erlang

Erlang IDE
https://www.jetbrains.com/help/idea/2018.2/getting-started-with-erlang.html
Other
732 stars 121 forks source link

Problems with record autoformatting #582

Closed istocniks closed 9 years ago

istocniks commented 9 years ago

IDEA 14.1.1, Erlang 0.5.11

Let's assume I have an empty record and my cared is placed inside it's braces: screen shot 2015-04-08 at 2 32 05 pm That's what happen if I hit enter, an extra closing brace is created: screen shot 2015-04-08 at 2 32 22 pm

Similar thing happens if the record is not empty: screen shot 2015-04-08 at 2 37 21 pm screen shot 2015-04-08 at 2 37 30 pm

My code style config: screen shot 2015-04-08 at 2 40 45 pm

deadok22 commented 9 years ago

Just so as you know - the buggy behavior was caused by an unmatched left curly brace in code above.

deadok22 commented 9 years ago

Check out the latest build: https://github.com/ignatov/intellij-erlang/releases/

istocniks commented 9 years ago

Not really sure which unmatched left curly brace you are referring to... I checked the latest build, an extra brace doesn't get created any more, thanks! But caret still doesn't get indented automatically, looks like you didn't address this bug :(

deadok22 commented 9 years ago

Please, share an example of incorrect caret indentation - I may have missed some cases.

istocniks commented 9 years ago

Thanks for the fast response! screen shot 2015-04-13 at 11 04 56 am screen shot 2015-04-13 at 11 05 03 am Here it is, the caret should be automatically indented here, but it's not.

deadok22 commented 9 years ago

Where does it go instead? What's your tab/indent/continuation indent size?

deadok22 commented 9 years ago

And also, why would you want it to go there? The formatter will add indentation for each record field assignment anyway.

istocniks commented 9 years ago

Take a look at the screenshots, it goes to the same level as the record definition itself. Here are my settings: screen shot 2015-04-13 at 11 15 48 am

deadok22 commented 9 years ago

Oh, I misread the "caret should be automatically indented here" as if the screenshot would show the correct indentation =)

Thanks!

istocniks commented 9 years ago

Thanks again for addressing this, unfortunately I found new bugs after the latest changes :(

screen shot 2015-04-16 at 1 19 55 pm screen shot 2015-04-16 at 1 20 02 pm screen shot 2015-04-16 at 1 20 19 pm screen shot 2015-04-16 at 1 20 25 pm

screen shot 2015-04-16 at 1 17 02 pm screen shot 2015-04-16 at 1 17 10 pm

screen shot 2015-04-16 at 1 27 37 pm screen shot 2015-04-16 at 1 27 48 pm

deadok22 commented 9 years ago

Could you create separate issues for these, please?

Once again, thank you very much for reporting issues. It's really unfortunate to have new bugs appearing after fixing the old ones, but we're increasing test coverage, so it'll eventually get better =)

istocniks commented 9 years ago

It's a pity that I have no time / enough knowledge to fix these my myself :) Created #594