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

google-java-format 可能导致 idea 报错? #105

Open
Saoforest opened this issue Aug 10, 2023 · 3 comments
Open

google-java-format 可能导致 idea 报错? #105

Saoforest opened this issue Aug 10, 2023 · 3 comments

Comments

@Saoforest
Copy link

java.lang.RuntimeException: Document is locked by write PSI operations. Use PsiDocumentManager.doPostponedOperationsAndUnblockDocument() to commit PSI changes to the document. Unprocessed elements: DOC_COMMENT(374,461) at com.intellij.psi.impl.source.PostprocessReformattingAspectImpl.assertDocumentChangeIsAllowed(PostprocessReformattingAspectImpl.java:334) at com.intellij.psi.impl.PsiDocumentManagerImpl.beforeDocumentChangeOnUnlockedDocument(PsiDocumentManagerImpl.java:126) at com.intellij.psi.impl.PsiDocumentManagerBase.beforeDocumentChange(PsiDocumentManagerBase.java:906) at jdk.internal.reflect.GeneratedMethodAccessor427.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at com.intellij.util.EventDispatcher.dispatchVoidMethod(EventDispatcher.java:118) at com.intellij.util.EventDispatcher.lambda$createMulticaster$1(EventDispatcher.java:83) at jdk.proxy1/jdk.proxy1.$Proxy104.beforeDocumentChange(Unknown Source) at com.intellij.openapi.editor.impl.DocumentImpl.lambda$beforeChangedUpdate$0(DocumentImpl.java:872) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:222) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:230) at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:64) at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:230) at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:221) at com.intellij.openapi.editor.impl.DocumentImpl.beforeChangedUpdate(DocumentImpl.java:869) at com.intellij.openapi.editor.impl.DocumentImpl.updateText(DocumentImpl.java:808) at com.intellij.openapi.editor.impl.DocumentImpl.deleteString(DocumentImpl.java:570) at com.intellij.openapi.editor.impl.DocumentImpl$2.lambda$run$0(DocumentImpl.java:356) at com.intellij.util.DocumentUtil.executeInBulk(DocumentUtil.java:27) at com.intellij.openapi.editor.impl.DocumentImpl$2.run(DocumentImpl.java:351) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:992) at com.intellij.util.DocumentUtil.lambda$writeInRunUndoTransparentAction$0(DocumentUtil.java:47) at com.intellij.openapi.command.impl.CoreCommandProcessor.runUndoTransparentAction(CoreCommandProcessor.java:368) at com.intellij.util.DocumentUtil.writeInRunUndoTransparentAction(DocumentUtil.java:47) at com.intellij.openapi.editor.impl.DocumentImpl.stripTrailingSpaces(DocumentImpl.java:348) at com.intellij.openapi.editor.impl.TrailingSpacesStripper.strip(TrailingSpacesStripper.java:219) at com.intellij.openapi.editor.impl.TrailingSpacesStripper.strip(TrailingSpacesStripper.java:59) at com.intellij.openapi.editor.impl.TrailingSpacesStripper.beforeDocumentSaving(TrailingSpacesStripper.java:51) at jdk.internal.reflect.GeneratedMethodAccessor1560.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.multiCast(FileDocumentManagerImpl.java:197) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$new$0(FileDocumentManagerImpl.java:132) at jdk.proxy1/jdk.proxy1.$Proxy25.beforeDocumentSaving(Unknown Source) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$doSaveDocumentInWriteAction$3(FileDocumentManagerImpl.java:425) at com.intellij.pom.core.impl.PomModelImpl.guardPsiModificationsIn(PomModelImpl.java:322) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.doSaveDocumentInWriteAction(FileDocumentManagerImpl.java:424) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$doSaveDocument$2(FileDocumentManagerImpl.java:377) at com.intellij.openapi.application.WriteAction.lambda$run$1(WriteAction.java:87) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:980) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1006) at com.intellij.openapi.application.WriteAction.run(WriteAction.java:86) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.doSaveDocument(FileDocumentManagerImpl.java:377) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveDocument(FileDocumentManagerImpl.java:326) at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveDocument(FileDocumentManagerImpl.java:315) at com.intellij.formatting.service.AsyncDocumentFormattingService$FormattingRequestImpl.<init>(AsyncDocumentFormattingService.java:175) at com.intellij.formatting.service.AsyncDocumentFormattingService.formatDocument(AsyncDocumentFormattingService.java:75) at com.intellij.formatting.service.AbstractDocumentFormattingService.formatRanges(AbstractDocumentFormattingService.java:67) at com.intellij.formatting.service.FormattingServiceUtil.formatRanges(FormattingServiceUtil.java:98) at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.reformatText(CodeStyleManagerImpl.java:147) at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.reformatText(CodeStyleManagerImpl.java:112) at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.reformatText(CodeStyleManagerImpl.java:105) at com.star.easydoc.service.WriterService.lambda$writeJavadoc$0(WriterService.java:49) at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.lambda$doRunWriteCommandAction$1(WriteCommandAction.java:149) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:992) at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.lambda$doRunWriteCommandAction$2(WriteCommandAction.java:147) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:219) at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:184) at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.doRunWriteCommandAction(WriteCommandAction.java:156) at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.run(WriteCommandAction.java:123) at com.star.easydoc.service.WriterService.writeJavadoc(WriterService.java:28) at com.star.easydoc.action.GenerateJavadocAction.javadocProcess(GenerateJavadocAction.java:142) at com.star.easydoc.action.GenerateJavadocAction.actionPerformed(GenerateJavadocAction.java:106) at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:339) at com.intellij.openapi.keymap.impl.ActionProcessor.performAction(ActionProcessor.java:47) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$myActionProcessor$1.performAction(IdeKeyEventDispatcher.kt:502) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$5$lambda$4(IdeKeyEventDispatcher.kt:865) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105) at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner$lambda$5(IdeKeyEventDispatcher.kt:865) at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:362) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.doPerformActionInner(IdeKeyEventDispatcher.kt:863) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcherKt.access$doPerformActionInner(IdeKeyEventDispatcher.kt:1) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction$intellij_platform_ide_impl(IdeKeyEventDispatcher.kt:587) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.kt:513) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.kt:454) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.kt:447) at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.kt:309) at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.kt:617) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:587) at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:67) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:369) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:368) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:368) at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:363) at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:992) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:113) at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:992) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:363) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:405) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

@starcwang
Copy link
Owner

看起来像是插件冲突?卸载掉这个插件好使不?如果真有冲突的话,我得研究一下。

@Saoforest
Copy link
Author

看起来像是插件冲突?卸载掉这个插件好使不?如果真有冲突的话,我得研究一下。

我尝试禁用了 google-java-format 后就正常了

@starcwang
Copy link
Owner

那估计是插件冲突了,我研究一下

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

2 participants