File tree 1 file changed +10
-0
lines changed
src/com/magento/idea/magento2plugin/util/magento
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 18
18
19
19
public final class GetModuleNameByDirectoryUtil {
20
20
21
+ public static final int THEME_SPLIT_COUNT = 1 ;
22
+ public static final String THEME_DIRECTORY_REGEX = "app\\ /design\\ /(adminhtml|frontend)\\ /" ;
23
+
21
24
private GetModuleNameByDirectoryUtil () {}
22
25
23
26
/**
@@ -31,6 +34,13 @@ public static String execute(
31
34
final PsiDirectory psiDirectory ,
32
35
final Project project
33
36
) {
37
+ // Check if directory is theme directory and return module name from directory path if yes
38
+ final String [] splits = psiDirectory .getVirtualFile ().getPath ()
39
+ .split (THEME_DIRECTORY_REGEX );
40
+ if (splits .length > THEME_SPLIT_COUNT ) {
41
+ return splits [1 ].split ("\\ /" )[2 ];
42
+ }
43
+
34
44
final PhpFile registrationPhp = getRegistrationPhpRecursively (
35
45
psiDirectory ,
36
46
project
You can’t perform that action at this time.
0 commit comments