コード例 #1
0
  private void doUpdateOnRefresh() {
    if (ApplicationManager.getApplication().isUnitTestMode()
        && (!myStartupActivityPerformed || myProject.isDisposed())) {
      return; // in test mode suppress addition to a queue unless project is properly initialized
    }
    if (myProject.isDefault()) {
      return;
    }

    if (myDoLogCachesUpdate) LOG.info("refresh");
    DumbServiceImpl dumbService = DumbServiceImpl.getInstance(myProject);
    DumbModeTask task = FileBasedIndexProjectHandler.createChangedFilesIndexingTask(myProject);
    if (task != null) {
      dumbService.queueTask(task);
    }

    if (myRefreshCacheUpdaters.size() == 0) {
      return;
    }

    if (ourScheduleCacheUpdateInDumbMode) {
      dumbService.queueCacheUpdateInDumbMode(myRefreshCacheUpdaters);
    } else {
      dumbService.queueCacheUpdate(myRefreshCacheUpdaters);
    }
  }
コード例 #2
0
  @Override
  protected void doSynchronizeRoots() {
    if (!myStartupActivityPerformed) return;

    if (myDoLogCachesUpdate) LOG.info(new Throwable("sync roots"));

    DumbServiceImpl dumbService = DumbServiceImpl.getInstance(myProject);
    dumbService.queueTask(new UnindexedFilesUpdater(myProject, false));

    if (myRootsChangeUpdaters.isEmpty()) return;

    if (ourScheduleCacheUpdateInDumbMode) {
      dumbService.queueCacheUpdateInDumbMode(myRootsChangeUpdaters);
    } else {
      dumbService.queueCacheUpdate(myRootsChangeUpdaters);
    }
  }