From 66edec03a9acc319c756c78f57a1f78bc5db2604 Mon Sep 17 00:00:00 2001 From: Vitaliy Boyko Date: Wed, 21 Apr 2021 16:45:44 +0300 Subject: [PATCH 1/4] 3.2.2 initial --- .github/workflows/gradle.yml | 2 +- CHANGELOG.md | 2 ++ build.gradle | 2 +- resources/META-INF/plugin.xml | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 51c78b794..593598e48 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -5,7 +5,7 @@ name: Run automated tests on: pull_request: - branches: [ master, 3.2.1-develop ] + branches: [ master, 3.2.2-develop ] jobs: build-linux: diff --git a/CHANGELOG.md b/CHANGELOG.md index 84b67880b..7e489060b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ 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). +## 3.2.2 + ## 3.2.1 ### Fixed diff --git a/build.gradle b/build.gradle index 9ccae6990..89287e354 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ repositories { } group 'com.magento.idea' -version '3.2.1' +version '3.2.2' apply plugin: 'org.jetbrains.intellij' apply plugin: 'java' diff --git a/resources/META-INF/plugin.xml b/resources/META-INF/plugin.xml index d1caeb0cf..e7607db85 100644 --- a/resources/META-INF/plugin.xml +++ b/resources/META-INF/plugin.xml @@ -7,7 +7,7 @@ com.magento.idea.magento2plugin Magento PhpStorm - 3.2.1 + 3.2.2 Magento Inc. Date: Mon, 26 Apr 2021 15:16:29 +0300 Subject: [PATCH 2/4] Fixed `Java.lang.IllegalArgumentException` During adding a new method into an existing plugin Adjusted plugin logo --- CHANGELOG.md | 4 ++++ resources/META-INF/pluginIcon.svg | 8 ++++++- .../PluginGenerateMethodHandlerBase.java | 22 +++++++++++++------ 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e489060b..507100690 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0). ## 3.2.2 +### Fixed + +- `Java.lang.IllegalArgumentException` During adding a new method into an existing plugin + ## 3.2.1 ### Fixed diff --git a/resources/META-INF/pluginIcon.svg b/resources/META-INF/pluginIcon.svg index a79977df8..564f534c2 100644 --- a/resources/META-INF/pluginIcon.svg +++ b/resources/META-INF/pluginIcon.svg @@ -1 +1,7 @@ -Magento-colorAlexis Doreau \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/src/com/magento/idea/magento2plugin/actions/generation/PluginGenerateMethodHandlerBase.java b/src/com/magento/idea/magento2plugin/actions/generation/PluginGenerateMethodHandlerBase.java index 2cb3b262d..c2fdb8ce8 100644 --- a/src/com/magento/idea/magento2plugin/actions/generation/PluginGenerateMethodHandlerBase.java +++ b/src/com/magento/idea/magento2plugin/actions/generation/PluginGenerateMethodHandlerBase.java @@ -44,7 +44,6 @@ import gnu.trove.THashSet; import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Locale; @@ -318,18 +317,27 @@ public static Collection fixOrderToBeAsOriginalFiles( final PhpNamedElementNode... selected ) { final List newSelected = ContainerUtil.newArrayList(selected); - Collections.sort(newSelected, (o1, o2) -> { + newSelected.sort((o1, o2) -> { final PsiElement psiElement = o1.getPsiElement(); final PsiElement psiElement2 = o2.getPsiElement(); final PsiFile containingFile = psiElement.getContainingFile(); final PsiFile containingFile2 = psiElement2.getContainingFile(); return containingFile.equals(containingFile2) - ? psiElement.getTextOffset() - psiElement2.getTextOffset() - : containingFile.getName().compareTo(containingFile2.getName()); + ? psiElement.getTextOffset() - psiElement2.getTextOffset() + : getDocumentPosition(containingFile, containingFile2); }); return newSelected; } + private static int getDocumentPosition( + final PsiFile containingFile, + final PsiFile containingFile2 + ) { + return containingFile.getVirtualFile().getPresentableUrl().compareTo( + containingFile2.getVirtualFile().getPresentableUrl() + ); + } + private static int getSuitableEditorPosition(final Editor editor, final PhpFile phpFile) { final PsiElement currElement = phpFile.findElementAt(editor.getCaretModel().getOffset()); if (currElement != null) { @@ -371,9 +379,9 @@ private static boolean isClassMember(final PsiElement element) { return false; } final IElementType elementType = element.getNode().getElementType(); - return elementType == PhpElementTypes.CLASS_FIELDS - || elementType == PhpElementTypes.CLASS_CONSTANTS - || elementType == PhpStubElementTypes.CLASS_METHOD; + return elementType.equals(PhpElementTypes.CLASS_FIELDS) + || elementType.equals(PhpElementTypes.CLASS_CONSTANTS) + || elementType.equals(PhpStubElementTypes.CLASS_METHOD); } private static int getNextPos(final PsiElement element) { From 42fe9782b69dfbfbedddc033749fce09347445f0 Mon Sep 17 00:00:00 2001 From: bohdan-harniuk Date: Mon, 26 Apr 2021 15:32:58 +0300 Subject: [PATCH 3/4] Fixed wrong new entity layout name and edit entity layout name inside it --- .../actions/generation/dialog/NewEntityDialog.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/magento/idea/magento2plugin/actions/generation/dialog/NewEntityDialog.java b/src/com/magento/idea/magento2plugin/actions/generation/dialog/NewEntityDialog.java index 1b9c14d58..b94448b76 100644 --- a/src/com/magento/idea/magento2plugin/actions/generation/dialog/NewEntityDialog.java +++ b/src/com/magento/idea/magento2plugin/actions/generation/dialog/NewEntityDialog.java @@ -50,7 +50,6 @@ import com.magento.idea.magento2plugin.ui.FilteredComboBox; import com.magento.idea.magento2plugin.ui.table.TableGroupWrapper; import com.magento.idea.magento2plugin.util.CamelCaseToSnakeCase; -import com.magento.idea.magento2plugin.util.FirstLetterToLowercaseUtil; import com.magento.idea.magento2plugin.util.magento.GetAclResourcesListUtil; import com.magento.idea.magento2plugin.util.magento.GetModuleNameByDirectoryUtil; import java.awt.Cursor; @@ -445,7 +444,7 @@ private EntityCreatorContextData getEntityCreatorContextData( final String dtoInterfaceClassName = entityName.concat(DTO_INTERFACE_SUFFIX); final String actionsPathPrefix = dialogData.getRoute() + File.separator - + FirstLetterToLowercaseUtil.convert(entityName) + File.separator; + + entityName.toLowerCase(Locale.getDefault()) + File.separator; final NamespaceBuilder dtoModelNamespace = new DataModelFile(moduleName, dtoClassName).getNamespaceBuilder(); final NamespaceBuilder dtoInterfaceNamespace = From c125854d1368e3b321f569feecfa2c245dc8ca34 Mon Sep 17 00:00:00 2001 From: bohdan-harniuk Date: Mon, 26 Apr 2021 15:40:33 +0300 Subject: [PATCH 4/4] Added change to changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e489060b..40f04fed8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0). ## 3.2.2 +### Fixed + +- New entity layout name and edit entity layout name inside it + ## 3.2.1 ### Fixed