Search code examples
eclipseconfigurationfavorites

Where does Eclipse store the information regarding "Run Favorites" or "Debug Favorites"?


Where does Eclipse store the information regarding "Run Favorites" or "Debug Favorites"?


Solution

  • These are stored in the file launchConfigurationHistory.xml in the workspace .metadata/.plugins/org.eclipse.debug.ui directory.

    The file contains various launch related settings, favorites are in the <favorites> sections.

    Note: It is probably not safe to modify this file while Eclipse is running.

    Update:

    The launch configuration file itself name.launch in the .metadata/.plugins/org.eclipse.debug.core/.launches directory is also updated to say which favorites group it is in.

    Update:

    If a xxx.launch file is in a favorites group it contains something like:

    <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
    <listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
    </listAttribute>
    

    (along with lots of other launch related entries)

    Update:

    You can look at the launch configurations in a plugin using:

    ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); 
    
    ILaunchConfiguration [] configs = manager.getLaunchConfigurations();
    

    The IDebugUIConstants.ATTR_FAVORITE_GROUPS attribute of the ILaunchConfiguration should contain any favorites groups the launch is in.