1 comment
Comment actions Permalink

ok here is a solution:

in FormattingModelBuilder:
FormattingModel createModel(PsiElement, CodeStyleSettings)
returns  FormattingModelImpl (your own minimum implementation)

FormattingModel implementation:
inits you implementation of Block,
returns your own minimum implementation of FormattingDocumentModel


in Block implementation:

public Spacing getSpacing(Block child1, Block child2) {
    make rules (if - then) depending on child1, child2 IElementTypes etc

     return Spacing.createSpacing(minSpace, maxSpace, minLineBreaks, true, 2);
}

you can space, indent, add / remove lines etc.

0

Please sign in to leave a comment.