private static void assertThreading(@NotNull PsiFile file) {
    if (!ApplicationManager.getApplication().isWriteAccessAllowed() && !isNonPhysicalOrInjected(file)) {
      LOG.error("Threading assertion. " + getThreadingDiagnostics(file));
    }
  }
private static void assertThreading(@NotNull PsiFile file)