Right align first non whitespace column in custom language FormattingModelBuilder

Hi,

I’m trying to get the Intellij Formatter to allow the first non white space column/token/Block in a given set of lines to be right aligned.

The Anchor.RIGHT flag for Alignment.createAlignment appears to do nothing if you apply it to the first block in a line.

I’ve also tried adding an empty “dummy” block before the first non whitespace block and while it does get it to right align the first column, it also adds an indented newline for each one.

Is this possible at all with the current Intellij Formatter?

I’m currently developing against IDEA 2024.3.1.1, but can update if absolutely needed.