Closed dnbln closed 4 years ago
Did you give up on this? If you want help I can take a closer look.
Rather than gave up I moved it to the formatter
branch(maybe open another PR; I couldn't figure how to change the branch). The only thing I couldn't get right were the alignments, and I'd be happy with any help I can get on them.
There seems to be a weird bug where after every element it thinks there should be 2 blocks of indentation. For example, for this lalrpop file:
Pressing enter if the caret is there would just work and creates and moves the caret to the beginning of the new line. While if the caret is here, in a file like this:
Pressing enter there would also move the caret 2 blocks forward(2 tabs / 8 spaces):
Same thing happens within all kinds of blocks, like
Press enter.
The caret should be at the position marked with
1
, but intellij puts it at3
.However, writing the alternative at the
3
position like:And then formatting, will yield a file properly formatted, like this:
And I can't seem to figure out why this happens.
Edit: After looking at some examples it seems I am building the blocks wrong. Will fix soon:tm: