com.intellij.psi.stubs.PsiFileStubImpl Java Examples

The following examples show how to use com.intellij.psi.stubs.PsiFileStubImpl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SubstrateRef.java    From consulo with Apache License 2.0 5 votes vote down vote up
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;
}