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

Stub mismatch exceptions #390

Closed
giraud opened this issue Dec 2, 2022 · 1 comment
Closed

Stub mismatch exceptions #390

giraud opened this issue Dec 2, 2022 · 1 comment
Assignees

Comments

@giraud
Copy link
Owner

giraud commented Dec 2, 2022

plugin version: 0.108

Description

many stub exceptions are producing an equivalent stack trace:

Error during processing of: AttributeDetails__Story.re

com.intellij.psi.stubs.UpToDateStubIndexMismatch: PSI and index do not match.
Please report the problem to JetBrains with the files attached
INDEXED VERSION IS THE CURRENT ONE file=ThresholdLevelValidation.re, file.class=class com.reason.ide.files.RmlFile, file.lang=Language: Reason, modStamp=1
 tree consistent
 stub debugInfo=created in getStubTree(), with AST = false; with backReference
latestIndexedStub=StubTree{myDebugInfo='created from index; with backReference', myRoot=RmlFileStub}853625161
   same size=true
   debugInfo=created from index; with backReference
 viewProvider=com.intellij.psi.SingleRootFileViewProvider{vFile=file://C:/dev/src/di-branch/helium/com.systar.helium.html/src/main/javascript/radon/configuration/attributes/ThresholdLevelValidation.re, vFileId=68034, content=VirtualFileContent{size=2387}, eventSystemEnabled=true}
 viewProvider stamp: 0; file stamp: 0; file modCount: 1661759889816; file length: 2387
 doc saved: true; doc stamp: 0; doc size: 2319; committed: true
indexing info: indexing timestamp = 1661759889816, binary = false, byte size = 2387, char size = 2319
	at com.intellij.psi.stubs.StubTreeLoader.handleUpToDateMismatch(StubTreeLoader.java:136)
	at com.intellij.psi.stubs.StubTreeLoader.lambda$stubTreeAndIndexDoNotMatch$0(StubTreeLoader.java:130)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:238)
	at com.intellij.psi.stubs.StubTreeLoader.stubTreeAndIndexDoNotMatch(StubTreeLoader.java:65)
	at com.intellij.psi.impl.source.FileTrees.reconcilePsi(FileTrees.java:193)
	at com.intellij.psi.impl.source.FileTrees.withAst(FileTrees.java:141)
	at com.intellij.psi.impl.source.PsiFileImpl.loadTreeElement(PsiFileImpl.java:215)
	at com.intellij.psi.impl.source.PsiFileImpl.calcTreeElement(PsiFileImpl.java:734)
	at com.intellij.psi.impl.source.PsiFileImpl.getNode(PsiFileImpl.java:937)
	at com.intellij.psi.impl.source.PsiFileImpl.getNode(PsiFileImpl.java:51)
	at com.reason.lang.core.ORUtil.prevSibling(ORUtil.java:52)
	at com.reason.ide.search.PsiFinder.findModuleBack(PsiFinder.java:54)
	at com.reason.lang.core.psi.impl.RPsiIncludeImpl.getResolvedPath(RPsiIncludeImpl.java:70)

I think that it comes from the fact that PsiInclude or PsiOpen are trying to resolve a path and store it in a stub.
from idea forum:

Some causes we've seen include:

leaf/composite PSI mismatch (thanks Vladimir for pointing that out!)
LightStubBuilder not working in the same way as the normal one would (by building stubs by AST)
errors in incremental parsing (e.g. IReparseableElementType#isParsable incorrectly returning true on broken code, when full reparse would produce a different result)
asymmetric stub serialization/deserialization code
lexer/parser/AST/PSI/stubs depending on something more than the file's content: other file, project settings, etc

Maybe the last point is the culprit.
Need to remove the stub for path. it’ll be computed each time and not cached anymore.
problem is that the indexing is used in the resolver ! :(

@giraud giraud self-assigned this Dec 2, 2022
giraud added a commit that referenced this issue Dec 4, 2022
giraud added a commit that referenced this issue Dec 4, 2022
giraud added a commit that referenced this issue Dec 5, 2022
giraud added a commit that referenced this issue Dec 5, 2022
@giraud
Copy link
Owner Author

giraud commented Dec 5, 2022

fixed in 0.109

@giraud giraud closed this as completed Dec 5, 2022
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