ASTNode indent

I generated a LightVirtualFile version of a file and then tried to copy its ASTNodes to other files (of the same file type/language: Groovy), but it's giving some assertion error regarding indents. I tried to use ASTNode#putCopyableUserData to try to add indent info, but it didn't seem to work.

Basically I would like to know how to make it not give annoying error popups from the assertion failures (it's ruining the UI experience).

This is on platform version "2017.1.2".

PostprocessReformattingAspect - Assertion failed: for not generated items old indentation must be defined

java.lang.Throwable
    at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:170)
    at com.intellij.psi.impl.source.PostprocessReformattingAspect.postponeFormatting(PostprocessReformattingAspect.java:277)
    at com.intellij.psi.impl.source.PostprocessReformattingAspect.access$900(PostprocessReformattingAspect.java:62)
    at com.intellij.psi.impl.source.PostprocessReformattingAspect$3.run(PostprocessReformattingAspect.java:191)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:556)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:204)
    at com.intellij.psi.impl.source.PostprocessReformattingAspect.atomic(PostprocessReformattingAspect.java:166)
    at com.intellij.psi.impl.source.PostprocessReformattingAspect.update(PostprocessReformattingAspect.java:171)
    at com.intellij.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:186)
    at com.intellij.psi.impl.source.tree.ChangeUtil.prepareAndRunChangeAction(ChangeUtil.java:167)
    at com.intellij.psi.impl.source.tree.CompositeElement.replaceChild(CompositeElement.java:695)

 

Please sign in to leave a comment.