下面列出了怎么用com.intellij.psi.stubs.PsiFileStubImpl的API类实例代码及写法,或者点击链接到github查看源代码。
private PsiFile reportError(StubElement stub) {
ApplicationManager.getApplication().assertReadAccessAllowed();
String reason = ((PsiFileStubImpl<?>)stub).getInvalidationReason();
PsiInvalidElementAccessException exception = new PsiInvalidElementAccessException(myStub.getPsi(), "no psi for file stub " + stub + ", invalidation reason=" + reason, null);
if (PsiFileImpl.STUB_PSI_MISMATCH.equals(reason)) {
// we're between finding stub-psi mismatch and the next EDT spot where the file is reparsed and stub rebuilt
// see com.intellij.psi.impl.source.PsiFileImpl.rebuildStub()
// most likely it's just another highlighting thread accessing the same PSI concurrently and not yet canceled, so cancel it
throw new ProcessCanceledException(exception);
}
throw exception;
}