CIndex

Identifier:
org.eclipse.cdt.core.CIndex

Since:
4.0

Description:
This extension point groups extensions to the index functionality in CDT

Configuration Markup:

<!ELEMENT extension (ExportProjectProvider | ReadOnlyPDOMProvider | ReadOnlyIndexFragmentProvider)+>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT ExportProjectProvider EMPTY>

<!ATTLIST ExportProjectProvider

class CDATA #REQUIRED>

ExportProjectProvider

This subelement of CIndex allows contribution of alternate IExportProjectProvider implementations. These can then be referenced by fully qualified class name in the command line tool (see option -pprovider).

Invoking the application as a headless application This example ant file shows how to invoke the tool headlessly, the same approach would work from a shell or batch file.


<project name="Generate PDOM" default="generate">
 <target name="generate">
  <!-- This script shows how to invoke the default project provider (ExternalExportProjectProvider) -->
  <property name="pprovider" value="org.eclipse.cdt.core.index.export.ExternalExportProjectProvider"/>
  <property name="target" value="C:\ExportedPDOMs\acmeSDK_2_5.pdom"/> <!-- Where the output pdom is to go -->
  <property name="source" value="E:\AcmeSDK\v2.5\inc"/> <!-- e.g. the directory to source content from -->
  <property name="id" value="com.acme.mysdk.v2.5"/> <!-- the id to store in the generate pdom -->
  
  <property name="eclipse.home" value="C:\eclipse"/> <!-- e.g. The eclipse installation to use. This installation must contain CDT 4.0+ plugins -->
  
  <java classname="org.eclipse.equinox.launcher.Main">
   <classpath>
    <fileset dir="${eclipse.home}/plugins">
     <include name="*equinox.launcher*.jar"/>
    </fileset>
   </classpath>
   <arg value="-nosplash"/>
   <arg value="-exitdata"/>
   <arg value="-application"/><arg value="org.eclipse.cdt.core.GeneratePDOM"/>
   <arg value="-pprovider"/><arg value="${pprovider}"/>
   <arg value="-source"/><arg value="${source}"/>
   <arg value="-target"/><arg value="${target}"/>
   <arg value="-id"/><arg value="${id}"/>
  </java>
 </target>
</project>

Invoking the tool via an Eclipse Launch Configuration

Specify "org.eclipse.cdt.core.GeneratePDOM" as the application to launch

In the Argument tabs provide (for example) -target C:\ExportedPDOMs\acmeSDK_2_5.pdom -source E:\AcmeSDK\v2.5\inc -include E:\this.h -id com.acme.mysdk.v2.5



<!ELEMENT ReadOnlyPDOMProvider (FragmentProviderUsage)?>

<!ATTLIST ReadOnlyPDOMProvider

class CDATA #REQUIRED>

ReadOnlyPDOMProvider

This subelement of CIndex allows ISVs to contribute read-only prebuilt PDOM files to the CDT Index. The only information needed is the fully qualified class name of an implementatin of org.eclipse.cdt.core.index.IOfflinePDOMProvider. This implementation will be consulted during the eclipse session for the appropriate read-only content to make add to the logical index. The logical index is accessible via the org.eclipse.core.index.IIndex API. An example of contributing a prebuilt read-only pdom:


<CIndex>
   <ReadOnlyPDOMProvider class="com.acme.ide.index.AcmeSDKProvider"/>
</CIndex>
and the corresponding implementation

package com.acme.ide.index.sdk;
import org.eclipse.core.index.provider.IReadOnlyPDOMProvider;
import org.eclipse.core.index.provider.IPDOMDescriptor;
import org.eclipse.core.index.IIndexLocationConverter;
import org.eclipse.core.index.URIRelativeLocationConverter;
public class AcmeSDKProvider implements IReadOnlyPDOMProvider {
    public boolean providesFor(ICProject project) {
        // e.g. decide by looking for acme project nature
        return AcmeNature.isAcmeProject(project);
    }
    public IPDOMDescriptor[] getDescriptors(ICConfigurationDescription config) {
        final IPath sdkBase = AcmeSDKAPI.getSDKBase(config);
        return new IPDOMDescriptor[] { new IPDOMDescriptor() {
            public IIndexLocationConverter getIndexLocationConverter() {
                return new URIRelativeLocationConverter(URIUtil.toURI(sdkBase));
            }
            public IPath getLocation() {
                IPath path = sdkBase.append(AcmeSDKAPI.getPrebuiltPDOMFilename(config));
                return path;
            }
        }};
    }
}


<!ELEMENT ReadOnlyIndexFragmentProvider (FragmentProviderUsage)?>

<!ATTLIST ReadOnlyIndexFragmentProvider

class CDATA #REQUIRED>

ReadOnlyIndexFragmentProvider

This subelement of CIndex allows ISVs to contribute read-only index fragments to the CDT Index. This extension point imposes no limitations on how the index information is collected and stored. The index fragments may, for example, be based on data dynamically fetched from a remote server.

The only information needed for this extension point is the fully qualified name of a class implementing the org.eclipse.cdt.core.index.IIndexFragmentProvider interface. This class will be consulted during the eclipse session for the appropriate read-only content to add to the logical index. The logical index is accessible via the org.eclipse.core.index.IIndex API.



<!ELEMENT FragmentProviderUsage EMPTY>

<!ATTLIST FragmentProviderUsage

navigation      (true | false)

content_assist  (true | false)

add_import      (true | false)

call_hierarchy  (true | false)

type_hierarchy  (true | false)

include_browser (true | false)

search          (true | false)

editor          (true | false) >

Defines for which tools the fragment provider shall be used.



Examples:
See subelement documentation

API Information:
Index content provided by ISVs under this extension point will be accessible via the logical index org.eclipse.core.index.IIndex API For export functionality, see package org.eclipse.cdt.core.index.export

Supplied Implementation:
See subelement documentation


Copyright (c) 2007, 2011 Symbian Software Systems and others. This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-2.0/ SPDX-License-Identifier: EPL-2.0