Codium-ai / codiumai-jetbrains-release

59 stars 8 forks source link

[Exception][PyCharm 2023.2] com.intellij.psi.PsiInvalidElementAccessException: Element class com.intellij.psi.impl.so... #81

Closed sevi78 closed 1 year ago

sevi78 commented 1 year ago

User Description

User did not enter any detailed information.

Stack Trace

com.intellij.psi.PsiInvalidElementAccessException: Element class com.intellij.psi.impl.source.tree.CompositeElement of type Py:FUNCTION_DECLARATION (class com.jetbrains.python.psi.impl.stubs.PyFunctionElementType)
    at com.intellij.psi.PsiInvalidElementAccessException.createByNode(PsiInvalidElementAccessException.java:80)
    at com.intellij.psi.impl.source.SubstrateRef$2.getContainingFile(SubstrateRef.java:74)
    at com.intellij.extapi.psi.StubBasedPsiElementBase.getContainingFile(StubBasedPsiElementBase.java:235)
    at com.intellij.extapi.psi.StubBasedPsiElementBase.isPhysical(StubBasedPsiElementBase.java:276)
    at com.intellij.psi.util.PsiTreeUtil.processElements(PsiTreeUtil.java:915)
    at com.intellij.psi.util.PsiTreeUtil.findChildOfType(PsiTreeUtil.java:232)
    at com.intellij.psi.util.PsiTreeUtil.findChildOfType(PsiTreeUtil.java:198)
    at ai.codium.elements.CutElement.findErrorChild(CutElement.kt:52)
    at ai.codium.language.LanguageService.filterElementsForErrors(LanguageService.kt:58)
    at ai.codium.language.LanguageService.getSupportedElementsForClass(LanguageService.kt:39)
    at ai.codium.ui.structureview.CodiumStructureViewChildElement.getChildren(CodiumStructureViewChildElement.kt:44)
    at ai.codium.ui.structureview.CodiumStructureViewChildElement.getChildren(CodiumStructureViewChildElement.kt:26)
    at com.intellij.ide.util.treeView.smartTree.TreeElementWrapper.initChildren(TreeElementWrapper.java:35)
    at com.intellij.ide.util.treeView.smartTree.CachingChildrenTreeNode.rebuildSubtree(CachingChildrenTreeNode.java:207)
    at com.intellij.ide.util.treeView.smartTree.CachingChildrenTreeNode.ensureChildrenAreInitialized(CachingChildrenTreeNode.java:41)
    at com.intellij.ide.util.treeView.smartTree.CachingChildrenTreeNode.getChildren(CachingChildrenTreeNode.java:33)
    at com.intellij.ide.structureView.newStructureView.StructureViewComponent$MyNodeWrapper.getChildren(StructureViewComponent.java:841)
    at com.intellij.ide.util.treeView.smartTree.SmartTreeStructure.getChildElements(SmartTreeStructure.java:62)
    at com.intellij.ui.tree.StructureTreeModel.getValidChildren(StructureTreeModel.java:411)
    at com.intellij.ui.tree.StructureTreeModel.validateChildren(StructureTreeModel.java:329)
    at com.intellij.ui.tree.StructureTreeModel$Node.isModelLeaf(StructureTreeModel.java:584)
    at com.intellij.ui.tree.StructureTreeModel.isLeaf(StructureTreeModel.java:365)
    at com.intellij.ui.tree.LeafState.get(LeafState.java:62)
    at com.intellij.ui.tree.AsyncTreeModel$CmdGetChildren.getNode(AsyncTreeModel.java:564)
    at com.intellij.ui.tree.AsyncTreeModel$Command.get(AsyncTreeModel.java:464)
    at com.intellij.ui.tree.AsyncTreeModel$Command.get(AsyncTreeModel.java:430)
    at com.intellij.util.concurrency.Invoker$Task.run(Invoker.java:306)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(Applic

<TRIMMED STACKTRACE>

14)
    at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:71)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
    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.executeProcessUnderProgress(CoreProgressManager.java:603)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
    at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:71)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:111)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:76)
    at com.intellij.util.concurrency.Invoker.invokeSafely(Invoker.java:188)
    at com.intellij.util.concurrency.Invoker.lambda$offerSafely$0(Invoker.java:165)
    at com.intellij.util.concurrency.Invoker$Background.lambda$offer$0(Invoker.java:433)
    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.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:272)
    at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:249)
    at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:31)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:227)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:218)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:215)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
    at java.base/java.lang.Thread.run(Thread.java:833)

Other Information

=== About ===
Build version: PyCharm 2023.2 Build: #PC-232.8660.197 July 26, 2023
Theme: Dark
JRE: 17.0.7+7-b1000.6, JetBrains s.r.o.
JVM: 17.0.7+7-b1000.6, OpenJDK 64-Bit Server VM, JetBrains s.r.o.
Operating System: Windows 10.0 (amd64)

=== Plugins ===
Custom plugins: [JSON Visualizer (1.0.0), CodiumAI - Meaningful tests powered by TestGPT-1 and GPT-3.5&4 (0.5.27)]
Disabled plugins:[One Dark theme (5.8.0), ChatGPT Tool (1.1.1), Nord (0.13.0), Gradianto (5.3), Material Theme UI Lite (22.0.0), Monocai Color Theme (2.0.2c), GitHub Copilot (1.2.18.2908), Dark Purple Theme (1.3), Monokai Pro Theme (1.10), WarmNeon Color Scheme (232.8660.197), Solarized Theme (3.0.0), CodeGeeX (1.1.6), Mongo DB Browser (2023.1.1)]

┆Issue is synchronized with this Trello card by Unito

aldanchenko commented 1 year ago

Hi @sevi78

Thanks for reporting! We are working on fixing this issue.

Could you please share a source code example of what caused this error?

Best regards, Alex

ArtsiomCh commented 1 year ago

Seems like we fixed it in latest versions, please feel free to report if experience it again!