private static ObjectStubTree<?> processError(final VirtualFile vFile, String message, @Nullable Exception e) {
    LOG.error(message, e);

    AppUIExecutor.onWriteThread(ModalityState.nonModal()).later().submit(() -> {
      final Document doc = FileDocumentManager.getInstance().getCachedDocument(vFile);
      if (doc != null) {
        FileDocumentManager.getInstance().saveDocument(doc);
      }

      // avoid deadlock by requesting reindex later.
      // processError may be invoked under stub index's read action and requestReindex in EDT starts dumb mode in writeAction (IDEA-197296)
      FileBasedIndex.getInstance().requestReindex(vFile);
    });

    return null;
  }
private static ObjectStubTree<?> processError(final VirtualFile vFile, String message, @Nullable Exception e)