1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

Replace refreshScannerInfo with setActive method

- remove the refreshScannerInfo method from ICBuildConfiguration2
  but add it as a protected method of CBuildConfiguration
- edit MesonBuildConfiguration and CBuildConfiguratio appropriately
- add new setActive method to CBuildConfiguration which calls
  refreshScannerInfo

Change-Id: Iebae09507f24293007a299eea3069451e566a91b
This commit is contained in:
Jeff Johnston 2018-03-20 15:54:15 -04:00
parent ca4d434b06
commit 3e60faaa6c
3 changed files with 18 additions and 9 deletions

View file

@ -1023,7 +1023,19 @@ public abstract class CBuildConfiguration extends PlatformObject
* @since 6.5
*/
@Override
public void refreshScannerInfo() throws CoreException {
public void setActive() {
try {
refreshScannerInfo();
} catch (CoreException e) {
// do nothing
}
}
/**
* @since 6.5
* @throws CoreException
*/
protected void refreshScannerInfo() throws CoreException {
// do nothing by default
}

View file

@ -10,16 +10,14 @@
*******************************************************************************/
package org.eclipse.cdt.core.build;
import org.eclipse.core.runtime.CoreException;
/**
* @since 6.5
*/
public interface ICBuildConfiguration2 {
/**
* Refresh the Scanner info
* Mark the Build Configuration as active
*/
void refreshScannerInfo() throws CoreException;
void setActive();
}

View file

@ -115,8 +115,7 @@ public class CoreBuildLaunchBarTracker implements ILaunchBarListener {
}
if (buildConfig == null) {
for (IToolChain tc : tcs) {
IToolChain toolChain = tcs.iterator().next();
for (IToolChain toolChain : tcs) {
buildConfig = configManager.getBuildConfiguration(finalProject, toolChain,
mode.getIdentifier(), monitor);
if (buildConfig != null) {
@ -131,8 +130,8 @@ public class CoreBuildLaunchBarTracker implements ILaunchBarListener {
IProjectDescription desc = finalProject.getDescription();
desc.setActiveBuildConfig(buildConfig.getBuildConfiguration().getName());
finalProject.setDescription(desc, monitor);
// build config has changed so Scanner Info may change too which would affect indexing
((ICBuildConfiguration2)buildConfig).refreshScannerInfo();
// notify the active build config that it is active
((ICBuildConfiguration2)buildConfig).setActive();
}
}