20
20
import org .eclipse .core .runtime .IStatus ;
21
21
import org .eclipse .core .runtime .Status ;
22
22
23
+ import io .sloeber .core .Activator ;
23
24
import io .sloeber .core .InternalBoardDescriptor ;
24
25
import io .sloeber .core .api .BoardDescriptor ;
25
26
import io .sloeber .core .common .Common ;
@@ -34,29 +35,33 @@ public void handleEvent(CProjectDescriptionEvent event) {
34
35
if (event .getEventType () != CProjectDescriptionEvent .ABOUT_TO_APPLY ) {
35
36
return ;
36
37
}
37
- ICProjectDescription projDesc = event . getNewCProjectDescription ();
38
-
38
+
39
+ IProject activeProject = event . getProject ();
39
40
// only handle arduino nature projects
40
41
try {
41
- if (!event . getProject () .hasNature (Const .ARDUINO_NATURE_ID )) {
42
+ if (!activeProject .hasNature (Const .ARDUINO_NATURE_ID )) {
42
43
return ;
43
44
}
44
45
} catch (Exception e ) {
45
46
// don't care don't update
46
47
return ;
47
48
}
48
-
49
+ if (IndexerController .isPosponed (activeProject )) {
50
+ Common .log (new Status (Const .SLOEBER_STATUS_DEBUG , Activator .getId (),"Ignoring configuration change during project creation " +activeProject .getName ()));
51
+ return ;
52
+ }
53
+ ICProjectDescription projDesc = event .getNewCProjectDescription ();
49
54
ICProjectDescription oldprojDesc = event .getOldCProjectDescription ();
50
55
ICConfigurationDescription activeConf = projDesc .getActiveConfiguration ();
51
- IProject activeProject = projDesc . getProject ();
56
+
52
57
53
58
InternalBoardDescriptor oldBoardDescriptor = (InternalBoardDescriptor ) BoardDescriptor
54
59
.makeBoardDescriptor (oldprojDesc .getActiveConfiguration ());
55
60
InternalBoardDescriptor newBoardDescriptor = (InternalBoardDescriptor ) BoardDescriptor
56
61
.makeBoardDescriptor (activeConf );
57
62
58
63
if (oldBoardDescriptor .equals (newBoardDescriptor )) {
59
- if (event . getProject () .getName ().equals (oldBoardDescriptor .getProjectName ())) {
64
+ if (activeProject .getName ().equals (oldBoardDescriptor .getProjectName ())) {
60
65
if (oldprojDesc .getActiveConfiguration ().getName ().equals (projDesc .getActiveConfiguration ().getName ())) {
61
66
// only act when there is change
62
67
return ;
0 commit comments