You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't managed to reproduce it, but basically, after finding usages of an element, if you delete the reference in the code, then matching reference in the Find view becomes stale and I ended up with this exception:
com.intellij.psi.PsiInvalidElementAccessException: Element: class com.intellij.psi.impl.source.PsiPlainTextFileImpl #TEXT because: different providers: com.intellij.psi.SingleRootFileViewProvider{vFile=file:///Users/fbricon/Dev/projects/lemminx/foo/src/main/typescript/index.ts, vFileId=311, content=VirtualFileContent{size=239}, eventSystemEnabled=true}(79c9e275); com.intellij.psi.SingleRootFileViewProvider{vFile=file:///Users/fbricon/Dev/projects/lemminx/foo/src/main/typescript/index.ts, vFileId=311, content=VirtualFileContent{size=239}, eventSystemEnabled=true}(3df47da6)
invalidated at: see attachment; Element class com.redhat.devtools.lsp4ij.usages.LSPUsagePsiElement(Language: ANY) claims to be valid but returns invalid containing file
at com.intellij.psi.impl.smartPointers.SmartPointerManagerImpl.ensureValid(SmartPointerManagerImpl.java:114)
at com.intellij.psi.impl.smartPointers.SmartPointerManagerImpl.createSmartPsiElementPointer(SmartPointerManagerImpl.java:82)
at com.intellij.psi.impl.smartPointers.SmartPointerManagerImpl.createSmartPsiElementPointer(SmartPointerManagerImpl.java:75)
at com.intellij.psi.impl.smartPointers.SmartPointerManagerImpl.createSmartPsiElementPointer(SmartPointerManagerImpl.java:70)
at com.intellij.psi.impl.ElementBase$ElementIconRequest.<init>(ElementBase.java:164)
at com.intellij.psi.impl.ElementBase$ElementIconRequest.<init>(ElementBase.java:159)
at com.intellij.psi.impl.ElementBase.computeIcon(ElementBase.java:80)
at com.intellij.psi.impl.ElementBase.getIcon(ElementBase.java:60)
at com.intellij.psi.impl.FakePsiElement.getIcon(FakePsiElement.java:121)
at com.intellij.usages.UsageInfo2UsageAdapter.computeIcon(UsageInfo2UsageAdapter.java:555)
at com.intellij.usages.UsageInfo2UsageAdapter.doUpdateCachedPresentation(UsageInfo2UsageAdapter.java:484)
at com.intellij.usages.UsageInfo2UsageAdapter.updateCachedPresentation(UsageInfo2UsageAdapter.java:476)
at com.intellij.usages.impl.UsageNode.updateCachedPresentation(UsageNode.java:74)
at com.intellij.usages.impl.Node.update(Node.java:98)
at com.intellij.usages.impl.UsageViewImpl.lambda$queueUpdateBulk$37(UsageViewImpl.java:1522)
I believe the problem is LSPPsiElement.isValid() always returns true.
When deleting a java reference for instance, the usage should show as INVALID
When the exception isn't thrown, I see the element in the find view is just updated to a blank line or the code replacing the deleted reference.
Feb-20-2024.12-00-24.mp4
The text was updated successfully, but these errors were encountered:
I haven't managed to reproduce it, but basically, after finding usages of an element, if you delete the reference in the code, then matching reference in the Find view becomes stale and I ended up with this exception:
I believe the problem is
LSPPsiElement.isValid()
always returns true.When deleting a java reference for instance, the usage should show as INVALID
When the exception isn't thrown, I see the element in the find view is just updated to a blank line or the code replacing the deleted reference.
Feb-20-2024.12-00-24.mp4
The text was updated successfully, but these errors were encountered: