Java 类com.intellij.util.PsiErrorElementUtil 实例源码

项目:intellij-ce-playground    文件:DelayedDocumentWatcher.java   
private void asyncCheckErrors(@NotNull final Collection<VirtualFile> files,
                              @NotNull final Consumer<Boolean> errorsFoundConsumer) {
  ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
    @Override
    public void run() {
      final boolean errorsFound = ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
        @Override
        public Boolean compute() {
          for (VirtualFile file : files) {
            if (PsiErrorElementUtil.hasErrors(myProject, file)) {
              return true;
            }
          }
          return false;
        }
      });
      ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override
        public void run() {
          errorsFoundConsumer.consume(errorsFound);
        }
      }, ModalityState.any());
    }
  });
}
项目:consulo    文件:DelayedDocumentWatcher.java   
private void asyncCheckErrors(@Nonnull final Collection<VirtualFile> files,
                              @Nonnull final Consumer<Boolean> errorsFoundConsumer) {
  ApplicationManager.getApplication().executeOnPooledThread(() -> {
    final boolean errorsFound = ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
      @Override
      public Boolean compute() {
        for (VirtualFile file : files) {
          if (PsiErrorElementUtil.hasErrors(myProject, file)) {
            return true;
          }
        }
        return false;
      }
    });
    ApplicationManager.getApplication().invokeLater(() -> errorsFoundConsumer.consume(errorsFound), ModalityState.any());
  });
}
项目:intellij-plugin-save-actions    文件:SaveActionManager.java   
private boolean isPsiFileHasErrors(Project project, PsiFile psiFile) {
    if (getStorage(project).isEnabled(noActionIfCompileErrors)) {
        return !PsiErrorElementUtil.hasErrors(project, psiFile.getVirtualFile());
    }
    return true;
}