diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f3dd4858..628fd8ccd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0). +## 2025.1.1 + +### Fixed + +- The themes select is empty [#2527](https://github.com/magento/magento2-phpstorm-plugin/pull/2527) + ## 2025.1.0 ### Added diff --git a/README.md b/README.md index 85a5ae4ef..288c9d783 100644 --- a/README.md +++ b/README.md @@ -12,36 +12,8 @@ PhpStorm IDE Plugin for a better Magento 2 development workflow. - - - Version 2025.0.0 - Contributors - - - - - - Yevhen Zvieriev -
- Yevhen Zvieriev -
- - - - Mykola Silin -
- Mykola Silin -
- - - - Vitalii Boiko -
- Vitalii Boiko -
- - diff --git a/gradle.properties b/gradle.properties index 934860abb..c14a88efe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ pluginGroup = com.magento.idea.magento2plugin pluginName = Magento PhpStorm pluginRepositoryUrl = https://github.com/magento/magento2-phpstorm-plugin -pluginVersion = 2025.1.0 +pluginVersion = 2025.1.1 pluginSinceBuild = 243.3 pluginUntilBuild = 258.* platformType = PS diff --git a/src/main/java/com/magento/idea/magento2plugin/magento/packages/Package.java b/src/main/java/com/magento/idea/magento2plugin/magento/packages/Package.java index 9ed340294..d031f591f 100644 --- a/src/main/java/com/magento/idea/magento2plugin/magento/packages/Package.java +++ b/src/main/java/com/magento/idea/magento2plugin/magento/packages/Package.java @@ -8,6 +8,7 @@ public class Package { //NOPMD public static final String V_FILE_SEPARATOR = "/"; public static String packagesRoot = "app/code"; + public static String packagesDesignRoot = "app/design"; public static String libWebRoot = "lib/web"; public static String frameworkRootComposer = "vendor/magento/framework"; public static String frameworkRootGit = "lib/internal/Magento/Framework"; diff --git a/src/main/java/com/magento/idea/magento2plugin/util/magento/IsFileInEditableModuleUtil.java b/src/main/java/com/magento/idea/magento2plugin/util/magento/IsFileInEditableModuleUtil.java index a9f789fef..6e48db8f1 100644 --- a/src/main/java/com/magento/idea/magento2plugin/util/magento/IsFileInEditableModuleUtil.java +++ b/src/main/java/com/magento/idea/magento2plugin/util/magento/IsFileInEditableModuleUtil.java @@ -9,6 +9,7 @@ import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiFile; import com.magento.idea.magento2plugin.project.Settings; +import java.util.ArrayList; import java.util.List; public final class IsFileInEditableModuleUtil { @@ -29,7 +30,7 @@ public static boolean execute(final PsiFile file) { } /** - * Validates if a given virtual file is located within editable paths defined by Magento project structure. + * Validates if a given virtual file is located within editable paths. * * @param project the current project containing the virtual file * @param virtualFile the file to check against editable module directories @@ -37,29 +38,26 @@ public static boolean execute(final PsiFile file) { */ public static boolean execute(final Project project, final VirtualFile virtualFile) { final Settings settings = Settings.getInstance(project); - List magentoToFolders = settings.getMagentoFolders(); - final String magentoPathUrl = MagentoPathUrlUtil.execute(project); - if (magentoPathUrl != null) { - if (magentoToFolders == null) { - magentoToFolders = List.of( - magentoPathUrl - ); - } else { - magentoToFolders.add( - magentoPathUrl - ); - } - } + List editablePaths = settings.getMagentoFolders(); + final String magentoRootPath = MagentoPathUrlUtil.execute(project); + final String magentoDesignPath = MagentoPathUrlUtil.getDesignPath(project); + if (magentoRootPath == null) { + return false; + } + if (editablePaths == null) { + editablePaths = new ArrayList<>(); + } - if (magentoToFolders == null) { - return false; + editablePaths.add(magentoRootPath); + if (magentoDesignPath != null) { + editablePaths.add(magentoDesignPath); } - final String filePath = virtualFile.getUrl(); - for (final String editablePath : magentoToFolders) { - if (normalizeUrl(filePath).startsWith(normalizeUrl(editablePath))) { + final String currentFilePath = virtualFile.getUrl(); + for (final String editablePath : editablePaths) { + if (normalizeUrl(currentFilePath).startsWith(normalizeUrl(editablePath))) { return true; } } diff --git a/src/main/java/com/magento/idea/magento2plugin/util/magento/MagentoPathUrlUtil.java b/src/main/java/com/magento/idea/magento2plugin/util/magento/MagentoPathUrlUtil.java index bc808c2c2..7f1a081e1 100644 --- a/src/main/java/com/magento/idea/magento2plugin/util/magento/MagentoPathUrlUtil.java +++ b/src/main/java/com/magento/idea/magento2plugin/util/magento/MagentoPathUrlUtil.java @@ -31,4 +31,24 @@ public static String execute(Project project) { return null; } + + /** + * Constructs a file URL for the Magento packages root, based on the project settings. + * + * @param project the project instance + * @return the constructed file URL + */ + public static String getDesignPath(Project project) { + String magentoPath = Settings.getMagentoPath(project); + if (magentoPath != null) { + return VirtualFileManager.constructUrl( + "file", + magentoPath + + File.separator + + Package.packagesDesignRoot + ); + } + + return null; + } } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index ac35da6e7..efca82d10 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -7,7 +7,7 @@ com.magento.idea.magento2plugin Magento PhpStorm - 2025.1.0 + 2025.1.1 Magento Inc.