getChildAttributes not called in PsiErrorElement condition

I'm trying to implement proper indenting when Enter is pressed using FormattingModelBuilder and AbstractBlock.  The issue I'm running into is when hitting enter at the end of an "if" statement that is incomplete, getChildAttributes is not called, so I have no way to return the proper indent for.

function myFunc()
{
    if ( condition )<- Enter here...
<- ...always end up here without calling getChildAttributes
}

function myFunc()
{
    if ( condition )<- Enter here...
        <- ends up here as expected because the statement below caused made the if statement "composite"
    otherStatement = true
}


I've investigated why this is, and it seems the formatting processor doesn't treat the if statement block wrapper as a "CompositeBlockWrapper" in this case... I'm assuming because it only contains the "if ( condtion )" as it's sole non-whitespace element.  Is there a known way to handle this?

Please sign in to leave a comment.