5
5
6
6
package com .magento .idea .magento2plugin .project .startup ;
7
7
8
+ import kotlin .Unit ;
9
+ import kotlin .coroutines .Continuation ;
8
10
import com .intellij .openapi .project .Project ;
9
11
import com .intellij .openapi .startup .StartupActivity ;
12
+ import com .intellij .openapi .startup .ProjectActivity ;
10
13
import com .magento .idea .magento2plugin .init .ConfigurationManager ;
11
14
import com .magento .idea .magento2plugin .project .Settings ;
12
15
import com .magento .idea .magento2plugin .util .magento .MagentoBasePathUtil ;
13
16
import org .jetbrains .annotations .NotNull ;
17
+ import org .jetbrains .annotations .Nullable ;
14
18
15
- public class CheckIfMagentoPathIsValidActivity implements StartupActivity {
19
+ public class CheckIfMagentoPathIsValidActivity implements StartupActivity , ProjectActivity {
16
20
17
- @ Override
18
- public void runActivity (final @ NotNull Project project ) {
21
+ public void registerSettings (final @ NotNull Project project ) {
19
22
final Settings settings = Settings .getInstance (project );
20
23
final String path = settings .magentoPath ;
21
24
if (settings .pluginEnabled && (path == null || path .isEmpty ())) {
@@ -27,4 +30,16 @@ public void runActivity(final @NotNull Project project) {
27
30
ConfigurationManager .suggestToConfigureMagentoPath (project );
28
31
}
29
32
}
33
+
34
+ @ Override
35
+ public void runActivity (final @ NotNull Project project ) {
36
+ registerSettings (project );
37
+ }
38
+
39
+ @ Nullable
40
+ @ Override
41
+ public Object execute (@ NotNull Project project , @ NotNull Continuation <? super Unit > continuation ) {
42
+ registerSettings (project );
43
+ return null ;
44
+ }
30
45
}
0 commit comments