Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When creating the preview in AsciiDocAddBlockIdToSection: Must not change PSI outside command or undo-transparent action. #1577

Closed
sentry-io bot opened this issue Mar 23, 2024 · 1 comment
Assignees

Comments

@sentry-io
Copy link

sentry-io bot commented Mar 23, 2024

Sentry Issue: ASCIIDOC-INTELLIJ-PLUGIN-6F5

com.intellij.util.IncorrectOperationException: Must not change PSI outside command or undo-transparent action. See com.intellij.openapi.command.WriteCommandAction or com.intellij.openapi.command.CommandProcessor
    at com.intellij.pom.core.impl.PomModelImpl.startTransaction(PomModelImpl.java:266)
    at com.intellij.pom.core.impl.PomModelImpl.lambda$runTransaction$2(PomModelImpl.java:95)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$2(CoreProgressManager.java:228)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:685)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:641)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$3(CoreProgressManager.java:236)
    at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:57)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:236)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:227)
    at com.intellij.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:92)
    at com.intellij.psi.impl.source.tree.ChangeUtil.prepareAndRunChangeAction(ChangeUtil.java:141)
    at com.intellij.psi.impl.source.tree.CompositeElement.addChild(CompositeElement.java:586)
    at com.intellij.psi.impl.source.tree.CompositeElement.addChildren(CompositeElement.java:680)
    at com.intellij.psi.impl.source.codeStyle.CodeEditUtil.addChildren(CodeEditUtil.java:53)
    at com.intellij.extapi.psi.ASTDelegatePsiElement.addInternal(ASTDelegatePsiElement.java:286)
    at com.intellij.extapi.psi.ASTDelegatePsiElement.addInnerBefore(ASTDelegatePsiElement.java:259)
    at com.intellij.extapi.psi.ASTDelegatePsiElement.addBefore(ASTDelegatePsiElement.java:253)
    at org.asciidoc.intellij.quickfix.AsciiDocAddBlockIdToSection.applyFix(AsciiDocAddBlockIdToSection.java:94)
    at org.asciidoc.intellij.quickfix.AsciiDocAddBlockIdToSection.applyFix(AsciiDocAddBlockIdToSection.java:25)
    at com.intellij.codeInspection.LocalQuickFix.generatePreview(LocalQuickFix.java:81)
    at org.asciidoc.intellij.quickfix.AsciiDocAddBlockIdToSection.generatePreview(AsciiDocAddBlockIdToSection.java:56)
    at com.intellij.codeInspection.ex.QuickFixWrapper.generatePreview(QuickFixWrapper.java:191)
    at com.intellij.codeInsight.intention.impl.IntentionActionWithTextCaching$MyIntentionAction.generatePreview(IntentionActionWithTextCaching.java:254)
    at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable$invokePreview$1$1$1.invoke(IntentionPreviewComputable.kt:122)
    at com.intellij.codeInsight.intention.impl.preview.IntentionPreviewComputable$invokePreview$1$1$1.invoke(IntentionPreviewComputable.kt:121)

...
(63 additional frame(s) were not displayed)
@ahus1
Copy link
Contributor

ahus1 commented Mar 23, 2024

Fixed in next release. Instead of trying create the preview automatically first, create it manually all the time to prevent the exception.

@ahus1 ahus1 closed this as completed Mar 23, 2024
ahus1 added a commit that referenced this issue Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant