LinWanCen / show-comment

IDEA插件:在文件树、行末、JSON、COBOL 显示注释
https://plugins.jetbrains.com/plugin/18553-show-comment
Mozilla Public License 2.0
87 stars 12 forks source link

IntelliJ IDEA 2023.2.5内部错误 #50

Closed 1808002418 closed 8 months ago

1808002418 commented 11 months ago

wasIndexedAlready=true, queried at 1700646376504 doc length=1859 file length=2446 cached PSI class com.intellij.psi.impl.source.PsiJavaFileImpl PSI length=1859 projects with file: 3 physical file exists; length = 2446

java.lang.Exception at com.intellij.psi.stubs.StubTreeLoaderImpl.diagnoseLengthMismatch(StubTreeLoaderImpl.java:189) at com.intellij.psi.stubs.StubTreeLoaderImpl.checkLengthMatch(StubTreeLoaderImpl.java:155) at com.intellij.psi.stubs.StubTreeLoaderImpl.readFromVFile(StubTreeLoaderImpl.java:122) at com.intellij.psi.stubs.StubTreeLoader$StubTreeAndIndexUnmatchCoarseException.doCreateCompleteException(StubTreeLoader.java:184) at com.intellij.psi.stubs.StubTreeLoader$StubTreeAndIndexUnmatchCoarseException.access$300(StubTreeLoader.java:145) at com.intellij.psi.stubs.StubTreeLoader.lambda$stubTreeAndIndexDoNotMatch$0(StubTreeLoader.java:68) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:628) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:230) at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:60) at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:230) at com.intellij.psi.stubs.StubTreeLoader.stubTreeAndIndexDoNotMatch(StubTreeLoader.java:67) at com.intellij.psi.stubs.StubProcessingHelperBase.inconsistencyDetected(StubProcessingHelperBase.java:164) at com.intellij.psi.stubs.StubProcessingHelperBase.checkType(StubProcessingHelperBase.java:99) at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:72) at com.intellij.psi.stubs.StubIndexEx.lambda$processElements$4(StubIndexEx.java:150) at com.intellij.psi.stubs.StubIndexEx.processElements(StubIndexEx.java:214) at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:102) at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:90) at com.intellij.psi.impl.java.stubs.index.JavaFullClassNameIndex.get(JavaFullClassNameIndex.java:34) at com.intellij.psi.impl.file.impl.JavaFileManagerImpl.doFindClasses(JavaFileManagerImpl.java:81) at com.intellij.psi.impl.file.impl.JavaFileManagerImpl.findClass(JavaFileManagerImpl.java:104) at com.intellij.psi.impl.PsiElementFinderImpl.findClass(PsiElementFinderImpl.java:40) at com.intellij.psi.impl.JavaPsiFacadeImpl.doFindClass(JavaPsiFacadeImpl.java:94) at com.intellij.psi.impl.JavaPsiFacadeImpl.findClass(JavaPsiFacadeImpl.java:72) at com.intellij.psi.util.PsiSuperMethodUtil.correctClassByScope(PsiSuperMethodUtil.java:124) at com.intellij.psi.impl.TypeCorrector.correctType(TypeCorrector.java:43) at com.intellij.psi.impl.PsiClassImplUtil.correctType(PsiClassImplUtil.java:678) at com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl$TypeEvaluator.fun(PsiReferenceExpressionImpl.java:400) at com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl$TypeEvaluator.fun(PsiReferenceExpressionImpl.java:354) at com.intellij.psi.impl.source.resolve.JavaResolveCache.lambda$getType$0(JavaResolveCache.java:57) at com.intellij.psi.util.CachedValuesManager.lambda$getProjectPsiDependentCache$0(CachedValuesManager.java:134) at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:158) at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:37) at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:240) at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:43) at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:240) at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:110) at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:27) at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:65) at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:241) at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:27) at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:69) at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:155) at com.intellij.psi.util.CachedValuesManager.getProjectPsiDependentCache(CachedValuesManager.java:132) at com.intellij.psi.impl.source.resolve.JavaResolveCache.getType(JavaResolveCache.java:57) at com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl.getType(PsiReferenceExpressionImpl.java:414) at com.intellij.psi.scope.util.PsiScopesUtil.setupAndRunProcessor(PsiScopesUtil.java:306) at com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl.resolveToMethod(PsiReferenceExpressionImpl.java:296) at com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl.resolve(PsiReferenceExpressionImpl.java:275) at com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl.access$000(PsiReferenceExpressionImpl.java:44) at com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl$OurGenericsResolver.resolve(PsiReferenceExpressionImpl.java:182) at com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl$OurGenericsResolver.resolve(PsiReferenceExpressionImpl.java:172) at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$resolveWithCaching$2(ResolveCache.java:174) at com.intellij.openapi.util.Computable.get(Computable.java:16) at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$loggingResolver$4(ResolveCache.java:234) at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:110) at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:27) at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:65) at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:212) at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:174) at com.intellij.psi.impl.PsiImplUtil.multiResolveImpl(PsiImplUtil.java:846) at com.intellij.psi.impl.PsiImplUtil.multiResolveImpl(PsiImplUtil.java:838) at com.intellij.psi.impl.PsiImplUtil.multiResolveImpl(PsiImplUtil.java:814) at com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl.multiResolve(PsiReferenceExpressionImpl.java:338) at com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl.advancedResolve(PsiReferenceExpressionImpl.java:491) at com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl.resolve(PsiReferenceExpressionImpl.java:798) at io.github.linwancen.plugin.show.lang.base.BaseLangDoc.refDoc(BaseLangDoc.java:148) at io.github.linwancen.plugin.show.java.JavaLangDoc.refDoc(JavaLangDoc.java:68) at io.github.linwancen.plugin.show.lang.base.BaseLangDoc.refElementDoc(BaseLangDoc.java:128) at io.github.linwancen.plugin.show.lang.base.BaseLangDoc.findRefDoc(BaseLangDoc.java:93) at io.github.linwancen.plugin.show.lang.base.BaseLangDoc.langDoc(BaseLangDoc.java:55) at io.github.linwancen.plugin.show.LineEnd.lineDoc(LineEnd.java:109) at io.github.linwancen.plugin.show.LineEnd.lineDocSkipHave(LineEnd.java:89) at io.github.linwancen.plugin.show.LineEnd.getLineExtensionInfos(LineEnd.java:54) at io.github.linwancen.plugin.show.LineEnd.getLineExtensions(LineEnd.java:33) at com.intellij.openapi.editor.impl.EditorImpl.processLineExtensions(EditorImpl.java:797) at com.intellij.openapi.editor.impl.view.EditorSizeManager.validateMaxLineWithExtension(EditorSizeManager.java:388) at com.intellij.openapi.editor.impl.view.EditorSizeManager.getTextPreferredWidth(EditorSizeManager.java:366) at com.intellij.openapi.editor.impl.view.EditorSizeManager.getPreferredSize(EditorSizeManager.java:269) at com.intellij.openapi.editor.impl.view.EditorView.getPreferredSize(EditorView.java:292) at com.intellij.openapi.editor.impl.EditorImpl.lambda$getPreferredSize$27(EditorImpl.java:2218) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:923) at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:76) at com.intellij.openapi.editor.impl.EditorImpl.getPreferredSize(EditorImpl.java:2214) at com.intellij.openapi.editor.impl.EditorImpl.validateSize(EditorImpl.java:1834) at com.intellij.openapi.editor.impl.EditorImpl.changedUpdate(EditorImpl.java:1744) at com.intellij.openapi.editor.impl.EditorImpl$EditorDocumentAdapter.documentChanged(EditorImpl.java:5137) at com.intellij.openapi.editor.impl.DocumentImpl.lambda$changedUpdate$1(DocumentImpl.java:913) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:222) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:628) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:230) at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:60) 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.changedUpdate(DocumentImpl.java:910) at com.intellij.openapi.editor.impl.DocumentImpl.updateText(DocumentImpl.java:814) at com.intellij.openapi.editor.impl.DocumentImpl.replaceString(DocumentImpl.java:654) at com.intellij.openapi.editor.impl.DocumentImpl.replaceString(DocumentImpl.java:591) at com.intellij.psi.impl.PsiToDocumentSynchronizer.doCommitTransaction(PsiToDocumentSynchronizer.java:212) at com.intellij.psi.impl.PsiToDocumentSynchronizer.lambda$commitTransaction$1(PsiToDocumentSynchronizer.java:188) at com.intellij.psi.impl.PsiToDocumentSynchronizer.lambda$doSync$0(PsiToDocumentSynchronizer.java:106) at com.intellij.psi.impl.PsiToDocumentSynchronizer.performAtomically(PsiToDocumentSynchronizer.java:124) at com.intellij.psi.impl.PsiToDocumentSynchronizer.doSync(PsiToDocumentSynchronizer.java:106) at com.intellij.psi.impl.PsiToDocumentSynchronizer.commitTransaction(PsiToDocumentSynchronizer.java:188) at com.intellij.pom.core.impl.PomModelImpl.commitTransaction(PomModelImpl.java:196) at com.intellij.pom.core.impl.PomModelImpl.lambda$runTransaction$1(PomModelImpl.java:152) at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:503) at com.intellij.pom.core.impl.PomModelImpl.lambda$runTransaction$2(PomModelImpl.java:104) 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.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:93) at com.intellij.psi.impl.source.tree.ChangeUtil.prepareAndRunChangeAction(ChangeUtil.java:141) at com.intellij.psi.impl.source.tree.CompositeElement.replaceChild(CompositeElement.java:615) at com.intellij.psi.impl.source.codeStyle.CodeEditUtil.replaceChild(CodeEditUtil.java:162) at com.intellij.psi.impl.source.tree.CompositeElement.replaceChildInternal(CompositeElement.java:446) at com.intellij.psi.impl.source.tree.java.JavaFileElement.replaceChildInternal(JavaFileElement.java:97) at com.intellij.psi.impl.source.tree.SharedImplUtil.doReplace(SharedImplUtil.java:194) at com.intellij.psi.impl.source.JavaStubPsiElement.replace(JavaStubPsiElement.java:108) at com.intellij.lang.java.JavaImportOptimizer$1.run(JavaImportOptimizer.java:55) at com.intellij.codeInsight.actions.OptimizeImportsProcessor.lambda$prepareTask$0(OptimizeImportsProcessor.java:95) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at com.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ProcessingTask.lambda$performFileProcessing$7(AbstractLayoutCodeProcessor.java:478) 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.intellij.codeInsight.actions.AbstractLayoutCodeProcessor$ProcessingTask.lambda$performFileProcessing$8(AbstractLayoutCodeProcessor.java:478) at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:208) at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21) at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:190) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:861) at com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:478) at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:100) at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:79) at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:121) at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739) at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:690) at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$10(IdeEventQueue.kt:593) at com.intellij.openapi.application.impl.ApplicationImpl.runWithoutImplicitRead(ApplicationImpl.java:1485) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:593) 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:997) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105) at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:997) 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)

LinWanCen commented 11 months ago

解析方法从 2021.3 开始就偶尔会有一些奇怪的报错,我一直都 try 掉了,JetBrains 可能是直接打堆栈来避免被 try 掉。

重置索引即可。

https://github.com/LinWanCen/show-comment/blob/bced7c48058cd949c4d8f227aacfb3f17bb7a646/src/main/java/io/github/linwancen/plugin/show/lang/base/BaseLangDoc.java#L145-L153