Beispiel #1
0
  /**
   * Trigger addition of the entire content of a project Note: the actual operation is performed in
   * background
   */
  public void indexAll(IProject project) {
    if (RubyCore.getPlugin() == null) return;

    // Also request indexing of binaries on the classpath
    // determine the new children
    try {
      RubyModel model = RubyModelManager.getRubyModelManager().getRubyModel();
      RubyProject javaProject = (RubyProject) model.getRubyProject(project);
      // only consider immediate libraries - each project will do the same
      // NOTE: force to resolve CP variables before calling indexer - 19303, so that initializers
      // will be run in the current thread.
      ILoadpathEntry[] entries =
          javaProject.getResolvedLoadpath(
              true /* ignoreUnresolvedEntry */, false /* don't generateMarkerOnError */, false /*
																													 * don't
																													 * returnResolutionInProgress
																													 */);
      for (int i = 0; i < entries.length; i++) {
        ILoadpathEntry entry = entries[i];
        if (entry.getEntryKind() == ILoadpathEntry.CPE_LIBRARY)
          this.indexLibrary(entry.getPath(), project);
      }
    } catch (RubyModelException e) { // cannot retrieve classpath info
    }

    // check if the same request is not already in the queue
    IndexRequest request = new IndexAllProject(project, this);
    if (!isJobWaiting(request)) this.request(request);
  }