com.intellij.util.IncorrectOperationException: Must not modify PSI inside save listener

GitHub | hero710692586 | 7 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    GitHub comment 52#233583963

    GitHub | 7 months ago | hero710692586
    com.intellij.util.IncorrectOperationException: Must not modify PSI inside save listener

    Root Cause Analysis

    1. com.intellij.util.IncorrectOperationException

      Must not modify PSI inside save listener

      at com.intellij.pom.core.impl.PomModelImpl.runTransaction()
    2. IDEA
      DocumentCommitThread$9.process
      1. com.intellij.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:144)
      2. com.intellij.psi.impl.DocumentCommitThread$10.run(DocumentCommitThread.java:922)
      3. com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.a(CodeStyleManagerImpl.java:676)
      4. com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:121)
      5. com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.a(CodeStyleManagerImpl.java:705)
      6. com.intellij.formatting.FormatterImpl.runWithFormattingDisabled(FormatterImpl.java:889)
      7. com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:703)
      8. com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:675)
      9. com.intellij.psi.impl.DocumentCommitThread.doActualPsiChange(DocumentCommitThread.java:907)
      10. com.intellij.psi.impl.DocumentCommitThread$9.process(DocumentCommitThread.java:825)
      10 frames