1
1
package it .baeyens .arduino .tools ;
2
2
3
+ import it .baeyens .arduino .ui .BuildConfigurationsPage .ConfigurationDescriptor ;
4
+
5
+ import java .util .ArrayList ;
6
+
3
7
import org .eclipse .cdt .core .language .settings .providers .ILanguageSettingsProvidersKeeper ;
4
8
import org .eclipse .cdt .core .model .CoreModel ;
5
9
import org .eclipse .cdt .core .settings .model .ICConfigurationDescription ;
13
17
import org .eclipse .cdt .managedbuilder .internal .core .ManagedBuildInfo ;
14
18
import org .eclipse .cdt .managedbuilder .internal .core .ManagedProject ;
15
19
import org .eclipse .cdt .managedbuilder .internal .core .ToolChain ;
20
+ import org .eclipse .cdt .managedbuilder .internal .dataprovider .ConfigurationDataProvider ;
16
21
import org .eclipse .core .resources .IProject ;
17
22
import org .eclipse .core .runtime .CoreException ;
18
23
import org .eclipse .core .runtime .IProgressMonitor ;
19
24
20
- import it .baeyens .arduino .ui .BuildConfigurationsPage .ConfigurationDescriptor ;
21
-
22
- import java .util .ArrayList ;
23
-
24
25
@ SuppressWarnings ("restriction" )
25
26
// TOFIX Get this code in CDT so I should not have to do this
26
27
public class ShouldHaveBeenInCDT {
@@ -45,9 +46,8 @@ public class ShouldHaveBeenInCDT {
45
46
* The monitor to follow the process
46
47
* @throws CoreException
47
48
*/
48
- public static void setCProjectDescription (IProject project ,
49
- ArrayList <ConfigurationDescriptor > alCfgs ,
50
- boolean isManagedBuild , IProgressMonitor monitor ) throws CoreException {
49
+ public static void setCProjectDescription (IProject project , ArrayList <ConfigurationDescriptor > alCfgs , boolean isManagedBuild ,
50
+ IProgressMonitor monitor ) throws CoreException {
51
51
52
52
ICProjectDescriptionManager mngr = CoreModel .getDefault ().getProjectDescriptionManager ();
53
53
ICProjectDescription des = mngr .createProjectDescription (project , false , false );
@@ -83,7 +83,8 @@ public static void setCProjectDescription(IProject project,
83
83
for (int i = 0 ; i < alCfgs .size (); i ++) {
84
84
IToolChain tcs = ManagedBuildManager .getExtensionToolChain (alCfgs .get (i ).ToolchainID );
85
85
86
- Configuration cfg = new Configuration (mProj , (ToolChain ) tcs , ManagedBuildManager .calculateChildId (alCfgs .get (i ).ToolchainID , null ), alCfgs .get (i ).Name );
86
+ Configuration cfg = new Configuration (mProj , (ToolChain ) tcs , ManagedBuildManager .calculateChildId (alCfgs .get (i ).ToolchainID , null ),
87
+ alCfgs .get (i ).Name );
87
88
IBuilder bld = cfg .getEditableBuilder ();
88
89
if (bld != null ) {
89
90
// if (bld.isInternalBuilder()) {
@@ -101,12 +102,13 @@ public static void setCProjectDescription(IProject project,
101
102
}
102
103
CConfigurationData data = cfg .getConfigurationData ();
103
104
ICConfigurationDescription cfgDes = des .createConfiguration (ManagedBuildManager .CFG_DATA_PROVIDER_ID , data );
104
-
105
+
105
106
if (cfgDes instanceof ILanguageSettingsProvidersKeeper ) {
106
- ILanguageSettingsProvidersKeeper lspk = (ILanguageSettingsProvidersKeeper )cfgDes ;
107
- lspk .setDefaultLanguageSettingsProvidersIds (new String [] {alCfgs .get (i ).ToolchainID });
107
+ ILanguageSettingsProvidersKeeper lspk = (ILanguageSettingsProvidersKeeper ) cfgDes ;
108
+ lspk .setDefaultLanguageSettingsProvidersIds (new String [] { alCfgs .get (i ).ToolchainID });
108
109
}
109
- // ConfigurationDataProvider.setDefaultLanguageSettingsProviders(project, cfg, cfgDes);
110
+ // without this line the indexer doesn't work properly in juno
111
+ ConfigurationDataProvider .setDefaultLanguageSettingsProviders (project , cfg , cfgDes );
110
112
}
111
113
monitor .worked (50 );
112
114
mngr .setProjectDescription (project , des );
0 commit comments