Skip to content

Commit 1fda336

Browse files
committed
add app/design path
1 parent 4bce544 commit 1fda336

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

src/main/java/com/magento/idea/magento2plugin/magento/packages/Package.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
public class Package { //NOPMD
99
public static final String V_FILE_SEPARATOR = "/";
1010
public static String packagesRoot = "app/code";
11+
public static String packagesDesignRoot = "app/design";
1112
public static String libWebRoot = "lib/web";
1213
public static String frameworkRootComposer = "vendor/magento/framework";
1314
public static String frameworkRootGit = "lib/internal/Magento/Framework";

src/main/java/com/magento/idea/magento2plugin/util/magento/IsFileInEditableModuleUtil.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,12 @@ public static boolean execute(final Project project, final VirtualFile virtualFi
3939
final Settings settings = Settings.getInstance(project);
4040
List<String> magentoToFolders = settings.getMagentoFolders();
4141
final String magentoPathUrl = MagentoPathUrlUtil.execute(project);
42+
final String magentoDesignUrl = MagentoPathUrlUtil.getDesignPath(project);
4243
if (magentoPathUrl != null) {
4344
if (magentoToFolders == null) {
4445
magentoToFolders = List.of(
45-
magentoPathUrl
46+
magentoPathUrl,
47+
magentoDesignUrl
4648
);
4749
} else {
4850
magentoToFolders.add(

src/main/java/com/magento/idea/magento2plugin/util/magento/MagentoPathUrlUtil.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,24 @@ public static String execute(Project project) {
3131

3232
return null;
3333
}
34+
35+
/**
36+
* Constructs a file URL for the Magento packages root, based on the project settings.
37+
*
38+
* @param project the project instance
39+
* @return the constructed file URL
40+
*/
41+
public static String getDesignPath(Project project) {
42+
String magentoPath = Settings.getMagentoPath(project);
43+
if (magentoPath != null) {
44+
return VirtualFileManager.constructUrl(
45+
"file",
46+
magentoPath
47+
+ File.separator
48+
+ Package.packagesDesignRoot
49+
);
50+
}
51+
52+
return null;
53+
}
3454
}

0 commit comments

Comments
 (0)